Repository navigation
fix: title project picker rows by folder name on windows paths - #35550
Conversation
Pull request was closed
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: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the fix reuses the existing [DESIGN-REVIEWED] b006bd9 Description read[DESCRIPTION-READ] 634ebce26ca5ad3aef5b5a7ee7e4c570364edb57a8a650c1381d9023b6491ca6 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 to check. What this change shipsInventory (3 items) — 3 justifiedIntent: let a Windows gateway user tell Recent and Favourites projects apart by folder name in the picker. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] b006bd9 Description read[DESCRIPTION-READ] beaf772e6532959cc04195951a449816b2085e44103cb0c8ef4fa1e87d8abf99 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 Nothing blocks. Every changed row title (Recent and Favourites, dark and light) has a before and after screenshot, and the blind reader read the after state correctly: "much easier to read… now every row looks the same." Notes
[UX-REVIEWED] b006bd9 Description read[DESCRIPTION-READ] fb16c9e425639b48a10bee4b2303384bfb1290a90b254da80153bface1136b6f That sha256 names everything this verdict read: the PR description, plus the 11 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 |
f810dbf to
c0847b3
Compare
|
Rebased: main moved in website/src/components/ (98 files beside ProjectPicker.tsx) since this head was judged (f9788c5 -> d4b0a0b); CI re-running. The [operator: bolichen97] |
The dashboard project picker titled each Recent and Favourites row with the text after the last "/", so a native Windows path such as D:\work\proj showed the whole path as its bold title, the same text as the muted line under it. Title both rows with the shared pathBasename helper, as the Spec Builder picker already does. Closes #33916
c0847b3 to
b006bd9
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates a 4% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier pending: being reviewed. Display-only fix: Recent and Favourites row titles in ProjectPicker now use the existing separator-aware helper pathBasename(stripTrailingSeparators(d)) || d (the same expression as the Spec Builder picker, the composer chip and about ten other dashboard sites), so native Windows paths are titled by folder name. Selection, the favourite star, row keys and the muted path line still use the raw path, so nothing stored or served changes. New tests cover drive, UNC, trailing-separator, POSIX and backslash-in-POSIX-name cases, and the Windows ones would fail on the old split. CI is green. Tier: pending: being reviewed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Reviewed head b006bd9. The force-push to this head was a clean rebase onto newer main: its patch is byte-identical to the previous head c0847b3, and no other commit was on the branch in between, so nothing was lost. Both picker rows now take their title from the shared separator-aware basename helper. Keys, selection and the full-path line still use the raw path, so the change only affects what is displayed. Both spec files pass (57 of 57) on this head, and the two new tests fail when the parent's component is swapped in, so they really pin the fix. CI is green, and I found nothing that blocks.
Problem / Motivation
Goal: On a Windows gateway, the dashboard project picker titles each Recent and Favourites row with the project's folder name, not its whole path.
The project picker shows each Recent and Favourites row as a bold title over a muted full path. A Windows gateway serves native paths such as
D:\work\proj, which hold no/. The title was taken withd.split('/').pop(), so it came out as the whole path, the same text as the muted line under it.Why it matters
The bold title is how a user tells projects apart in the picker. On Windows, projects under one home folder share a long prefix, and the title is truncated from the right, so every row reads the same and the user has to hover or guess. The composer chip and the Spec Builder picker already show the folder name for the same paths (#28663); this picker was the one left behind.
Not a goal
/on the server, or changing how recent and favourite projects are stored or served./-only splits elsewhere in the dashboard that name something other than a picker's project folder (see the sibling sweep).What changed (motivation → approach → change)
A Recent or Favourites row for
D:\work\projis now titledproj, withD:\work\projstill in the muted line. POSIX rows read as before, except that a path ending in/is titled by its folder and a bare/is titled/, where both showed a blank line.The title was a
/-only split, which cannot see a Windows separator. The project already has a display helper for this,pathBasenamewithstripTrailingSeparatorsinutils/pathBasename.ts, which treats\as a separator only in a drive-rooted or UNC path, so a POSIX name holding a backslash stays whole.frontend-conventions.mdnames it as the way to show a gateway path's file name.ProjectPicker.tsxtitles both rows withpathBasename(stripTrailingSeparators(d)) || d, the expression the Spec Builder picker uses. The|| dtitles a bare root such as/with the root itself rather than a blank line; a drive root such asC:\is titledC:.Backwards compatibility
Compatible: for a POSIX path without a trailing
/the title is the same last segment as before; a path ending in/is titled by its folder and a bare/by itself instead of a blank line, and a drive root readsC:; nothing is accepted or rejected differently.Removes nothing: the change only alters which characters a row's title shows.
Tests
ProjectPicker.test.tsx: a Recent list holdingD:\work\proj, a UNC path, a Windows path with a trailing\,/home/u/posix,/home/u/slash/and/tmp/we\irdtitles each rowproj,shared,trail,posix,slashandwe\ird, with the full path in the same row.ProjectPicker.favorites.test.tsx: a Favourites row forD:\work\projis titledprojwith the full path beside it.Red before the fix: with the parent's
ProjectPicker.tsxunder these two spec files, 2 of their 57 tests fail (the row is titledD:\work\proj), and all 57 pass with the fix. Determinism: the two files together (57 tests per run) passed 10 consecutive runs, each with--sequence.shuffleand a fixed seed (101, 2027, 3301, 4409, 5521, 6637, 7741, 8853, 9967, 11071).Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Reproduced and smoke-tested on Ubuntu 24.04 (Linux), node v24, headless Chromium 145 through Playwright, against an isolated gateway built from this checkout with a real POSIX Recent folder and Favourite folder. Only
/api/recent-projectsand/api/favorite-projectswere answered with native Windows paths added in front of the real ones, because a Linux gateway drops any entry that is not an existing directory.D:\work\api-gatewayD:\work\api-gatewayapi-gatewayD:\work\billing-serviceD:\work\billing-servicebilling-service\\fileserver\share\web-console\\fileserver\share\web-consoleweb-consoleC:\Users\dev\notes\C:\Users\dev\notes\notesposixprojposixprojD:\work\api-gatewayD:\work\api-gatewayapi-gateway\\fileserver\share\web-console\\fileserver\share\web-consoleweb-consoleposixfavposixfavDark and light theme read the same. The two new vitest cases fail on the parent's
ProjectPicker.tsxand pass on this head.Screenshots / video
Project picker, opened from the composer's project chip (dark theme, the dashboard built from this head and from its parent, with the two project-list reads answered as above).
Light theme (the picker rendered on its own from this head and its parent, reads stubbed)
Related Issues
Closes #33916
Sibling sweep
Swept: git grep -nE "split('/')(.filter(Boolean))?.pop()" -- website/src/components website/src/pages (non-test files)
Sibling: website/src/components/ProjectPicker.tsx -- changed here
Sibling: website/src/components/WorkspacePicker.tsx:139 -- not affected -- no dashboard surface mounts WorkspacePicker, only comments name it (also :175, a listing filter)
Sibling: website/src/components/CodeEditor.tsx:41 -- not affected -- the name is only the editor's file identity: its file header is off and a whole Windows path still ends in the file's extension
Sibling: website/src/components/ContentRenderer.tsx:113 -- not affected -- the same file identity, and the language is passed separately as langHint
Sibling: website/src/components/FileChangeChips.tsx:174 -- not affected -- it folds Windows separators with normalizeWindowsPath before the split
Sibling: website/src/components/HookSkillsSelect.tsx:74 -- not affected -- it shortens a skill key, which is always
/-separatedSibling: website/src/components/HookSkillsDropdown.tsx:119 -- not affected -- it shortens a skill key, which is always
/-separatedSibling: website/src/components/markdown/Lightbox.tsx:83 -- not affected -- it splits a URL pathname, which is always
/-separatedSibling: website/src/pages/AppDetailPage.tsx:1874 -- not affected -- app manifest entries are
/-separated package paths (also :1880)Sibling: website/src/pages/apps/LibraryPage.tsx:503 -- not affected -- it shortens an app id, not a filesystem path (also :509, :527, :536)
Pattern harvest
Not generalizable: the repository already pins this class for other sites (
windowsBasenameSites.test.tsx,windowsProjectNameSites.test.tsx), and this picker's two rows are pinned by its own spec files; a lint over everysplit('/').pop()would flag URL paths, skill keys and app ids that are correctly/-only.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)