Skip to content

[Improvement]: A11y — associate labels with inputs across Settings, Agent, Git, Marketplace, and AI chat#175

Open
matiaspalmac wants to merge 2 commits intoTrixtyAI:mainfrom
matiaspalmac:improvements/a11y-input-labels
Open

[Improvement]: A11y — associate labels with inputs across Settings, Agent, Git, Marketplace, and AI chat#175
matiaspalmac wants to merge 2 commits intoTrixtyAI:mainfrom
matiaspalmac:improvements/a11y-input-labels

Conversation

@matiaspalmac
Copy link
Copy Markdown
Contributor

Description

Screen readers and voice-control users had no reliable way to target most inputs in the app. Two recurring problems:

  1. Visible <label> elements rendered next to their inputs but were never wired with htmlFor / id, so AT could not associate them.
  2. Inputs that rely on placeholders as pseudo-labels (search, filter, commit message, branch name, stash message, new-file-name) had no accessible name at all — placeholders don't count as the accessible name in WAI-ARIA.

This PR makes every interactive input announce a real name and, where context helps, a description.

Related Issue

Closes #107

Change

  • SettingsView — matching id/htmlFor on font family, font size, line height, minimap toggle, exclude-pattern, and display-language. Wrapped the decorative minimap switch visual with aria-hidden="true" so AT only sees the real checkbox.
  • AgentSettings:
    • aria-labelledby / aria-describedby on the AGENTS.md / DESIGN.md / USER.md / MEMORY.md textareas pointing to the heading and description already rendered above each.
    • id / htmlFor on the keep-alive range input, plus aria-valuetext so AT announces e.g. "5 min" rather than the raw number, and aria-describedby pointing at the help text.
  • GitExplorerComponentaria-label on the global search input, branch filter, new-branch, commit-message textarea, stash message, and the inline new-file / new-folder inputs. Each now has a stable accessible name independent of its placeholder.
  • MarketplaceViewaria-label on the search input and the installed/all filter select.
  • AiChatComponentaria-label on the chat composer textarea so it announces as e.g. "Ask about your code..." instead of "edit text".

Trade-offs

  • aria-describedby / aria-invalid for per-input validation errors is not added here because the codebase currently has no inline field-level error UI to expose — errors surface as toasts or dialogs, already covered by the aria-live regions in [Improvement]: A11y — aria-live regions for chat streaming, updater and git feedback #172. If/when inline validation is added, the association points (aria-describedby) are ready.
  • Re-used existing i18n keys instead of introducing new "...-aria-label" strings — each aria-label is sourced from a label/title/action key that already describes the input's purpose.

Verification

  • pnpm --filter @trixty/desktop lint passes clean.
  • npx tsc --noEmit passes clean.
  • Sanity-checked with the accessibility inspector: every touched input now reports a role + name.

Checklist

  • I have followed the project's coding guidelines.
  • Documentation has been updated (if applicable).
  • My changes generate no new warnings or errors.
  • This change is a minor improvement (for major new features use the Feature template).

…ent, Git, Marketplace, and AI chat

Screen readers and voice-control users had no reliable way to target
most inputs in the app: visible `<label>` elements were siblings of
their inputs but never connected via `htmlFor`/`id`, and inputs that
rely on placeholders as pseudo-labels (search, filter, commit
message, branch name, stash message) had no accessible name at all.

Changes:
- `SettingsView`: added matching `id`/`htmlFor` to font family, font
  size, line height, minimap, exclude-pattern, and display-language
  inputs. Wrapped the minimap switch visual with `aria-hidden` so AT
  only sees the real control.
- `AgentSettings`:
  - `aria-labelledby` / `aria-describedby` on the AGENTS.md / DESIGN.md
    / USER.md / MEMORY.md textareas pointing to the heading and
    description already rendered above each.
  - `id` / `htmlFor` on the keep-alive range input, plus
    `aria-valuetext` so AT announces "5 min" not just the raw number,
    and `aria-describedby` pointing at the help text.
- `GitExplorerComponent`: `aria-label` on the global search, branch
  filter, new-branch, commit textarea, stash message, and inline
  new-file / new-folder inputs, so each has a name independent of
  its placeholder.
- `MarketplaceView`: `aria-label` on the search input and the
  installed/all filter select.
- `AiChatComponent`: `aria-label` on the chat composer textarea so
  it announces as "Ask about your code..." instead of "edit text".

No new i18n strings — reused existing keys.

Closes TrixtyAI#107
Copilot AI review requested due to automatic review settings April 21, 2026 04:50
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed labels Apr 21, 2026
@github-actions
Copy link
Copy Markdown

Thanks for the contribution! I'll review it as soon as possible. If you have still changes, please mark this PR as draft and all reviews will be cancelled. Tests reviews will be re-run only when the PR is marked as ready for review.

Copy link
Copy Markdown

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

Improves accessibility across the desktop UI by ensuring inputs have reliable accessible names, primarily by wiring visible labels via htmlFor/id and adding aria-label/aria-labelledby where placeholders or surrounding headings were previously the only context.

Changes:

  • Add id/htmlFor associations for labeled form controls in Settings and Agent configuration.
  • Add ARIA labeling for previously placeholder-only inputs in Git Explorer, Marketplace, and AI Chat.
  • Add aria-hidden on decorative UI elements so assistive tech focuses on the actual form controls.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
apps/desktop/src/components/SettingsView.tsx Adds id/htmlFor on settings inputs and improves naming for the exclude-pattern field.
apps/desktop/src/components/MarketplaceView.tsx Adds aria-label to marketplace search and filter controls.
apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Adds aria-label to several Git inputs (search, branch filter/create, commit message, stash message, new file/folder).
apps/desktop/src/addons/builtin.ai-assistant/AiChatComponent.tsx Adds aria-label to the chat composer textarea.
apps/desktop/src/addons/builtin.agent-support/AgentSettings.tsx Adds aria-labelledby/aria-describedby for agent textareas and labels/config for the keep-alive slider.

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

Comment thread apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Outdated
Comment thread apps/desktop/src/components/SettingsView.tsx Outdated
Comment thread apps/desktop/src/components/MarketplaceView.tsx Outdated
Comment thread apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Outdated
Comment thread apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Outdated
Copilot review on TrixtyAI#175 flagged five aria-labels that were re-using
action or section keys ("Commit", "Create branch", "Stash changes",
"Files: Exclude", "Marketplace") instead of naming the field itself,
so AT would announce something like "Commit, edit" where a user
reasonably expects "Commit message, edit".

Added five dedicated i18n keys (EN + ES) and re-wired the labels:

- Commit textarea          → git.commit_message_aria_label
- New branch input         → git.new_branch_aria_label
- Stash message input      → git.stash_message_aria_label
- Exclude pattern input    → settings.general.exclude_aria_label
- Marketplace filter select→ marketplace.filter_aria_label
@matiaspalmac
Copy link
Copy Markdown
Contributor Author

Addressed Copilot review on the five aria-labels that were re-using action/section keys. Added five dedicated i18n keys (EN + ES) and rewired each control so AT now announces the field, not the action/section:

Control Old label New label
Commit textarea git.commit_button → Commit git.commit_message_aria_label
New branch input git.action.create_branch git.new_branch_aria_label
Stash message input git.action.stash git.stash_message_aria_label
Exclude pattern input settings.general.exclude_title settings.general.exclude_aria_label
Marketplace filter marketplace.title marketplace.filter_aria_label

lint + tsc clean. (41bb7bc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement]: A11y — associate labels with inputs and expose errors via aria-describedby/aria-invalid

2 participants