Skip to content

fix(ui): make the widget dialog a real dialog - #41

Merged
YCistak merged 1 commit into
masterfrom
fix/settings-modal-a11y
Aug 7, 2026
Merged

YCistak merged 1 commit into
masterfrom
fix/settings-modal-a11y

Conversation

@YCistak

@YCistak YCistak commented Aug 7, 2026

Copy link
Copy Markdown
Owner

C7. Her frontend derlemesi aynı iki uyarıyı basıyordu: .backdrop ve .modal div'lerinde klavye karşılığı olmayan on: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

  • Arka plan tıklaması bir <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ına stopPropagation yapmasına gerek kalmadı.
  • Diyalog: role="dialog", aria-modal, kendi başlığını gösteren aria-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.
  • Bonus: tablist yarım bağlıydı — kontrol ettiği panelde role yoktu. 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 build artı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/ydotool kurulu değil), yani Tab/Escape/odak-iadesi pencerenin başında bir insanı bekliyor.

🤖 Generated with Claude Code

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
YCistak merged commit 82892b7 into master Aug 7, 2026
3 of 6 checks passed
@YCistak
YCistak deleted the fix/settings-modal-a11y branch August 7, 2026 11:03
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>
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