Repository navigation
fix(dashboard): disambiguate same-basename composer tiles by widening labels (#13829) - #17403
Conversation
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 80e3fc5 Description read[DESCRIPTION-READ] 2f47064aa6f1177f969c1afbb7bd1c41e330520e87adf0cb8ac39da8e6280256 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The 64px image caption truncates at its end, so long folder names can cut off the part that tells two tiles apart and the two captions look identical again. Watch
[UX-REVIEWED] 80e3fc5 Description read[DESCRIPTION-READ] b737fd6028b22a17cea14947f31c44d02fbe1e4fcf21ee1727ef5beadbeea140 That sha256 names everything this verdict read: the PR description, plus the 5 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check one claim before merge: images and non-images can never widen against each other. What this change shipsInventory (5 items) — 5 justifiedIntent: let a user tell apart two staged composer files that share a basename, using the visible label alone. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 80e3fc5 Description read[DESCRIPTION-READ] df105dd80acf7d54afd7075e1ee669c3e70fb0cf75ace3f132244ef967290a9a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
ea0c438 to
f955a20
Compare
f955a20 to
0e70d38
Compare
0e70d38 to
dd8b96b
Compare
Addressed in
|
… labels (kirodotdev#13829) Composer preview tiles rendered only the basename, so two staged files named `report.txt` from different directories were indistinguishable on screen. The full path lived only in `title` (pointer hover) and the group `aria-label` (screen reader), serving neither a sighted keyboard-only user nor a pointer user glancing at the row. Render each tile's visible label with `buildFileLabels` -- the shared rule the folder chips in this same component already use -- which is basename-first and widens by parent segments only until unique among the staged tiles. Non-image file chips show the widened label. Image chips, which showed no text at all, gain a visible truncated caption under the thumbnail ONLY when their name collides with another staged file, so a lone pasted screenshot stays caption-free. One label map spans all files so images and non-images widen against each other. The full path stays in `title`/`aria-label`. Windows-aware: `\` is normalized to `/` for the label only when it is actually a separator (drive-rooted / UNC), reusing `backslashIsSeparator`, so a POSIX file name containing a literal `\` is not split -- preserving the kirodotdev#17512 Windows-basename invariants.
Dark + light renders of two same-basename images and two same-basename files showing distinct widened labels at rest. Committed under temp-screenshots/ (the path the AI-review evidence gate reads at the head SHA); the one-off capture harness is kept out of the product tree.
dd8b96b to
80e3fc5
Compare
Round 2 — addressed in
|
buluoray
left a comment
There was a problem hiding this comment.
**Approve.** Composer tiles now show a *visible* label widened past the basename only when needed, using the same `buildFileLabels` rule the folder chips already use. So two staged `report.txt` files read `2024/report.txt` / `2023/report.txt` for every user, not only pointer-hover or screen-reader users. The full path stays in `title`/`aria-label`.
### Verified (head 80e3fc5154, from source)
- `FilePreviewStrip.tsx:93-96`: one label map over all staged files. `normFile` converts `\` to `/` only when `backslashIsSeparator` (drive/UNC), so a POSIX `we\ird.md` is not split. That's the same predicate `pathBasename` uses (`pathBasename.ts:21-32`).
- `fileTokens.ts:31-47`: `buildFileLabels` widens one parent at a time until unique, and `|| p` guarantees a non-empty label. Absolute and relative paths with the same tail resolve to distinct labels at max depth.
- `:104` `isWidened` stays false for a sole Windows path (the normalized label equals `pathBasename`), so lone images remain caption-free.
- `:167-169`: `w-16` is on the caption only, not the chip wrapper, so the round-2 fix for resize-pill overflow holds.
- First Principles' cross-category claim holds: `IMG_EXT` keys on the extension, so an image and a non-image can never share a basename.
### Tests
**Not run locally.** The review worktree had no `website/node_modules`. I relied on CI (green, with no failures at this head) and on reading source. Predicted mutations: reverting the chip to `pathBasename` fails `renders distinct visible labels…`, and dropping the `isWidened` gate fails `captions a colliding image tile but not a unique one`. No test covers the `normFile` Windows branch.
### Upgrade impact
Display only. Nothing is persisted, and there are no API or config changes. Rendering changes only when two staged files share a basename. Unique names look exactly as before.
### Non-blocking follow-ups
1. **Caption truncation can hide the part that tells them apart** (UX lane). `truncate` cuts the end of the 64px caption, and the widened label puts the parent first, so `screenshots-2025/a.png` and `screenshots-2026/a.png` both show `screenshots-…`. Consider a middle/start ellipsis or a two-line clamp. This fails closed: the worst case is the old ambiguity, and the full path is still in `title`/`aria-label`.
2. **Evidence screenshots show broken thumbnails.** `temp-screenshots/composer-tile-path/light-distinct-labels.png` renders alt-text spill instead of images, and `docs/shot.p…` already truncates. Please re-capture with images that load.
3. The image preview button's `aria-label` (`open_preview_of`, `:129`) still uses `pathBasename`, so two colliding images announce the same button name. Consider `labelOf(path)`.
4. Add a unit test for a Windows-shaped pair (`C:\a\x.md` / `C:\b\x.md`) to pin the `normFile` branch. This is from source only; I did not run it on Windows.
iamwhatever
left a comment
There was a problem hiding this comment.
Approving (crew-pr-reviewer). A widened visible label shows on an image tile only when its basename collides with another staged file. The full path stays in the title and aria-label. This is a frontend-only change. CI is green and the base is main.
Problem / Motivation
Goal: Make two composer preview tiles that share a basename distinguishable by their visible label, so a sighted user — keyboard-only or not — can tell which staged file is which.
The composer preview tiles (staged attachments, pasted files, folder references)
rendered their visible label as just the basename, carrying the full path only
in
title(pointer hover) and therole="group"aria-label(screen reader).A sighted, keyboard-only user who runs no screen reader is served by neither: a
native
titledoes not open on keyboard focus, and thearia-labelis silentwithout assistive tech. So two staged files named
report.txtfrom differentdirectories were indistinguishable on screen.
(This is the one live finding of #13829 — Gap 1. Gaps 2 and 3 in the issue were
confirmed stale against the reworked composer paste path in the triage comment.)
Why it matters
A user who stages multiple files sharing a basename cannot tell which tile they
are about to remove, preview, or send — they must guess or hover each one. For a
keyboard-only user hover is unavailable, so it is an a11y gap; but the fix helps
every user.
Not a goal
aria-labelalreadycarries the full path for assistive tech; this PR addresses the visible
label.
(the paste path was reworked).
What changed (motivation → approach → change)
The fix is the one this component already uses for folder chips:
buildFileLabels. It renders each tile's visible label basename-first andwidens it by parent segments only until it is unique among the staged tiles
(
report.txt→src/report.txtvsdocs/report.txt).buildFileLabelsmap is computed over all staged files — images andnon-images together — so a pasted
report.txtimage and an attachedreport.txtfile widen against each other too.basename.
gain a visible label caption under the thumbnail only when their name
collides with another staged file (the label was widened past its
basename), so a lone pasted screenshot with a long generated name stays
caption-free and the strip is not a row of near-identical truncated captions.
The caption is clamped to the tile width and truncated; the full path stays in
title/aria-label.sizing (as wide as the wider of tile and resize pill), so a wide de/bn resize
pill does not overflow onto the next chip.
buildFileLabels— unchanged.\→/only when\is actually aseparator (drive-rooted / UNC), reusing
backslashIsSeparatorfrompathBasename, so a POSIX file name containing a literal\(/tmp/we\ird.mdis one name) is not wrongly split. This keeps the invariants of the
neighbouring fix(dashboard): show a Windows gateway path's file name at every basename site #17512 Windows-basename change (its 38 tests still pass).
This supersedes an earlier revision of this PR that added a focus-gated overlay
readout. Three fork AI-review lanes (First Principles, UX, Design) converged on
the same point: the defect is a basename-only label, and the same file already
had
buildFileLabelsone line away for the folder chips. The relabel is thesmaller, honest fix — it disambiguates for every user at rest (not only
keyboard-only, not only on focus) and removes two real overlay bugs the reviews
found (a stale readout after removing a focused tile, and the overlay covering
the textarea for pointer users).
A second review round (Design + UX, on the relabel revision) is also addressed:
the image caption is now shown only on a name collision (no clutter on a lone
paste), the
w-16clamp was removed from the image chip wrapper (it is on thecaption span only, so a wide resize pill no longer overflows the next chip), the
one-off capture harness is kept out of the product tree, and the evidence lives
under
temp-screenshots/(the path the review evidence gate reads).Pattern harvest
renders several labels that can collide (file names, folder names, tab
titles),
buildFileLabels(website/src/utils/fileTokens.ts) is the sharedrule: basename-first, widened by parent segments only until unique. This
component already applied it to folder chips; the file and image chips were
the one tile kind that skipped it. Prefer extending an in-file pattern over a
second, bespoke mechanism (here, a focus overlay).
the same-basename problem only while a tile had focus; the relabel solves it
for pointer, keyboard, and screen-reader users without any gesture, and has no
mount/unmount state to leak.
\is Windows-only as a separator. Any code that splits a UI path onseparators must gate backslash handling on the path being Windows-shaped
(
backslashIsSeparator), because\is a legal POSIX file-name character.Rule candidate: when a component shows a list of labels that can collide
(file/folder names, tab titles), reuse the repo's
buildFileLabelsbasename-first widening rather than inventing a per-view disambiguation
(an overlay, a tooltip, a focus readout) — and prefer a fix that is visible at
rest over one gated on an interaction.
Backwards compatibility
Compatible: no API, prop, or key is changed. The only visible change is that a
tile's label text may now carry one or more parent segments when it would
otherwise collide with a sibling; a unique basename is still shown bare.
Removes nothing: no path, key, function, or capability is taken away.
Tests
New
website/src/test/FilePreviewStrip.pathLabels.test.tsx(5 tests):defect),
title/aria-label.Ran locally (worktree): the new test, the existing preview-strip scroll-edge
test, and the neighbouring #17512
windowsBasenameSites38-test suite(unchanged — the Windows semantics are preserved), plus
tsc -p tsconfig.app.jsonandeslint src/ --max-warnings 0— all green.Per the fleet's local-gate rule the directly-relevant frontend tests are run
locally; CI runs the full cross-surface set.
Screenshot evidence
Two same-basename images (
shot.png) and two same-basename files (report.txt)from different directories, plus a folder chip — each tile already shows a
distinct, widened label at rest (no focus needed), in both themes.
Dark:
Light:
Fixes #13829