Skip to content

fix(update-dialog): draggable backdrop, selectable text, and localization#98

Merged
RealZST merged 1 commit into
mainfrom
fix/update-dialog-drag-text-selection
Jun 30, 2026
Merged

fix(update-dialog): draggable backdrop, selectable text, and localization#98
RealZST merged 1 commit into
mainfrom
fix/update-dialog-drag-text-selection

Conversation

@RealZST

@RealZST RealZST commented Jun 30, 2026

Copy link
Copy Markdown
Owner

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

  • Exclude [role='dialog'] from the window-drag gesture in app-shell, and dedupe the two identical guard blocks (onMouseDown / onDblClick) into one NO_WINDOW_GESTURE selector.
  • Tag both update dialogs with 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

  • New update i18n namespace — the dialog title and buttons follow the app language.
  • Bilingual release notes: localizeChangelog splits 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 --workspace green. Added 4 unit tests for localizeChangelog (language pick, regional-code normalization, fallback, no-fence passthrough).
  • Verified in the desktop app: dialog text selects, dimmed area drags the window, double-click no longer maximizes; UI + changelog switch between English and Chinese with the app language.

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

…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>
@RealZST RealZST merged commit ce58c8d into main Jun 30, 2026
3 checks passed
@RealZST RealZST deleted the fix/update-dialog-drag-text-selection branch June 30, 2026 20:23
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