Skip to content

fix(ui): show current chat title in conversation header - #372

Open
theyashdedhia wants to merge 3 commits into
truefoundry:mainfrom
theyashdedhia:fix/chat-title-header
Open

fix(ui): show current chat title in conversation header#372
theyashdedhia wants to merge 3 commits into
truefoundry:mainfrom
theyashdedhia:fix/chat-title-header

Conversation

@theyashdedhia

@theyashdedhia theyashdedhia commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Show the current chat title persistently above the conversation so users can identify the active chat without opening the sidebar.

Closes #352

Changes

  • add a chat title label sourced from the active thread
  • show New Chat when the conversation is untitled
  • truncate long titles while preserving the full title in a tooltip
  • display the title across sidebar, drawer, dock, and widget layouts
  • retain the associated agent label as secondary context
  • add focused component and header visibility tests
  • add a patch changeset for @truefoundry/trueforge-ui

How was this tested?

  • pnpm build
  • pnpm test
  • pnpm typecheck
  • pnpm lint:ci
  • pnpm format:check
  • manually verified existing and untitled conversations in the standalone UI
  • manually verified title truncation at a 600px viewport

Checklist

  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed (not applicable: no documented configuration or API behavior changed)

Note

Low Risk
UI-only header chrome in trueforge-ui; no auth, data, or API changes.

Overview
Users can now see the active chat title in the conversation header without opening the session list.

Adds ChatTitleHeaderLabel, which reads the current thread title (or New Chat if untitled), truncates long names, and keeps the full title in a tooltip. Sidebar, drawer, and stack (dock/widget) layouts show this as the primary heading.

The named-agent label is demoted from h1 to a capped secondary label so both can sit in the header. Header visibility now treats an active session as having content, so untitled drafts still show the title chrome.

Reviewed by Cursor Bugbot for commit b7ba101. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b7ba101

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-ui Patch
frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread packages/trueforge-ui/src/atoms/ChatTitleHeaderLabel.tsx
Comment thread packages/trueforge-ui/src/atoms/ChatTitleHeaderLabel.tsx
@theyashdedhia

Copy link
Copy Markdown
Author

Thanks for flagging this. I traced the deep-link and pagination paths through assistant-ui’s remote-thread runtime, and this appears to be a false positive.
threads.threadItems is derived from the runtime’s complete threadData, not only the currently visible or paginated sidebar rows. When initialThreadId references a session absent from the loaded page, switchToThread() calls adapter.fetch(remoteId), inserts the fetched metadata into threadData, maps the remote ID to its internal thread ID, and then sets mainThreadId to that item’s ID. Therefore, the lookup by item.id === mainThreadId resolves correctly after the fetch.
I also verified the exact scenario with a runtime-backed regression test: the first paginated history response excludes the URL-selected session, the runtime fetches it separately, and the header displays the fetched title rather than New Chat. I’ll include that regression test in the PR to document and protect this behavior.

@chiragjn chiragjn added the ui label Aug 21, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b7ba101. Configure here.

>
{displayTitle}
</h1>
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Title shown while shell idle

Medium Severity

ChatTitleHeaderLabel always renders, but useChatTitleHeaderVisible is only true when the shell is active. Sibling chrome (NamedAgentHeaderLabel, ClearChatButton, SaveAgentButton) self-hides when inactive. On Agent Library idle screens the header still shows New Chat (or a leftover thread title) beside “Select an agent…”, which mislabels the active context. Layouts also dropped the old flex-1 spacer and rely on this label’s flex-1, so the label stays mounted for spacing even when it should not be visible.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b7ba101. Configure here.

@sajal-truefoundry sajal-truefoundry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this PR but it will need some changes for the following point that you added.

retain the associated agent label as secondary context

I'm attaching a couple screenshots as well but the basic idea is to show the agent name as subtext instead of making it disjoint and keeping towards the right.

For chat with an agent:

New Chat

Image

After chat summary generation

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show chat title on top - currently its not immediately clear

4 participants