Repository navigation
fix(dashboard): show a Windows gateway path's file name at every basename site - #17512
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that [DESIGN-REVIEWED] f854b75 Description read[DESCRIPTION-READ] 8ee27c5d858ff7c88b9b50476436ce9cca929a41560c811b9f7cb70c33a3e3ef 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check before merge: knowledge sources and artifacts created from a Windows file will now be named by the file name. Ones already created keep their full-path names. Not justified as shipped
What this change shipsInventory (7 items) — 6 justifiedIntent: Windows users want to see a file's name, not its whole
[FIRST-PRINCIPLES-REVIEWED] f854b75 Description read[DESCRIPTION-READ] 0f013e328834e7e47f936289fbe8a5b0faa28ddda4d2e049cee2398b731b8e52 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check the other Windows surfaces before merge: composer chips, side-panel tab titles and Files/Folder headers aren't in the screenshots, which show only the diff chip. [UX-REVIEWED] f854b75 Description read[DESCRIPTION-READ] 8c3364e1f97a8be59ccc9e6af6cc132be08aa1c2f704d252557d986e5f447712 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 |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
4900ebe to
9199dbe
Compare
|
Review dispositions for head
Tests run on the rebased head, by path: Note: the PR description still reads as written for |
9199dbe to
f854b75
Compare
|
Review dispositions for head
Not run locally: CI's Windows lanes. Run locally on |
… 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. Image chips, which showed no text at all, gain a visible truncated caption under the thumbnail. One map is computed over 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.
… 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.
… labels (#13829) (#17403) * fix(dashboard): disambiguate same-basename composer tiles by widening labels (#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 #17512 Windows-basename invariants. * evidence: screenshots for #13829 under temp-screenshots/ 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. --------- Co-authored-by: kirocrew-agent <agent@kirocrew.local>
Problem / Motivation
Goal: On a Windows gateway, every dashboard surface that shows a file's name shows
report.md, not the wholeC:\Users\…\report.mdpath.The sites listed on #14581 derived a file name with a
/-only split (.split('/').pop(),lastIndexOf('/')). A Windows gateway reports native paths, so on Windows each of these surfaces showed the entire path where a file name belongs: the prose diff chip and diff header, composer attachment chips, the tool-call file chip, side-panel tab titles, the Files/Folder panel headers, the image viewer's alt text, the file-explorer app's names, and the name MarkdownPanel sends when adding a file to knowledge or artifacts.Why it matters
Windows users see unreadable, truncated chips and tab titles (
C:\Users\dev\repo\src\s…) on every file-related surface, and artifacts/knowledge sources created from a file get the full path as their name.Not a goal
website/src/apps/mochi/panel/composerDrop.ts): open PR fix(mochi): label a dropped attachment by name, not by its whole path #10952 fixes it; this PR does not touch that file. Once both land, fix(mochi): label a dropped attachment by name, not by its whole path #10952 can switch to the shared helper./-only splits that are not gateway file paths, or are outside Windows gateway paths: shared separator-aware basename helper for the remaining POSIX-only sites #14581's list (S3 keys inaws-control/DrivePage.tsx, skill/app ids, knowledge/md-notebook/SidePanel/fileIcons/toolLabel sites,fileReadUrl.tswhich feat: download files from transcript diffs and path chips #16831 already changes). Listed below with per-site verdicts..split('/').pop()calls remain, most on non-path strings, so a blanket rule would need a waiver sweep first.WINDOWS_ABS_PATH_RE(urlTransform.ts) is unchanged; it stays the security predicate for imagesrc.What changed (motivation → approach → change)
Symptom: a full Windows path where a file name belongs. Cause: each site split on
/only. Splitting on\everywhere would be wrong too, because a backslash is a legal POSIX file-name character (/tmp/we\ird.mdis one name).New dependency-free module
website/src/utils/pathBasename.ts(no react-markdown import), using the rulebreadcrumbSegmentsalready uses:\is a separator only when the path itself is Windows-shaped (drive-rootedC:\/C:/, or backslash UNC\\host\).pathBasename(p): text after the last separator. For a non-Windows path it equalsp.split('/').pop().stripTrailingSeparators(p): for a non-Windows path it equalsp.replace(/\/+$/, '').UNC is included because this is display-only and decides nothing about which paths are read. The module comment and
website/docs/frontend-conventions.mdboth say so.Per-site verdicts for #14581's list (re-located on current main):
components/MarkdownPanel.tsx(knowledge name, artifact name ×2, headerfileName)components/FileRenderers.tsxImageVieweraltChatInput.tsx:857/:894 → nowcomponents/chat-input/FilePreviewStrip.tsx(aria-label + chip)pages/chat/ToolCallLine.tsxfile chipbasenamechipView.pathin the same file)components/FoldableDiffBlock.tsxchipcomponents/DiffBlock.tsxprivatebasenamepages/chat/FilesHomePanel.tsxprivatebasenamepages/chat/FolderPanel.tsxprivatebasenameapps/file-explorer/utils.tsbasenamehooks/usePanelTabs.tsprivatebasenamecomponents/FileChangeChips.tsxnormalizeWindowsPath)apps/mochi/panel/composerDrop.tspathReferences.basenameOf,VectorMemoryCard,FolderPanelduallastIndexOf)Backwards compatibility
Compatible: for every non-Windows-shaped path the helpers return exactly what the replaced expressions returned. The test suite pins this with
pathBasename(p) === p.split('/').pop()andstripTrailingSeparators(p) === p.replace(/\/+$/, '')over POSIX inputs that include backslashes.Removes nothing: only display-name derivation changes. No key, export, or record is removed or renamed (
file-explorer/utils.tskeeps exportingbasename).Tests
website/src/test/pathBasename.test.ts(49 cases): Windows backslash, forward-slash drive, mixed separators, UNC (both spellings), trailing separators, POSIX names containing\, relative paths, and the POSIX-equivalence properties above.website/src/test/windowsBasenameSites.test.tsx(29 cases): mounts the real FoldableDiffBlock chip, FilePreviewStrip chip and image label, ImageViewer alt, usePanelTabs tab titles and file-explorerbasenamewith Windows, UNC and POSIX paths. It also includes a source scan pinning each listed file against the/-only shapes returning.backslashIsSeparatoralwaysfalsereddens 22 cases, including every Windows site case. Making it alwaystruereddens 19, including every POSIX-backslash site case. Both were restored and verified.Local gates run:
tsc --noEmit,eslinton the touched files,i18n:check,scripts/docs-lint.sh,check_brand_name.py,check_comment_history.py.Manual verification
This host is Linux, so there was no live Windows gateway. Instead, the real SPA (Vite dev server,
/api/**and the websocket stubbed) rendered an assistant message with two prose diff fences: one whose headers carry a native Windows path (as a Windows gateway's difflib emits them) and one POSIX control. This ran on origin/main and on this branch. CI's Windows lanes are the live proof.Screenshots / video
Before (origin/main): the Windows fence's chip and diff header show the whole
C:\Users\dev\repo\src\kiro_crew\state.py.After (this branch): both show
state.py. The POSIX control is identical in both.Related Issues
Closes #14581
Related: #10952 (Mochi drop site), #8012 (origin of this follow-up).
Pattern harvest
Rule candidate: lint
Pattern: deriving a displayed file name from a gateway path with
.split('/').pop()/lastIndexOf('/')instead ofpathBasename. A lint rule can be added once the remaining non-path uses are waived or migrated.Checklist
Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.