Skip to content

feat(app): show active project in session header - #43941

Open
TonisOrmisson wants to merge 9 commits into
anomalyco:devfrom
TonisOrmisson:session-project-name
Open

feat(app): show active project in session header#43941
TonisOrmisson wants to merge 9 commits into
anomalyco:devfrom
TonisOrmisson:session-project-name

Conversation

@TonisOrmisson

@TonisOrmissonTonisOrmisson commented Aug 21, 2026

Copy link
Copy Markdown

Issue for this PR

Closes#43842

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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:

  • 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.

Screenshots / recordings

Before:

Before

After:

After

Mobile width:

Mobile

Forced RTL:

RTL

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference; please use your judgment.

  1. 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.

  2. 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().

  3. 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.

  4. 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.

@TonisOrmisson
TonisOrmisson marked this pull request as ready for review August 22, 2026 09:09
Sign up for freeto 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.

[FEATURE]:桌面端多项目并行,体验非常差

2 participants

@TonisOrmisson@Enough1122