feat(web): show project in session header - #1635
Open
swear01 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Findings
- [Minor] Blank worktree base paths fall through to the checkout path —
basePath || metadata.pathtreats a worktree with an empty/whitespacebasePathas a simple session. The header, share image, and sidebar then expose/group by the worktree checkout path instead of hiding an unknown repository project, contrary to this helper's worktree-vs-simple contract. Evidenceweb/src/lib/sessionProjectLabel.ts:11.
Suggested fix:export function getSessionProjectPath(metadata: SessionProjectMetadata | null | undefined): string | null { if (metadata?.worktree) return metadata.worktree.basePath?.trim() || null return metadata?.path?.trim() || null }
Summary
- Review mode: initial
- One minor correctness issue found in project-path fallback handling. No blocker or major issue found in the modified lines.
Testing
- Not run (automation; PR code was not executed).
- Add a regression case where
worktree.basePathis blank andmetadata.pathpoints at the checkout; expect no project path rather than the checkout path.
HAPI Bot
| /** Use the repository path for worktrees and the session path otherwise. */ | ||
| export function getSessionProjectPath(metadata: SessionProjectMetadata | null | undefined): string | null { | ||
| const basePath = metadata?.worktree?.basePath?.trim() | ||
| const path = basePath || metadata?.path?.trim() |
There was a problem hiding this comment.
[MINOR] Blank worktree base paths fall through to the checkout path
Because basePath and metadata.path are combined with ||, a worktree whose basePath is empty/whitespace is treated like a simple session. That makes all three consumers show/group by the checkout path even though the helper contract says worktrees use the repository base path and simple sessions use metadata.path.
Suggested fix:
if (metadata?.worktree) return metadata.worktree.basePath?.trim() || null
return metadata?.path?.trim() || nullPlease also cover a blank worktree.basePath with a nonblank checkout path in sessionProjectLabel.test.ts.
There was a problem hiding this comment.
Findings
- None.
Summary
- Review mode: follow-up after new commits
- No blocker, major, minor, or nit findings in the latest full diff. The previous blank-worktree-base-path issue is fixed at
web/src/lib/sessionProjectLabel.ts:10, with regression coverage atweb/src/lib/sessionProjectLabel.test.ts:25. - Residual testing gap: no browser-level assertion covers the rendered mobile project priority or project metadata in the share preview; the selector/helper coverage limits the remaining risk.
Testing
- Not run (automation; source-only review).
- Suggested: add a focused UI assertion for mobile project rendering and share-preview project inclusion when those paths are next exercised.
HAPI Bot
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
metadata.worktree.basePathand simple sessions frommetadata.pathCloses #1395
Testing
bun typecheckbun run testCI=1 PLAYWRIGHT_WEB_PORT=5187 bun run test:e2e -- terminal-wrap-fidelity.spec.ts composer-copy.spec.ts