Skip to content

feat(web): allow customizing topbar header controls visibility via context menu - #7204

Closed
kbrianps wants to merge 3 commits into
pingdotgg:mainfrom
kbrianps:feat/customizable-header-actions
Closed

kbrianps wants to merge 3 commits into
pingdotgg:mainfrom
kbrianps:feat/customizable-header-actions

Conversation

@kbrianps

@kbrianps kbrianps commented Aug 16, 2026 •

Copy link
Copy Markdown

Summary

Allows users to show or hide the topbar action controls (Action scripts, Open in editor, Git source control) by right-clicking on the header bar or buttons.

Changes

  • Created persistent useHeaderControlsStore with localStorage support for action visibility toggles.
  • Added context menu on topbar header and action buttons to list and toggle visible controls with checkmarks.
  • Conditionally render header action buttons based on user preferences.
  • Added unit tests for store and menu helpers.

Note

Low Risk
UI preference state in localStorage only; no auth, data, or API behavior changes beyond conditional header rendering.

Overview
Adds a right-click context menu on the chat header actions strip so users can show or hide Action scripts, Open in editor, and Git source control. Choices are stored in a new persisted useHeaderControlsStore (localStorage key t3code:header-controls:v1); all three default to visible.

ChatHeader wires the menu through the local contextMenu.show API, toggles visibility on selection, and wraps each control in a container that uses hidden when turned off. Right-clicks inside [data-chat-header-actions] open this menu instead of being ignored; the breadcrumb/title area still opens the existing thread actions menu. buildHeaderControlsContextMenuItems builds checkmarked menu labels; unit tests cover the store and menu helper.

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

Note

Add context menu to chat header for toggling header controls visibility

  • Adds a right-click context menu on the header actions area that lets users toggle visibility of Scripts, Open in Editor, and Git controls.
  • Introduces buildHeaderControlsContextMenuItems in ChatHeader.tsx to format menu items with checkmark/unchecked indicators based on current visibility.
  • Adds useHeaderControlsStore in headerControlsStore.ts, a Zustand store that persists visibility state to localStorage under the key t3code:header-controls:v1.
  • Behavioral Change: right-clicking within the header actions area now opens the visibility menu instead of the thread context menu.

Macroscope summarized 9d21704.

Copilot AI lite review requested due to automatic review settings August 16, 2026 10:55

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b8c0a771-94ea-4683-9265-691cd1e5af28

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 16, 2026
Comment thread apps/web/src/components/chat/ChatHeader.tsx Outdated

@macroscopeapp macroscopeapp Bot 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.

Reviewed the header-controls customization for UI consistency. Three concrete issues in apps/web/src/components/chat/ChatHeader.tsx: the checkmark column does not survive the web context-menu fallback's rendering, hiding "Open in editor" also unbinds its global keyboard shortcut, and the thread action menu's right-click target is narrowed from the breadcrumb row to the title button only.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/chat/ChatHeader.tsx Outdated
Comment thread apps/web/src/components/chat/ChatHeader.tsx Outdated
Comment thread apps/web/src/components/chat/ChatHeader.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces a new user-facing feature with new state management and persistence. Multiple unresolved comments identify a usability bug where hiding all three controls collapses the container to zero height, making the context menu inaccessible and the controls unrecoverable. New capabilities warrant human review.

You can customize Macroscope's approvability policy. Learn more.

data-chat-header-actions
onContextMenu={handleHeaderActionsContextMenu}
className={cn(
"flex shrink-0 items-center justify-end gap-2 @3xl/header-actions:gap-3",

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.

🟡 Medium chat/ChatHeader.tsx:364

When all three controls are hidden, the [data-chat-header-actions] element collapses to zero height, so right-clicking the header can only open the thread menu and there is no way to reopen the visibility menu. Give this container a header-height hit area so its context-menu handler remains reachable even when its children are unmounted or display: none.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/chat/ChatHeader.tsx around line 364:

When all three controls are hidden, the `[data-chat-header-actions]` element collapses to zero height, so right-clicking the header can only open the thread menu and there is no way to reopen the visibility menu. Give this container a header-height hit area so its context-menu handler remains reachable even when its children are unmounted or `display: none`.

@macroscopeapp macroscopeapp Bot 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.

Reviewed the header controls visibility toggle for UI/behavioral consistency. One finding: hiding the git control unmounts it, which takes app-wide git-status refresh down with it. The openIn control already uses the correct CSS-hidden approach.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/chat/ChatHeader.tsx Outdated

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high 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 9d21704. Configure here.

onOpenPullRequest={onOpenPullRequest}
{...(draftId ? { draftId } : {})}
/>
</div>

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.

Hidden git control stays active

Low Severity

Hiding Git source control now only applies Tailwind hidden instead of unmounting GitActionsControl. The control keeps running its focus and visibility VCS refresh listeners, status subscription, and draft branch sync, so background git work continues after the user hides the chrome. The actions strip already has min-w-6 for the context-menu hit target, so keeping this tree mounted is not required for that UX.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9d21704. Configure here.

@macroscopeapp macroscopeapp Bot 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.

One finding on the header actions hit area.

Posted via Macroscope — UI Consistency

onContextMenu={handleHeaderActionsContextMenu}
className={cn(
"flex shrink-0 items-center justify-end gap-2 @3xl/header-actions:gap-3",
"flex h-full min-w-6 shrink-0 items-center justify-end gap-2 @3xl/header-actions:gap-3",

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.

h-full here resolves to auto: the actions cluster's containing block is the ChatHeader root (ChatHeader.tsx:274), which is a flex item of the items-center topbar <header> (ChatView.tsx:6214) and therefore has an indefinite (content) height, so height: 100% never picks up --workspace-topbar-height. With every control toggled off the three wrappers are display:none, so this container has zero content height — min-w-6 gives width but the box is 24x0 and cannot be right-clicked. Since this context menu is the only way to re-enable the controls and the choice is persisted in localStorage, hiding all three leaves the header controls unrecoverable.

Consider stretching to the row instead of relying on a percentage height, so the empty region keeps a real hit area:

Suggested change
"flex h-full min-w-6 shrink-0 items-center justify-end gap-2 @3xl/header-actions:gap-3",
"flex min-w-6 shrink-0 items-center justify-end gap-2 self-stretch @3xl/header-actions:gap-3",

Posted via Macroscope — UI Consistency

@t3dotgg

t3dotgg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

This adds persisted visibility state and a context menu for existing header actions. Hiding core actions reduces discovery and adds settings state for a small layout preference.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants