Repository navigation
feat(dev): mock backend for reviewing the UI in a browser - #780
Merged
Merged
Conversation
The router, the fixture dataset and state, the plugin handlers, the entry-point switch (`?mock` under `just dev-web`), a test that every command has a handler, and a screenshot script. The per-area handlers follow in the next commit; until then this does not build. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
All 14 schema reads, with indexes, foreign keys, routines, a trigger, an event and partitions, and SHOW CREATE-style DDL. Unknown objects fail with the backend's wording. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
A fake app.db for the SQLite browser; the agent panel's harnesses, endpoint, sharing terms and a scripted session: a read turn with a tool call, a permission prompt for writes, a staged-write approval, and cancel. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Connections, admin and files, still being written; final versions follow. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Process list and server variables with kills, a fake file system under /tmp/sqlpilot-mock, backup and restore with progress events and cancel, and a seeded query history with filters, facets and export. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
- The connection and query handlers' final versions, plus keyring_available, which the guard test missed: its pattern did not allow for a type argument (`__TAURI_INVOKE<boolean>(...)`). - `?mock=connected` connects through the app's own store once it has rendered: the app never asks the backend which connections are live. - Relative imports throughout. Vite has no `@/` alias, only vitest and tsconfig do, so the dev server could not load the mock; CLAUDE.md said otherwise and is corrected. - ui-snapshots.mjs waits for the server by polling, loads pages on "load" rather than "networkidle", takes CHROMIUM_PATH, and stops the server if the browser fails to launch. - CLAUDE.md: how to open the mock, and that a new command needs a handler. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
This was referenced Oct 21, 2026
Merged
EVWorth
added a commit
that referenced
this pull request
Oct 23, 2026
* release: 1.4.0 Version bump across the three manifests and the two lockfile entries that record the app's own version. Minor: features landed. From the UX review (#783), 34 issues fixed: Data safety - A sorted or filtered grid deleted or copied the wrong row (#839) - Grid edits saved against the editor's current text, not the result's table and connection (#840) - Switching result sets kept pending edits for the wrong rows (#869) - Restore into production now always asks (#789); Apply in the designer previews DROP COLUMN (#791) and is disabled when the table failed to load (#796); Delete Profile asks first (#795) - Non-default themes crashed the app on every launch (#781) Editor and results - Results and run state are kept per editor tab; cancelling one tab no longer stops another tab's query on the same connection (#842) - Run, Explain and Explain Analyze use the statement at the cursor (#846) - Unsaved tabs ask before closing (#843, partial); a user's own cancel reads as information, not an error (#850) - Double-click edits a cell again (#841); row 1 no longer hides under the header (#847); the LIMIT box can be cleared and retyped (#848) Connections - Run goes to the server the editor tab shows (#788) - Progress while connecting, with cancel (#799); full connect failures with Retry (#804); saved profiles in the sidebar, menu and palette (#817); Test Connection gives the same diagnosis as Connect and names MariaDB (#809) - Save failures keep the dialog open (#792); Port and timeouts can be retyped (#813) Schema browser, backup and agents - View Structure opens the structure panel (#787); DDL opens in a read-only editor tab (#800); the filter finds events (#806); FK reference columns survive a load error (#810) - Cancelled or partial restores warn (#793); run dialogs keep focus, ask before closing mid-run and keep Cancel on screen (#798, #803, #807); the backup bar counts rows (#811) - Agent approvals queue instead of replacing each other (#790), show the full SQL (#786), and the redaction field follows its patterns (#794) Also: a mock backend for reviewing the UI in a browser (#780), the agent setup moved from .opencode to Claude (#775), and dependency updates. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * fix(deps): bump tokio and ctutils for advisories RUSTSEC-2026-0384: tokio 1.54.0 -> 1.54.1 (race in time::Interval). RUSTSEC-2026-0385: ctutils 0.4.2 -> 0.4.5 (non-constant-time comparisons). Lockfile-only; security fixes are exempt from the dep age gate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The browser preview (
just dev-web) showed an empty app: outside Tauri, every command throws "Tauri not available". This adds a dev-only mock backend, so the whole UI runs in a browser with realistic data, and a script that screenshots the main screens. Both are for the planned UX/UI review, and for checking UI changes without a desktop build.Using it
just dev-web, then openhttp://localhost:1420/?mock. There are three starting points:?mock: four saved connections, nothing connected.?mock=empty: a first run, with no saved connections.?mock=connected: "Local dev" connected, starting in the editor.just ui-snapshotssaves 12 screens, in dark and light, at 1366×820 and 1024×680, intoui-snapshots/(gitignored). SetCHROMIUM_PATHif Playwright's own Chromium isn't installed.How it works
invokein the generated bindings, so onemockIPCcallback from@tauri-apps/api/mocksanswers them all.src/dev/mock/handlers/.main.tsxinstalls the mock only whenimport.meta.env.DEVis true and the URL has?mock. In a production build that condition is folded tofalse, sovite buildoutput contains none of the mock (checked).tauri-api.tschecks for Tauri on each call instead of once at import, so the mock can be installed after that module loads.shop,analytics) plus the system schemas. Rows are generated from a fixed seed, so screenshots of the same commit match.SELECT SLEEP(n)really waits and can be cancelled.src/dev/mock/__tests__/coverage.test.tsfails if a bindings command has no handler, or a handler names a command that no longer exists. Without it, a new backend command would break its screen in the preview unnoticed.Also fixed
CLAUDE.mdpitfall 6 said the@/alias is configured invite.config.ts. It isn't: only vitest and tsconfig define it. App code has to import relatively, and the mock now does.CLAUDE.md: documents how to open the mock, and that a new command needs a mock handler.Checks
tsc --noEmitis clean. ESLint has no errors; its two warnings were already in admin tests. dprint is clean.src/dev,src/libandsrc/stores, 1,438 passing, including the guard test.src/__tests__/main.test.tsxtimes out in this container onmaintoo, so CI has the final word on it.What it already shows
From the first screenshots and from the code read while writing the handlers:
+in the tab bar.These and about 60 smaller findings will be filed as issues in the review that follows. They aren't part of this PR.
Generated by Claude Code