Skip to content

fix(dashboard): name a Windows project by its folder in the composer and Spec Builder picker - #28663

Merged
buluoray merged 1 commit into
mainfrom
fix/27794-project-basename
Nov 3, 2026
Merged

buluoray merged 1 commit into
mainfrom
fix/27794-project-basename

Conversation

@buluoray

@buluoray buluoray commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

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 as C:\Users\u\workplace\KiroCrew holds 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

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 uses pathBasename(stripTrailingSeparators(p)) || p from website/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: the base helper used by the selected field and each recent project.

Backwards compatibility

Compatible: for every POSIX path pathBasename(stripTrailingSeparators(p)) equals p.split('/').filter(Boolean).pop(), and the || p fallback 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 for C:\…, 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 lists ChatInput.tsx and ProjectPicker.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 in ChatInput.approval.test.tsx, which fail identically on an untouched origin/main worktree 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/src

Pattern harvest

Rule candidate: review-prompt
Pattern: a gateway project or file path shown to the user taken with .split('/').filter(Boolean).pop() instead of pathBasename(stripTrailingSeparators(p)), which leaves a Windows C:\… path whole.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 2, 2026 22:35
@buluoray
buluoray requested a review from iamwhatever November 2, 2026 22:35
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 2, 2026
@buluoray
buluoray force-pushed the fix/27794-project-basename branch from 45cb01e to eb16f97 Compare November 2, 2026 22:53
…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
@buluoray
buluoray force-pushed the fix/27794-project-basename branch from eb16f97 to 65e8661 Compare November 2, 2026 23:14
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix reuses the existing pathBasename/stripTrailingSeparators helpers at all five sites the issue names, and the remaining /-only sites are either declared out of scope or tracked in #27792.

What this change ships

Inventory (6 items) — 6 justified

Intent: 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).

  1. On Windows, the composer project chip shows the folder name instead of the full path — justified
  2. On Windows, the read-only peer project chip shows the folder name — justified
  3. On Windows, the terminal hint names the folder — justified
  4. On Windows, the mid-turn "project switch applies next turn" note names the folder — justified
  5. On Windows, the Spec Builder picker's selected and recent projects show the folder name — justified
  6. Two source-scan tests now cover ChatInput.tsx and ProjectPicker.tsx — justified

[FIRST-PRINCIPLES-REVIEWED] 65e8661

Description read

[DESCRIPTION-READ] 597b9bf25c5f3edbb6e5e8eff2908e58459821f437b128f94a4dbc4598629664

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • If any doubt remains about the 160 px chip, attach one still of the composer project chip with a mocked C:\Users\u\workplace\KiroCrew project. It would show KiroCrew where the truncated drive prefix showed before.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 65e8661

Verdict parsed from the review's SHA-scoped output markers for commit 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 65e8661

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 65e8661025a4cf01bfabc06b1b2b06aba0e9f20b false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 3, 2026
@buluoray
buluoray enabled auto-merge (squash) November 3, 2026 07:13

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@buluoray
buluoray merged commit 2dbe10a into main Nov 3, 2026
148 of 151 checks passed
@buluoray
buluoray deleted the fix/27794-project-basename branch November 3, 2026 08:06
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composer and Spec Builder project picker: Windows project paths show whole where the folder name belongs, five /-only splits #17512 did not list

2 participants