Repository navigation
feat: mock backend gaps; components go via stores - #918
Merged
Merged
Conversation
A helper written into scripts/ while `just dev-web` runs reloaded the page and wiped whatever state a review had reached. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
TableDesigner called the table reads itself and kept their loading and error state. They now go through tableDetailsStore, keyed by the mounted view, so the store owns that state and the reads are tested there. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
TableStructure read the table's columns, indexes, keys, partitions and DDL itself. It now asks tableDetailsStore, which owns the loading state and the per-part errors. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The event mock in @tauri-apps/api looks for `args.id` on unlisten while the event API sends `eventId`, so no listener was ever removed and every emit after a dialog closed logged "Couldn't find callback id". The mock backend now passes the id under both names. A restore with every statement refused (read-only production, Stop on error off) reported partiallyApplied with nothing run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
`?mock=connected&fail=get_foreign_keys,save_connection_profile` makes the named commands reject, with a QueryError for the three commands typed that way and the CoreError string for the rest, so every error state can be reviewed without wrapping invoke by hand. A trailing `*` matches by prefix. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
`?mock=lost` connects Local dev and then loses its server: every health check fails and is reported, so the red tab and "Lost — retrying (n)" can be reviewed, and reads fail with 2013. `?mock=servers` adds a read-write production profile, a MariaDB that connects, a wrong password (1045) and a server that times out, each worded as the backend words it. The admin and restore handlers read profiles from the mock state rather than the static list, so the added profiles behave as listed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
save_connection_profile and test_connection accepted any port. The Rust profile's port is a u16, so Tauri rejects 70000, -1 or 3306.5 before the command runs; the mock now rejects them with the same message. Port 0 gets through as it does in the app, and connecting to it is refused. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The backup, restore and import dialogs called the API themselves and each kept its own run state. backupStore now owns the job id, progress, cancel and outcome of each run, and fileStore wraps the native file dialogs and file reads that these and other components use. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
`update=available|downloading|download-error|error` drives the updater plugin, including the download's progress channel; `keyring=missing` and `startup=problems` report the missing credential store and the stores that could not be opened, worded as the backend words them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
QueryHistory, HistoryQuickOpen and QueryFavorites called the API for history reads and file dialogs. historyStore now owns the export to a file (with its exporting flag) and the quick-open search, and favoritesStore exports to and imports from a file. The component tests mock the stores; the file flows are tested in the store tests. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
History grows to 130 entries, so paging can be tried; shop gets events in each state; the admin panel's Users and Roles tabs read accounts from mysql.user, the role tables and SHOW GRANTS, which the user statements change. The SQLite fixture already had a view (#825). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
ProcessListTab, ServerVariablesTab, UserDetail and PrivilegesEditor called the API themselves. adminStore now owns the process list (with kill), the server variables and an account's grants, with their loading and error state, keyed by the mounted tab. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
An agent turn now picks its request from the message: approvals on production and staging, a schema change, propose_edit, open_draft, and two approvals at once. Requests are no longer queued in the mock, since the window queues them. `agent=uninstalled` reports no harness installed and `agent=no-tools` starts sessions without the database tools. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
StatusBar and the help dialog called the API for the app version, the keyring check and the startup report. appInfoStore now holds them. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
RoutineViewer called the API for the routine's DDL and kept its own loading and error state. It now uses ddlStore, the same entry the DDL tab for that routine reads. A failure is shown as the server said it, without the "Error: " prefix String(e) added (#804). Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
useConnectionForm called the API to test a profile. connectionStore now has testConnection, which turns a failure into an unsuccessful result as the hook did. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Components call store actions, never api.* (src/CLAUDE.md). With the last direct calls moved into stores, a no-restricted-imports rule keeps new ones out. Type-only imports and tests are allowed. Closes #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
CREATE, ALTER, RENAME and DROP TABLE, CREATE and DROP INDEX and CREATE and DROP DATABASE now change the fixture, so the schema reads after a designer Apply show the change. Each statement is all-or-nothing, and invalid DDL such as `CREATE TABLE orders ()` fails with the server's 1064, with 1050, 1060, 1061, 1091 and 1146 for the other usual mistakes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The first progress event arrived at once, so the dialog's state before any progress could not be reviewed. It now comes 450 ms in. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Opening a favorite wrote its SQL into the tab without setting the saved baseline, so the tab showed as unsaved and closing it asked to save what had just been opened. Double-click into a new tab had the same problem. Both now mark the SQL as the tab's saved content. Closes #909 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Disconnecting ends the connection's tab sessions, and the server rolls back any transaction they had open, but the tabs kept their TX badge. The disconnect path now forgets the transaction state of every tab bound to that connection. Closes #910 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
executeQuery's failed outcome carried String(e), so TableDesigner and RoutineViewer showed "Error: ..." where the results pane shows the message alone. The outcome now uses the same text as the pane. Closes #912 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
After the merge of #916: the QueryError command check follows the regenerated bindings (QueryError_Serialize), and execute_query's completedResults and per-session transaction state have tests (#917). Closes #785 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
This was referenced Oct 29, 2026
This was referenced Oct 30, 2026
Merged
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.
Two
implementer-frontendlanes, combined to save a CI cycle. Each one's commits are self-contained.Closes #785, #862, #909, #910, #912.
#785: mock backend gaps (
src/dev/mock/andvite.config.tsonly)?mock=connected&fail=get_foreign_keys,save_connection_profile. Also takes prefixes (fail=get_*) and plugin commands. Each command fails with the error shape the backend would return for it.?mock=lost: the health check starts failing after 4 s.?mock=serversadds four profiles: read-write production, a MariaDB that connects, a wrong password (1045) and a connect timeout.update=available|downloading|download-error|error,keyring=missing,startup=problems.shop.propose_edit,open_draft, or two approvals at once.agent=uninstalledandagent=no-tools.CREATE TABLE orders ()fails with 1064.@tauri-apps/api2.12's mock readsargs.id, but the event API sendseventId. That caused the "Couldn't find callback id" spam.partiallyApplied.**/scripts/**is now ignored by the watcher.src/dev/mock/README.mdand in theui-previewskill. This also adds tests for the mock'scompletedResultsandtransactionfields (part of fix: timeout and failure lose run results/state #917).#862: components never call
api.*.tsfiles). None do now.tableDetailsStore: table reads, including the designer's reference tables.backupStore: backup, restore and import runs, with progress and cancel.fileStore: file pick, read and write.adminStore: process list, server variables and grants.appInfoStore: app version, keyring check and startup problems.testConnection;@typescript-eslint/no-restricted-importsforbids importinglib/tauri-apifromsrc/components/**. Type-only imports and tests are allowed.Small fixes
Tests
npm run test:unitpasses (196 files, 3695 tests).npm run type-checkandnpx dprint checkare clean.npm run linthas 0 errors and no new warnings.#862lane ran the browser tests one file at a time, and all passed: ImportDialog, ProcessListTab, ServerVariablesTab, ConnectionDialog, AppLayout, MainPanel, Sidebar, TitleBar.Generated by Claude Code