Skip to content

fix(settings): Preferences without wrong-state flashes, MCP pane polish, a fake Data Grid switch removed - #1632

Open
ZhuchkaTriplesix wants to merge 3 commits into
devfrom
review/settings-perf-mcp
Open

ZhuchkaTriplesix wants to merge 3 commits into
devfrom
review/settings-perf-mcp

Conversation

@ZhuchkaTriplesix

@ZhuchkaTriplesix ZhuchkaTriplesix commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Review of Preferences ("feels laggy", "MCP looks rough"), measured and fixed.

What "laggy" was

Frame times were fine (profile build, new bench scenarios): scrolling, typing, hover and toggles stay under 4 ms build / 2 ms raster. What felt like lag was wrong state drawn first, then a jump:

  • MCP Server pane, on every visit: the server switch off while the status says "Running", "No SQL connections", "No calls yet", Regenerate disabled; a frame or two later the switch animates on, the list appears and everything below moves down.
  • The dialog read 9 settings one after another before showing real values.
  • About: a FutureBuilder future created in build() restarted on every rebuild (every keystroke in the search), so the portable-mode banner flickered.
  • One scroll view for all panes: Shortcuts opened half-scrolled after scrolling MCP.

Changes

  • MCP: nothing that depends on stored state is drawn until it has loaded (a spinner for that frame instead). MongoDB connections are listed (the server has MongoDB tools and checks access for them; the UI never let you share one). Type badges say PostgreSQL / MySQL / SQLite / MongoDB. The querya-mcp path is on its own line instead of breaking mid-path. "Copy … config" buttons and "Access token → Regenerate" (which disconnects clients) are separate groups. Recent calls are rows with a status icon (ok / refused / error), the tool in bold, client and time right-aligned, dividers, and the refusal rule as a badge.
  • Dialog: visited panes stay mounted (offstage, tickers off) with their own scroll position and are not rebuilt while hidden.
  • Data Grid: removed "Confirm DML staging applications". It wrote confirm_destructive_operations (the SQL DROP / TRUNCATE / DELETE confirmation) and nothing reads a staging setting, so turning it off in Data Grid silently turned off the SQL confirmation.
  • About: the real version from the package (it said "Version 0.4.17"); both futures created once.
  • Bench: benchmark/app_perf_bench.dart gets Preferences scenarios (prefs_*: open, each category, reopen, scroll, typing, toggles); running only them skips the rest.

Numbers

Build max per scenario, median of 3 profile runs, dev → this branch (60 Hz stock engine, 120 Hz display):

Scenario dev branch
open 17.5 16.9
first visit: Appearance / SQL / Data Grid / Extensions 6.0 / 4.1 / 2.6 / 2.3 5.9 / 4.2 / 2.7 / 3.2
first visit: MCP 4.3 4.2–5.7 (2 runs)
first visit: Shortcuts / About / General 9.7 / 4.1 / 3.0 9.2 / 3.9 / 2.9
reopen 5.2 5.9

An earlier version of this branch made the first MCP visit 10 ms; bisecting showed it was the generic 'monospace' family (a fontconfig lookup on first use). The pane now uses the editor's QueryaTypography stack, which is already resolved. Other places still use 'monospace' (welcome tour, PostgreSQL browser views) and pay the same once.

The first open of the dialog in a session is the one remaining heavy frame (~17 ms build); it is the same on dev and not addressed here.

Settings are still read one after another: sqflite serializes queries on one database, so reading them concurrently saved nothing and only started lock-wait timers (which failed the widget tests on the first CI run).

Tests: the MCP section (MongoDB listed, product badges, nothing drawn before load, path line, refusal badge) and the dialog (no staging switch in Data Grid, each pane keeps its own scroll). Not run locally; CI decides.

…polish

- Preferences: settings load in parallel; visited panes stay mounted with their
  own scroll position and are not rebuilt while hidden.
- Data Grid: remove 'Confirm DML staging applications', which wrote the SQL
  destructive-confirmation setting and was read by nothing else.
- About: the real app version instead of a hardcoded 0.4.17; the portable-mode
  future is created once.
- MCP: draw nothing that depends on stored state until it loads; list MongoDB
  connections; product names in type badges; querya-mcp path on its own line;
  copy buttons and the access token in separate groups; recent calls as rows
  with a status icon, divider and time.
- Bench: Preferences scenarios (open, each category, reopen, scroll, typing,
  toggles).
The generic 'monospace' family costs a fontconfig lookup on first use (first
MCP visit 10.4 ms build vs 4.3 on dev); the editor's QueryaTypography stack is
already resolved when a workspace is open (4.2-5.7 ms).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant