Repository navigation
fix(dashboard): name a Windows project by its folder in the composer and Spec Builder picker - #28663
Conversation
45cb01e to
eb16f97
Compare
…and Spec Builder picker Five project-name sites split on '/' only, so a Windows gateway's native path (C:\Users\u\KiroCrew) showed whole. They now go through pathBasename(stripTrailingSeparators(p)) || p; POSIX labels are unchanged. Closes #27794
eb16f97 to
65e8661
Compare
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: five label sites now use the existing separator-aware helper, POSIX output is unchanged, and no new surface is added. [DESIGN-REVIEWED] 65e8661 Description read[DESCRIPTION-READ] 0ecfe615137833d606a26199e818a7e28c6b99cfb15a070d409b4ccba63ae1fc 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 Nothing blocks. The fix reuses the existing What this change shipsInventory (6 items) — 6 justifiedIntent: on a Windows gateway, a user can see which folder a session or spec works in, instead of a truncated drive prefix. This is a FIX (#27794).
[FIRST-PRINCIPLES-REVIEWED] 65e8661 Description read[DESCRIPTION-READ] 597b9bf25c5f3edbb6e5e8eff2908e58459821f437b128f94a4dbc4598629664 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. No control is added or restyled: on Windows the existing chips now show the folder name, which is what POSIX users already see. The blind read was not performed because no screenshot was attached. Notes
[UX-REVIEWED] 65e8661 Description read[DESCRIPTION-READ] d245d81a8e0530d44163a5327b422cb5b9fff2c638cedd3fa07ae039e5212d14 That sha256 names everything this verdict read: the PR description, plus the 3 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 |
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: |
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: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: composer and Spec Builder project names derive the folder through pathBasename, so Windows paths show the folder name.
Problem / Motivation
Goal: On a Windows gateway, the composer and the Spec Builder project picker name a project by its folder instead of showing the whole path.
Five sites take the project name with
p.split('/').filter(Boolean).pop() || p. A Windows path such asC:\Users\u\workplace\KiroCrewholds no/, so each site shows the whole path where the folder name belongs: the composer project chip, the read-only peer project chip, the terminal-review hint, the mid-turn "project switch applies next turn" note, and the Spec Builder picker's selection and recent projects.Why it matters
Both composer chips cap the label at 160 px, so a Windows user sees only the drive and home-folder prefix, which is the same for every project under the home folder. The chip exists to say which folder a session works in, and on Windows it cannot.
Not a goal
/-only sites tracked in Dashboard: app file-menu extension filter and app-SDK tool-pill chip split Windows gateway paths on / only, two sites #17512 did not list #27792 (app file-menu filter, app-SDK tool pill) are unchanged.WorkspacePicker.tsx:139is unchanged: nothing on main importsWorkspacePickeroutside its test.What changed (motivation → approach → change)
Symptom: the whole Windows path shows where the folder name belongs. Root cause: a
/-only split. Change: each site now usespathBasename(stripTrailingSeparators(p)) || pfromwebsite/src/utils/pathBasename.ts, the helpers #17512 added and #27992 reused. They treat\as a separator only for a drive-rooted or UNC path, so a POSIX name that contains\stays one name.website/src/components/ChatInput.tsx:midTurnProjectNote, the terminal hint, the read-only peer chip and the project chip.website/src/apps/spec-builder/components/ProjectPicker.tsx: thebasehelper used by the selected field and each recent project.Backwards compatibility
Compatible: for every POSIX path
pathBasename(stripTrailingSeparators(p))equalsp.split('/').filter(Boolean).pop(), and the|| pfallback keeps/as/; only drive-rooted and UNC paths now show their folder name.Removes nothing: the change only alters how a label string is derived; no path, record, key or function is taken away.
Tests
website/src/test/windowsProjectNameSites.test.tsx(new) renders the real components forC:\…,C:\…\,C:/…, a UNC path, POSIX paths with and without a trailing/, a POSIX name with\, and/. It pins the project chip text and its full-path tooltip, the read-only peer chip, the terminal hint plus the review dialog's full path, the mid-turn note, and the Spec Builder selection and recent row.website/src/test/windowsBasenameSites.test.tsx: the source scan now listsChatInput.tsxandProjectPicker.tsx.Proof: not provable -- frontend test (prove.py runs Python only). Verified by hand: restoring both production files from main turns 22 cases red (every Windows drive-rooted and UNC case at all five sites, plus both source scans), while the POSIX and
C:/cases stay green.Local run: the
ChatInput*,windows*and spec-builder suites pass except 3 cases inChatInput.approval.test.tsx, which fail identically on an untouchedorigin/mainworktree on this host.Manual verification
N/A — unit coverage sufficient: each site is a pure string expression, and the tests render the real components with Windows paths. Not run on a real Windows host.
Screenshots / video
Why no screenshot: on a POSIX host the labels render exactly as before, and the only change is which part of a Windows path the existing labels show, with no new or changed panel, layout or component.
Related Issues
Closes #27794
Sibling sweep
Swept:
git grep -nE "split\('/'\)\.filter\(Boolean\)\.pop\(\)" -- website/srcwebsite/src/components/ChatInput.tsx-- changed here (lines 535, 1026, 1915, 1954)website/src/apps/spec-builder/components/ProjectPicker.tsx-- changed herewebsite/src/components/WorkspacePicker.tsx:139-- not affected -- no file on main imports WorkspacePicker outside its own testwebsite/src/apps/fileMenuContributions.tsx-- tracked in Dashboard: app file-menu extension filter and app-SDK tool-pill chip split Windows gateway paths on / only, two sites #17512 did not list #27792website/src/app-sdk/messageRenderers.tsx-- tracked in Dashboard: app file-menu extension filter and app-SDK tool-pill chip split Windows gateway paths on / only, two sites #17512 did not list #27792Pattern harvest
Rule candidate: review-prompt
Pattern: a gateway project or file path shown to the user taken with
.split('/').filter(Boolean).pop()instead ofpathBasename(stripTrailingSeparators(p)), which leaves a WindowsC:\…path whole.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.