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
Shows the active project name in the conversation header, immediately before the existing context/cost control, so desktop users can identify the project while switching conversations.
The change stays intentionally small:
Reuses the existing project and session directory state.
Handles local and server-scoped session routes, including sandbox directories.
Keeps the label truncated, RTL-safe, and aligned with the existing conversation-header actions.
Does not add vertical tabs, a sidebar, project grouping, or conversation-title redesign.
Related context: #38143 and #38308. This PR is limited to the active-project visibility portion of #43842.
How did you verify your code works?
bun run test from packages/app: 722 unit tests and 41 browser-condition tests passed.
bun typecheck from packages/app passed.
Verified desktop, mobile-width, and forced-RTL rendering with a deterministic Playwright session fixture.
AI code review — automated review for reference; please use your judgment.
packages/app/src/components/session/session-header.tsx:158 — project switched from an explicit lookup (projects list matched against the resolved projectDirectory, including sandboxes) to plain sync().project. When viewing a session whose directory differs from the currently synced project (e.g., jumping into a historical/cross-project session via params.id), the header can now attribute it to the wrong project. Why it matters: the label is the primary orientation cue in the header. Suggestion: keep resolving project from the effective projectDirectory() first and use sync().project only as last-resort fallback.
packages/app/src/components/session/session-header.tsx:151-157 — the new fallback chain means a project name can render even when neither params.dir nor the session record yields a directory (projectDirectory === "" but sync().project set). If showing a name with no corresponding directory chip is intended, fine; otherwise gate the name on projectDirectory().
Test coverage — none of the new paths are covered: params.dir present, absent-with-session-directory, absent-without-session-directory, and empty-name suppression in SessionProjectName. Why it matters: this is exactly the kind of memo-fallback chain that silently breaks on refactor. Suggestion: add a component test driving params through those three cases.
Nit: packages/app/src/components/session/session-header.tsx:329 — in the non-V2 branch, SessionProjectName renders alongside the pre-existing xl: directory block; on wide screens the project may appear twice (once as name, once via the directory UI). Worth a quick visual check for redundancy.
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.
Issue for this PR
Closes#43842
Type of change
What does this PR do?
Shows the active project name in the conversation header, immediately before the existing context/cost control, so desktop users can identify the project while switching conversations.
The change stays intentionally small:
Related context: #38143 and #38308. This PR is limited to the active-project visibility portion of #43842.
How did you verify your code works?
bun run testfrompackages/app: 722 unit tests and 41 browser-condition tests passed.bun typecheckfrompackages/apppassed.Screenshots / recordings
Before:
After:
Mobile width:
Forced RTL:
Checklist