Skip to content

Improve dialog accessibility & input metadata#159

Merged
rlauuzo merged 4 commits into
masterfrom
dialog-accessibility
May 25, 2026
Merged

Improve dialog accessibility & input metadata#159
rlauuzo merged 4 commits into
masterfrom
dialog-accessibility

Conversation

@rlauuzo
Copy link
Copy Markdown
Member

@rlauuzo rlauuzo commented May 25, 2026

Add accessible dialog semantics and stable form field metadata, minor UI and theme tweaks, and a test. Highlights:

  • Use DialogTitle/DialogDescription for connection and settings dialogs and expose aria-describedby for descriptions.
  • Add name, autocomplete and spellCheck attributes to auth inputs; update show password button (focus/disabled styles) and keyboard focus rings for auth method buttons.
  • Add image width/height and layout fixes (min-w-0) for LibraryCard.
  • Set color-scheme on the root element and add theme-color meta tags for light/dark modes.
  • Add a Vitest integration test that verifies the named dialog and credential field metadata.
  • Package.json: add a "doctor" script and react-doctor dependency; small formatting fix. These changes improve accessibility, keyboard navigation, and visual consistency.

Summary by Sourcery

Improve accessibility and metadata for dialogs, authentication inputs, and theming across the app.

New Features:

  • Expose accessible dialog titles and descriptions for the connection wizard and settings dialog.
  • Add stable names, autocomplete hints, and spellcheck settings for authentication and server address inputs.
  • Define explicit image dimensions for library cards to stabilize layout.

Enhancements:

  • Improve keyboard focus styles for authentication method buttons and the show-password toggle.
  • Add theme-color meta tags and synchronize the document color-scheme with the active theme.

Build:

  • Add a react-doctor dependency and doctor npm script for React diagnostics.

Tests:

  • Add a Vitest integration test to verify dialog accessibility and credential field metadata.

Add accessible dialog semantics and stable form field metadata, minor UI and theme tweaks, and a test. Highlights:
- Use DialogTitle/DialogDescription for connection and settings dialogs and expose aria-describedby for descriptions.
- Add name, autocomplete and spellCheck attributes to auth inputs; update show password button (focus/disabled styles) and keyboard focus rings for auth method buttons.
- Add image width/height and layout fixes (min-w-0) for LibraryCard.
- Set color-scheme on the root element and add theme-color meta tags for light/dark modes.
- Add a Vitest integration test that verifies the named dialog and credential field metadata.
- Package.json: add a "doctor" script and react-doctor dependency; small formatting fix.
These changes improve accessibility, keyboard navigation, and visual consistency.
Copilot AI review requested due to automatic review settings May 25, 2026 10:30
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 25, 2026

Reviewer's Guide

Adds accessible dialog semantics and stable auth field metadata, enhances keyboard focus styling and image/layout behavior, wires theme color-scheme to the document root, and introduces a Vitest integration test plus a small tooling addition for react-doctor.

Flow diagram for theme application and color scheme

flowchart LR
  ThemeSelection[Select theme auto light dark]
  applyTheme[applyTheme theme]
  RootClass[documentElement.classList]
  RootStyle[documentElement.style.colorScheme]

  ThemeSelection --> applyTheme
  applyTheme --> RootClass
  applyTheme --> RootStyle
Loading

File-Level Changes

Change Details Files
Improve dialog semantics and accessibility for settings and connection wizard dialogs.
  • Wrap settings dialog header text in DialogTitle/DialogDescription with an aria-describedby hook-up for the description.
  • Add DialogCloseButton to settings dialog and adjust header layout padding for room.
  • Provide a visually hidden DialogTitle/DialogDescription in the connection wizard dialog to expose a named dialog and description to assistive tech.
src/components/settings/SettingsDialog.tsx
src/components/connection/ConnectionWizardContent.tsx
Add stable, accessible metadata and better focus behavior for authentication controls.
  • Assign explicit name attributes and appropriate autocomplete/spellCheck settings to server address, API key, username, and password inputs.
  • Enhance keyboard focus rings on auth method toggle buttons using focus-visible styles.
  • Restyle the show-password toggle button to be a proper focusable control with hover/focus states and disable it while loading.
src/__tests__/connection-wizard.form.test.tsx
src/components/connection/steps/AuthStep.tsx
Tighten LibraryCard image sizing and text layout for better rendering and truncation.
  • Add explicit width/height attributes to the library image for more stable layout and performance hints.
  • Allow the library title text container to shrink correctly by adding min-w-0 so truncation works in constrained layouts.
src/components/filter/LibraryCard.tsx
Align browser and app theme metadata with the runtime theme selection.
  • Set theme-color meta tags for light and dark schemes in index.html.
  • Update theme application to also set root.style.colorScheme to the resolved theme for better UA rendering of form controls and scrollbars.
index.html
src/stores/app-store.ts
Extend tooling configuration with a doctor script and dependency and add a focused integration test for the new accessibility contract.
  • Add a Vitest integration test that asserts the dialog name/description wiring and auth field metadata.
  • Introduce a doctor npm script wired to react-doctor and add react-doctor as a devDependency, plus minor JSON formatting cleanup.
src/__tests__/connection-wizard.form.test.tsx
package.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

React Doctor

Score: 95 / 100

react-doctor v0.2.6

✔ Select projects to scan › segment-editor-react
Scanning changes: dialog-accessibility → master

Scanning /home/runner/work/segment-editor/segment-editor...


No issues found!

  ┌─────┐  100 / 100 Great
  │ ◠ ◠ │  ██████████████████████████████████████████████████
  │  ▽  │  React Doctor (www.react.doctor)
  └─────┘

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/components/connection/steps/AuthStep.tsx" line_range="196-201" />
<code_context>
                   <div className="relative">
                     <Input
                       id="password"
+                      name="password"
                       type={showPassword ? 'text' : 'password'}
                       placeholder="Enter your password…"
                       value={String(field.state.value)}
</code_context>
<issue_to_address>
**suggestion:** Add autocomplete and spellcheck hints for the password input

For this password field, consider adding `autoComplete="current-password"` (or a more specific value for this flow) and `spellCheck={false}` so the browser doesn’t spellcheck or autocorrect the input and can handle password management properly.

```suggestion
                    <Input
                      id="password"
                      name="password"
                      type={showPassword ? 'text' : 'password'}
                      placeholder="Enter your password…"
                      autoComplete="current-password"
                      spellCheck={false}
                      value={String(field.state.value)}
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/components/connection/steps/AuthStep.tsx
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves UI accessibility and form metadata stability across dialogs and authentication inputs, while also polishing visual/layout behavior and adding a regression test to lock in the new accessible semantics.

Changes:

  • Add DialogTitle/DialogDescription semantics (and wiring via aria-describedby) for the connection wizard and settings dialogs.
  • Stabilize auth/server address input metadata (name, autoComplete, spellCheck) and improve keyboard focus styling for auth controls.
  • Reduce layout shift and truncation issues (explicit img dimensions; min-w-0), and add theme-related metadata (color-scheme, theme-color meta tags) plus a new Vitest integration test.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/stores/app-store.ts Sets color-scheme on the root element to match resolved theme.
src/components/settings/SettingsDialog.tsx Adds accessible dialog title/description and a close button; minor header layout tweaks.
src/components/filter/LibraryCard.tsx Adds explicit image dimensions and fixes truncation with min-w-0.
src/components/connection/steps/AuthStep.tsx Adds stable input metadata and improves focus/disabled styling for auth controls.
src/components/connection/ConnectionWizardContent.tsx Adds accessible dialog title/description for the wizard (screen-reader only).
src/tests/connection-wizard.form.test.tsx Adds a test verifying dialog naming and credential field metadata.
package.json Adds doctor script and react-doctor dev dependency.
index.html Adds theme-color meta tags for light/dark modes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment on lines +72 to +77
@@ -72,6 +73,7 @@
"vite": "^8.0.14",
"vite-plugin-pwa": "^1.3.0",
"vitest": "^4.1.7",
"workbox-window": "^7.4.1"
"workbox-window": "^7.4.1",
"react-doctor": "^0.2.6"
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 25, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

All previously raised issues have been resolved. The latest commit (1cfbfa4) removes the redundant aria-describedby prop from both DialogContent components (ConnectionWizardContent.tsx and SettingsDialog.tsx). The DialogDescription elements with the matching IDs remain in place, so accessibility is correctly handled by base-ui's React context without the manual prop.

Resolved Issues
File Issue Status
src/components/connection/steps/AuthStep.tsx spellCheck={false} missing on Password input ✅ Fixed in commit 9752616
pnpm-lock.yaml Lock file not updated after adding react-doctor ✅ Fixed in commit b11fb1b
src/components/connection/ConnectionWizardContent.tsx Redundant aria-describedby on DialogContent ✅ Fixed in commit 1cfbfa4
src/components/settings/SettingsDialog.tsx Redundant aria-describedby on DialogContent ✅ Fixed in commit 1cfbfa4
Files Reviewed (incremental — 2 files since b11fb1b)
  • src/components/connection/ConnectionWizardContent.tsx — redundant aria-describedby removed ✅
  • src/components/settings/SettingsDialog.tsx — redundant aria-describedby removed ✅

Reviewed by claude-4.6-sonnet-20260217 · 126,098 tokens

@rlauuzo rlauuzo merged commit 161de24 into master May 25, 2026
6 checks passed
@rlauuzo rlauuzo deleted the dialog-accessibility branch May 25, 2026 10:41
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.

2 participants