fix(update-dialog): draggable backdrop, selectable text, and localization#98
Merged
Merged
Conversation
…tion The desktop update dialog renders outside <main>, so the app-shell window-drag handler treated its text as draggable window chrome — text couldn't be selected and a drag moved the whole window. The backdrop also dismissed on a drag that released over it. - Exclude [role='dialog'] from the window-drag gesture (and dedupe the two identical guard blocks into one selector); tag both update dialogs with role="dialog". Text is now selectable inside the dialog while the dimmed backdrop still drags the window. - Localize the dialog UI via a new `update` i18n namespace (title/buttons follow the app language). - Support bilingual release notes via `<!-- lang:xx -->` fences; localizeChangelog picks the section for the active language and falls back to the whole body for single-language notes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The update dialog is mounted at the App root, outside
<main>, so the app-shell's window-drag handler treated the dialog's text as draggable window chrome: text couldn't be selected, and dragging moved the whole window. The backdrop also dismissed the dialog when a drag happened to release over it. (Other dialogs render inside route pages — i.e. inside<main>— so they were already exempt.)Change
Drag / selection
[role='dialog']from the window-drag gesture inapp-shell, and dedupe the two identical guard blocks (onMouseDown/onDblClick) into oneNO_WINDOW_GESTUREselector.role="dialog". Text inside the dialog is now selectable; the dimmed backdrop is left as plain chrome so pressing it still drags the window. Dismiss via the header ✕ / Later / Close.Localization
updatei18n namespace — the dialog title and buttons follow the app language.localizeChangelogsplits the changelog body on<!-- lang:en -->/<!-- lang:zh -->fences and shows the section for the active language, falling back to English, then to the whole body. Single-language notes without fences render unchanged.Testing
npm test(238) +cargo test --workspacegreen. Added 4 unit tests forlocalizeChangelog(language pick, regional-code normalization, fallback, no-fence passthrough).Notes / follow-up
The dialogs keep the existing
aria-modal="true"without a real focus-trap (consistent with the app's other hand-rolled modals). Adopting an accessible dialog primitive (Radix / native<dialog>) app-wide to add focus-trap + Esc + inert background is tracked as a separate a11y task.🤖 Generated with Claude Code