fix(web): keep the titlebar layout controls fixed across right-panel toggles
Restores main's one-inset rule (#5226) that a rebase resolution had overridden with a conditional right-2 offset, which made the controls jump sideways whenever the right panel opened. Also restores the live-agent count badge on the right-panel toggle (#5745) that the round-6 replay dropped, and applies the same fixed-position rule to the pull requests page: the toggle now stays mounted at one absolute inset in both states, with a footprint spacer in the list header so the refresh button never slides underneath it. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
d6e8dd8161
commit
a29fd51629
2 files changed
+22
-6
No files matched your search
@@ -6333,10 +6333,10 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
const panelLayoutControls = (
|
||||
<div
|
||||
className={cn(
|
||||
"workspace-titlebar-controls z-50 gap-1 [-webkit-app-region:no-drag]",
|
||||
rightPanelOpen && !shouldUsePlanSidebarSheet
|
||||
? "right-2 wco:right-[var(--workspace-controls-right)]"
|
||||
: "mr-px",
|
||||
// One inset in both states: the controls move between containers when
|
||||
// the right panel opens, and a different right offset made them jump
|
||||
// sideways on every toggle.
|
||||
"workspace-titlebar-controls z-50 mr-px gap-1 [-webkit-app-region:no-drag]",
|
||||
)}
|
||||
>
|
||||
{rightPanelOpen && !shouldUsePlanSidebarSheet ? (
|
||||
|
||||
@@ -150,18 +150,34 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
|
||||
className="shrink-0 [-webkit-app-region:no-drag]"
|
||||
pressed={rightPanelOpen}
|
||||
onPressedChange={onToggleRightPanel}
|
||||
aria-label="Toggle right panel"
|
||||
aria-label={
|
||||
liveAgentCount > 0
|
||||
? `Toggle right panel, ${liveAgentCount} ${liveAgentCount === 1 ? "agent" : "agents"} working`
|
||||
: "Toggle right panel"
|
||||
}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={!rightPanelAvailable}
|
||||
>
|
||||
<PanelRightIcon className="size-3.5" />
|
||||
{liveAgentCount > 0 ? (
|
||||
<span
|
||||
aria-hidden
|
||||
className="absolute -top-1 -right-1 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-info px-1 text-[9px] font-semibold tabular-nums text-white"
|
||||
>
|
||||
{liveAgentCount}
|
||||
</span>
|
||||
) : null}
|
||||
</Toggle>
|
||||
}
|
||||
/>
|
||||
<TooltipPopup side="bottom">
|
||||
{rightPanelAvailable
|
||||
? `Toggle right panel${rightPanelShortcutLabel ? ` (${rightPanelShortcutLabel})` : ""}`
|
||||
? `Toggle right panel${rightPanelShortcutLabel ? ` (${rightPanelShortcutLabel})` : ""}${
|
||||
liveAgentCount > 0
|
||||
? ` · ${liveAgentCount} ${liveAgentCount === 1 ? "agent" : "agents"} working`
|
||||
: ""
|
||||
}`
|
||||
: "Right panel is unavailable"}
|
||||
</TooltipPopup>
|
||||
</Tooltip>
|
||||
|
||||
Reference in new issue
Block a user