You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
recognize Windows drive roots when resolving project labels
fall back to each session directory basename for non-repository tabs
add Windows folder fixtures to the session-tabs story and a cross-platform regression test
Checks
bun test test/util/project.test.ts test/context/session-tabs-model.test.ts
bun typecheck
bun x prettier --check packages/tui/src/util/project.ts packages/tui/test/util/project.test.ts packages/tui/src/feature-plugins/system/storybook/session-tabs.tsx
OpenCode Drive before/after capture at 100×35 cells
AI code review — automated review for reference, author can ignore or act on any point.
Right root cause and a clean fix: path.win32.basename("C:\\") returns an empty string, which is why drive-root projects lost their tab labels, and choosing the parser family up front via /^(?:[A-Za-z]:[\\/]|\\\\)/ correctly covers drive letters (mixed separators included), UNC shares, and keeps POSIX names containing backslashes intact — the new regression test documenting that last nuance is a nice touch.
Two suggestions:
Explicit name is still ignored for root projects (packages/tui/src/util/project.ts, the if (paths.parse(canonical).root === canonical) branch): it returns basename(fallback) before ever consulting project?.name. A workspace that has an explicit name but whose canonical path is a filesystem root gets relabeled by whichever directory one session happened to open. If that ordering wasn't deliberate, consider return project?.name ?? (fallback ? paths.basename(fallback) : undefined) for the root branch. At minimum, a test pinning the intended precedence would prevent future churn.
Test coverage gaps worth locking down: (a) drive root with no fallback → expected undefined; (b) a lowercase drive letter (c:\) exercising the i flag; (c) UNC canonical (\\server\share) — path.win32.parse treats the whole share as .root, so it takes the fallback path; asserting that behavior makes the UNC handling intentional rather than accidental.
Minor: the storybook fixture list now mixes two shapes and relies on TS inferring a union plus the "project" in tab narrowing — works fine today; an explicit fixture type would keep it stable as fixtures grow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checks
bun test test/util/project.test.ts test/context/session-tabs-model.test.tsbun typecheckbun x prettier --check packages/tui/src/util/project.ts packages/tui/test/util/project.test.ts packages/tui/src/feature-plugins/system/storybook/session-tabs.tsxRequested by: @kitlangton (Kit via Slack)