Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/common/js/scl-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ let textToSqlPopupEl = null;
const pendingMessages = new Map();
const RESULTS_CHUNK_SIZE = 1000;
const ENABLE_SQL_AUTOCOMPLETE = true;
const DESKTOP_VIEWPORT = 'width=1280, initial-scale=1.0';
const TEXT_TO_SQL_PROVIDER_DEFAULT = 'chatgpt';
const TEXT_TO_SQL_MODEL_DEFAULT = 'gpt-4o-mini';
const TEXT_TO_SQL_CUSTOM_ENDPOINT_DEFAULT = '';
Expand Down Expand Up @@ -712,6 +713,19 @@ function toggleCustomEndpointField() {
textToSqlCustomEndpointGroup.classList.toggle('d-none', provider !== 'custom');
}

function enforceDesktopViewport() {
const viewportMeta = document.querySelector('meta[name="viewport"]');
if (viewportMeta) {
viewportMeta.setAttribute('content', DESKTOP_VIEWPORT);
return;
}

const createdViewportMeta = document.createElement('meta');
createdViewportMeta.setAttribute('name', 'viewport');
createdViewportMeta.setAttribute('content', DESKTOP_VIEWPORT);
document.head.appendChild(createdViewportMeta);
}

async function generateSqlFromPrompt(promptText) {
const settings = getSettings();
const provider = settings.textToSqlProvider || TEXT_TO_SQL_PROVIDER_DEFAULT;
Expand Down Expand Up @@ -934,6 +948,7 @@ function initCodeMirrorEditor() {

// ===== Init =====
export async function init() {
enforceDesktopViewport();
setStatus('Initializing SQLite...');
try {
const info = await sendWorker('init');
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=1280, initial-scale=1.0" />
<title>SQLite Client</title>
<meta name="description" content="Browser-based SQLite client with OPFS persistence." />
<meta
Expand Down
Loading