Skip to content

Commit a826d98

Browse files
committed
removed ai comments
1 parent 09d0d95 commit a826d98

18 files changed

Lines changed: 42 additions & 76 deletions

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "npm"
8+
directory: "/website"
9+
schedule:
10+
interval: "weekly"

core/ui/modules/clipboard.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ export async function clearSelectedCellValues() {
145145
state.lastSelectedCell = null;
146146
state.selectedColumns.clear();
147147

148-
// Full reload or just local update?
149-
// Perform a full reload to ensure UI consistency with backend state.
150148
await loadTableData();
151149
updateToolbarButtons();
152150
updateStatus(`${label} - Ctrl+S to save`);

core/ui/modules/crud.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ async function submitDeleteRows() {
116116
if (state.selectedRowIds.size === 0) return;
117117

118118
const rowIds = Array.from(state.selectedRowIds);
119-
// Validation happens in HostBridge/backend now but good to be type-safe here?
120-
// They are stored as numbers in state mostly.
121119

122120
try {
123121
updateStatus('Deleting rows...');

core/ui/modules/dnd.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ function onDragOver(e) {
4444
}
4545

4646
function onDragLeave(e) {
47-
// Only remove if leaving the cell (not entering a child)
48-
// But dragleave fires when entering a child too.
49-
// Simpler to rely on dragover to manage the class, or clean up if leaving grid.
5047
if (e.target === lastHighlightedCell) {
5148
// This flickers. Rely on dragover.
5249
}
@@ -78,8 +75,7 @@ async function onDrop(e) {
7875
const uris = uriList.split(/\r?\n/);
7976
if (uris.length > 0 && uris[0]) {
8077
let uri = uris[0];
81-
// Decode URI if needed, but VS Code usually provides encoded URIs
82-
// We need a name. Try to extract from URI.
78+
// Extract name from URI
8379
let name = 'unknown_file';
8480
try {
8581
// Simple parsing for name
@@ -109,25 +105,16 @@ async function handleFileUpload(cell, fileName, fileBlob) {
109105
async function handleUriUpload(cell, fileName, uri) {
110106
try {
111107
updateStatus(`Fetching ${fileName}...`);
112-
// Use backend to read file from workspace
113-
// Response should be the buffer/array
114108
const result = await backendApi.readWorkspaceFileUri(uri);
115109

116-
// Result comes back as the data structure from RPC.
117-
// HostBridge returns Uint8Array.
118-
// PostMessage serialization handles Uint8Array correctly usually.
119-
// If it comes as { type: 'Buffer', data: [...] } (Node Buffer serialization), we need to handle it.
120-
121110
let uint8Array;
122111
if (result instanceof Uint8Array) {
123112
uint8Array = result;
124113
} else if (result && result.type === 'Buffer' && Array.isArray(result.data)) {
125114
uint8Array = new Uint8Array(result.data);
126115
} else if (result && typeof result === 'object' && Object.keys(result).some(k => !isNaN(k))) {
127-
// Sometimes obj-like {0: x, 1: y...}
128116
uint8Array = new Uint8Array(Object.values(result));
129117
} else {
130-
// Fallback or error
131118
console.error('Unknown data format from backend:', result);
132119
throw new Error('Received invalid data format from backend');
133120
}

core/ui/modules/edit.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ export async function openCellInVsCode() {
202202
const { rowIdx, colIdx, rowId, columnName, originalValue } = state.cellPreviewInfo;
203203
const column = state.tableColumns[colIdx];
204204

205-
// We need to determine if it's text, json, blob, etc.
206-
// For now passing value as is.
207-
// We pass metadata to help extension determine extension/language.
208-
209205
// We get the webview id from dataset if available or assume 'default'
210206
const webviewId = document.getElementById('vscode-env')?.dataset.webviewId || 'default';
211207

core/ui/modules/grid.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,6 @@ export async function loadTableData(showSpinner = true, saveScrollPosition = tru
290290

291291
const dataResult = await backendApi.fetchTableData(state.selectedTable, queryOptions);
292292

293-
// Data result rows now include rowid at index 0 if we requested it.
294-
// `grid.js` logic: `getRowId` uses `row[0]`. `getCellValue` uses `colIdx + getRowDataOffset()`.
295-
// `getRowDataOffset` returns 1 if table (skipping rowid).
296-
// So if `dataResult.rows` has `[rowid, col1, col2]`, it matches the expectation!
297-
298293
state.gridData = dataResult.rows || [];
299294

300295
// If not showing spinner (background refresh), capture the current scroll position

core/ui/modules/sidebar.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ export async function applyBatchUpdate() {
262262
const freshSelectedCells = [];
263263
for (const oldCell of state.selectedCells) {
264264
// Find corresponding row in new gridData
265-
// If pagination/sort changed, indices might be wrong, but we didn't change those.
266-
// However, we re-fetched, so rows might have moved if we sorted by the column we updated?
267-
// Assuming stable order for now.
268265
const newValue = state.gridData[oldCell.rowIdx][oldCell.colIdx + getRowDataOffset()];
269266
freshSelectedCells.push({ ...oldCell, value: newValue });
270267
}

core/ui/modules/utils.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ function formatDate(value, format) {
8989
if (value instanceof Date) {
9090
date = value;
9191
} else if (typeof value === 'number') {
92-
// Assume unix timestamp (seconds if small, millis if large?)
93-
// SQLite often uses seconds (REAL or INTEGER)
94-
// If it's small (e.g. < 10^11), assume seconds.
92+
// Assume unix timestamp
9593
if (value < 100000000000) {
9694
date = new Date(value * 1000);
9795
} else {

natives/native-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ async function handleRequest(request) {
342342
result = runResult;
343343
} else {
344344
// tjs sqlite might not expose totalChanges/changes on db object
345-
// We need to query for it if missing
345+
// Query for value if missing
346346
if (db.changes !== undefined) {
347347
result = {
348348
changes: db.changes,

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@
1010
"type": "git",
1111
"url": "https://github.com/zknpr/sqlite-explorer"
1212
},
13-
"funding": {
14-
"type": "individual",
15-
"url": "https://buymeacoffee.com/zknpr"
16-
},
13+
"funding": [
14+
{
15+
"type": "github",
16+
"url": "https://github.com/sponsors/zknpr"
17+
},
18+
{
19+
"type": "ko-fi",
20+
"url": "https://ko-fi.com/zknpr"
21+
},
22+
{
23+
"type": "BuyMeACoffee",
24+
"url": "https://buymeacoffee.com/zknpr"
25+
}
26+
],
1727
"engines": {
1828
"vscode": "^1.83.1"
1929
},
@@ -161,4 +171,4 @@
161171
"@vscode/extension-telemetry": "^1.2.0",
162172
"sql.js": "^1.13.0"
163173
}
164-
}
174+
}

0 commit comments

Comments
 (0)