Bug: Row decorations and git status aren't part of a row's accessible name
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
Research direction
The issue identifies FileTreeView.tsx and renderStyledRow as the entry point. Read how getFileTreeRowAriaLabel, customDecoration, and gitDecoration supply the row label, then check the tree item accessibility tests. Done means the accessible name includes decoration and git status titles while preserving the file name.
Written by the indexing model from the issue text.
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have read the contributing guidelines
Describe the issue
I'm using @pierre/trees for a file tree in a browser extension I'm building, and I use renderRowDecoration to show stuff like a comment count and +12 -3 line counts on each row. I noticed none of it reaches a screen reader.
Each row's aria-label is just the file name from getFileTreeRowAriaLabel(row), and since aria-label replaces the row's contents as its accessible name, the decoration and its title never get announced. Same with the built-in git status: a modified file shows M but its name is just index.ts, and the "Contains git status items" dot on folders gets lost too.
I'd expect the decoration and git status titles to be part of the row's name, something like README.md, 12 added, 3 removed.
Steps to reproduce:
- Render a tree with gitStatus and a
renderRowDecorationthat returns a title (snippet below) - Check the
aria-labelon each[role="treeitem"]row - It's only the file name
Reproduction
My project is private at the moment, so here's a minimal snippet instead:
import { FileTree } from '@pierre/trees';
const mount = document.getElementById('mount')!;
mount.style.height = '200px';
new FileTree({
paths: ['README.md', 'src/index.ts'],
initialExpansion: 'open',
gitStatus: [{ path: 'src/index.ts', status: 'modified' }],
renderRowDecoration: ({ item }) =>
item.path === 'README.md' ? { text: '+12 -3', title: '12 added, 3 removed' } : null,
}).render({ containerWrapper: mount });
The rows come out labeled src, index.ts, and README.md, even though they visibly show M and +12 -3.
I'm patching the decoration half of this locally for now. Something like this in renderStyledRow (FileTreeView.tsx) would cover both:
ariaLabel: [getFileTreeRowAriaLabel(row), customDecoration?.title, gitDecoration?.title]
.filter(Boolean)
.join(', '),
What browser(s) are you seeing the problem on?
No response
What version of @pierre/diffs are you using?
@pierre/[email protected] (not using @pierre/diffs)
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 226
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 34
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pierrecomputer/pierre
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pierrecomputer/pierre#1150 · 3 comments ·
Maintainers usually reply within 1 day
-
Bug: Dragging a selection past the edge of an editable CodeView collapses it, then stops it growingOpenbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pierrecomputer/pierre#1189 ·
Maintainers usually reply within 1 day
-
Bug: WebKit crashes when drag-selecting text that auto-scrolls a diff (gutter-utility re-parented mid-drag)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
pierrecomputer/pierre#1184 · 4 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 63/100
pierrecomputer/pierre#1172 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 54/100
pierrecomputer/pierre#1171 · 2 comments ·
Maintainers usually reply within 1 day
All issues in pierrecomputer/pierre
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
status:approved type:bug
Difficulty 1/5 Under an hour Newbie friendliness 70/100
egdev6/quorb#109 · 1 comment ·
Maintainers usually reply within 1 day
-
stage:4
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ilan-pinto/roaring-lions#598 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Frontmatter next to `src:` is applied to every imported slide, not only the first (undocumented)Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day