Repository navigation
fix(ui): make the widget dialog a real dialog - #41
Merged
Merged
Conversation
Every frontend build printed the same two warnings: a click handler on the backdrop div and another on the modal div, neither with a keyboard equivalent. The warnings were pointing at something real, though not quite what they said — Escape already closed the dialog through the window handler. What was missing was everything else a dialog owes a keyboard: it announced itself as nothing, never took focus, never gave it back, and let Tab walk out into a page the user could no longer see. The backdrop click becomes a button that fills the backdrop and sits behind the dialog. That is what it always was — a mouse affordance — and saying so in markup removes the warning honestly instead of suppressing it. It stays out of the tab order and hidden from screen readers, because Escape and the × button are already the keyboard ways out and a third unlabelled one helps nobody. Being a sibling rather than a parent also means the dialog no longer has to stop propagation to avoid closing itself. The dialog itself gains role="dialog", aria-modal, and a label pointing at its own heading; it takes focus when it opens, hands focus back to whatever opened it when it closes, and cycles Tab within itself. Restoring focus is best effort: deleting a widget removes the pen icon that opened the dialog. While here, the tablist was half-wired — the panel it controls carried no role. One panel serves all three tabs, so the selected tab points at it and the panel names the tab currently showing, which keeps the pair valid as the content swaps. Verified: `npm run build` is now warning-free (it printed two a11y warnings before), and the GUI builds and launches. The keyboard behaviour itself I could not drive from here — this desktop has no input-injection tool — so Tab/Escape/focus-return needs a human at the window. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
YCistak
added a commit
that referenced
this pull request
Aug 10, 2026
Every frontend build printed the same two warnings: a click handler on the backdrop div and another on the modal div, neither with a keyboard equivalent. The warnings were pointing at something real, though not quite what they said — Escape already closed the dialog through the window handler. What was missing was everything else a dialog owes a keyboard: it announced itself as nothing, never took focus, never gave it back, and let Tab walk out into a page the user could no longer see. The backdrop click becomes a button that fills the backdrop and sits behind the dialog. That is what it always was — a mouse affordance — and saying so in markup removes the warning honestly instead of suppressing it. It stays out of the tab order and hidden from screen readers, because Escape and the × button are already the keyboard ways out and a third unlabelled one helps nobody. Being a sibling rather than a parent also means the dialog no longer has to stop propagation to avoid closing itself. The dialog itself gains role="dialog", aria-modal, and a label pointing at its own heading; it takes focus when it opens, hands focus back to whatever opened it when it closes, and cycles Tab within itself. Restoring focus is best effort: deleting a widget removes the pen icon that opened the dialog. While here, the tablist was half-wired — the panel it controls carried no role. One panel serves all three tabs, so the selected tab points at it and the panel names the tab currently showing, which keeps the pair valid as the content swaps. Verified: `npm run build` is now warning-free (it printed two a11y warnings before), and the GUI builds and launches. The keyboard behaviour itself I could not drive from here — this desktop has no input-injection tool — so Tab/Escape/focus-return needs a human at the window. Co-authored-by: YCistak <YCistak@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 11, 2026
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.
C7. Her frontend derlemesi aynı iki uyarıyı basıyordu:
.backdropve.modaldiv'lerinde klavye karşılığı olmayanon:click.Uyarılar gerçek bir şeyi gösteriyordu ama tam olarak dediklerini değil — Escape zaten pencere seviyesindeki handler ile kapatıyordu. Eksik olan, bir diyaloğun klavyeye borçlu olduğu diğer her şeydi: kendini hiçbir şey olarak duyuruyordu, odağı hiç almıyordu, geri de vermiyordu, ve Tab kullanıcının artık göremediği sayfaya çıkıp gidiyordu.
Ne değişti
<button>oldu — diyaloğun arkasında duran, arka planı dolduran bir buton. Zaten olduğu şey buydu (fare kolaylığı); markup'ta böyle demek uyarıyı bastırmak yerine dürüstçe kaldırıyor. Tab sırasında değil, ekran okuyucudan gizli: Escape ve × zaten klavye çıkışları, etiketsiz bir üçüncüsü kimseye yaramaz. Ayrıca artık kardeş olduğu için diyaloğun kendini kapatmamak adınastopPropagationyapmasına gerek kalmadı.role="dialog",aria-modal, kendi başlığını gösterenaria-labelledby. Açılınca odağı alıyor, kapanınca odağı onu açan şeye geri veriyor, Tab kendi içinde dönüyor. Odak iadesi en iyi çaba: widget'ı silmek onu açan kalem ikonunu da kaldırıyor.roleyoktu. Tek panel üç sekmeye hizmet ettiği için seçili sekme panele işaret ediyor, panel de o an görünen sekmeyi adlandırıyor; içerik değişince eşleşme bozulmuyor.Doğrulama
npm run buildartık uyarısız (öncesinde iki a11y uyarısı basıyordu). GUI derleniyor ve açılıyor — ekran görüntüsüyle doğruladım.Kendim doğrulayamadığım kısım: klavye davranışının kendisi. Bu masaüstünde girdi enjeksiyon aracı yok (
wtype/ydotoolkurulu değil), yani Tab/Escape/odak-iadesi pencerenin başında bir insanı bekliyor.🤖 Generated with Claude Code