Skip to content

fix: F5 refreshes the schema everywhere, never reloads - #907

Merged
EVWorth merged 1 commit into
mainfrom
claude/hopeful-bardeen-1k4d1h
Oct 29, 2026
Merged

EVWorth merged 1 commit into
mainfrom
claude/hopeful-bardeen-1k4d1h

Conversation

@EVWorth

@EVWorth EVWorth commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Closes #898.

What was wrong

  • F5 refreshed the schema only while the SQL editor had focus (a Monaco action in SQLEditor.tsx). Anywhere else the key went through to the webview.
  • WebView2 (Windows) has browser accelerator keys on by default, so F5, Ctrl+R and Ctrl+Shift+R reload the page and throw away every tab's unsaved work. wry can turn these keys off, but Tauri 2.12 doesn't expose that setting, so the app has to block them itself.
  • The shortcuts dialog listed Ctrl+Shift+R as "Refresh schema (menu)". Nothing has bound that key since the native menu started being built from ACTIONS (fix: build the macOS menu from the action list #897).

Change

  • useKeyboardShortcuts:
    • F5 refreshes the selected connection's schema and always calls preventDefault.
    • While the editor has focus, the editor's own F5 action does the refresh, so one key press doesn't refresh twice.
    • In release builds (import.meta.env.PROD), Ctrl/Cmd+R, Ctrl/Cmd+Shift+R and Ctrl+F5 are blocked. Dev builds can still reload.
  • actions.ts: refresh-schema gets shortcut: "F5", so the command palette and the macOS menu show it.
  • Shortcuts dialog: F5 moves to Navigation, and the stale Ctrl+Shift+R row is removed.

Tests

  • npx vitest run src/hooks src/lib src/components/common: 83 files, 1395 tests pass.
  • New cases cover:
    • F5 refreshes the schema.
    • With no connection, F5 only blocks the reload.
    • With the editor focused, F5 defers to the editor's action.
    • Reload keys are blocked in release builds and allowed in dev.
  • npm run type-check and npx dprint check are clean. npm run lint shows 0 errors (160 warnings, all from before this PR).
  • Not checked on real hardware: the WebView2 reload behaviour on a Windows build.

Generated by Claude Code

F5 only refreshed the schema while the SQL editor had focus. Elsewhere it
fell through to the webview, and WebView2 (Windows) reloads the page on
F5, Ctrl+R and Ctrl+Shift+R, dropping every tab's unsaved work. Tauri
2.12 does not expose WebView2's browser-accelerator setting, so the app
handler blocks them: F5 always, the reload chords in release builds.

The shortcuts dialog listed Ctrl+Shift+R as a menu refresh that no
longer exists; it now lists F5 under Navigation.

Closes #898

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
@EVWorth
EVWorth merged commit 935f3a7 into main Oct 29, 2026
12 checks passed
@EVWorth
EVWorth deleted the claude/hopeful-bardeen-1k4d1h branch October 29, 2026 11:59
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026
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.

fix: README says F5 refreshes the schema; nothing does

2 participants