Skip to content

Commit c288ea6

Browse files
committed
feat(web): refresh pull request details
1 parent 0aa3ed4 commit c288ea6

12 files changed

Lines changed: 703 additions & 558 deletions

apps/web/src/components/ChatView.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6160,7 +6160,6 @@ function ChatViewContent(props: ChatViewProps) {
61606160
? "thread"
61616161
: "page"
61626162
}
6163-
chromeVariant="collapse"
61646163
composerDraftTarget={composerDraftTarget}
61656164
onStateChange={handlePullRequestTabStatusChange}
61666165
/>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { renderToStaticMarkup } from "react-dom/server";
2+
import { describe, expect, it } from "vite-plus/test";
3+
4+
import { PanelLayoutControls } from "./PanelLayoutControls";
5+
6+
describe("PanelLayoutControls", () => {
7+
it("keeps the unavailable right-panel tooltip trigger interactive", () => {
8+
const markup = renderToStaticMarkup(
9+
<PanelLayoutControls
10+
showTerminalControl={false}
11+
terminalAvailable={false}
12+
terminalOpen={false}
13+
terminalShortcutLabel={null}
14+
rightPanelAvailable={false}
15+
rightPanelOpen={false}
16+
rightPanelShortcutLabel={null}
17+
liveAgentCount={0}
18+
onToggleTerminal={() => {}}
19+
onToggleRightPanel={() => {}}
20+
/>,
21+
);
22+
23+
expect(markup).toContain('data-slot="tooltip-trigger"');
24+
expect(markup).toMatch(/data-slot="tooltip-trigger"[^>]*><button[^>]*disabled=""/);
25+
});
26+
});

apps/web/src/components/chat/PanelLayoutControls.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface PanelLayoutControlsProps {
1212
rightPanelAvailable: boolean;
1313
rightPanelOpen: boolean;
1414
rightPanelShortcutLabel: string | null;
15+
rightPanelUnavailableLabel?: string;
1516
/** Running + waiting subagents in this thread; badges the right panel toggle. */
1617
liveAgentCount: number;
1718
onToggleTerminal: () => void;
@@ -26,6 +27,7 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
2627
rightPanelAvailable,
2728
rightPanelOpen,
2829
rightPanelShortcutLabel,
30+
rightPanelUnavailableLabel = "Right panel is unavailable",
2931
liveAgentCount,
3032
onToggleTerminal,
3133
onToggleRightPanel,
@@ -60,41 +62,39 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
6062
</Tooltip>
6163
) : null}
6264
<Tooltip>
63-
<TooltipTrigger
64-
render={
65-
<Toggle
66-
className="shrink-0 [-webkit-app-region:no-drag]"
67-
pressed={rightPanelOpen}
68-
onPressedChange={onToggleRightPanel}
69-
aria-label={
70-
liveAgentCount > 0
71-
? `Toggle right panel, ${liveAgentCount} ${liveAgentCount === 1 ? "agent" : "agents"} working`
72-
: "Toggle right panel"
73-
}
74-
variant="ghost"
75-
size="sm"
76-
disabled={!rightPanelAvailable}
77-
>
78-
<PanelRightIcon className="size-4" />
79-
{liveAgentCount > 0 ? (
80-
<span
81-
aria-hidden
82-
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"
83-
>
84-
{liveAgentCount}
85-
</span>
86-
) : null}
87-
</Toggle>
88-
}
89-
/>
65+
<TooltipTrigger render={<span className="flex shrink-0" />}>
66+
<Toggle
67+
className="shrink-0 [-webkit-app-region:no-drag]"
68+
pressed={rightPanelOpen}
69+
onPressedChange={onToggleRightPanel}
70+
aria-label={
71+
liveAgentCount > 0
72+
? `Toggle right panel, ${liveAgentCount} ${liveAgentCount === 1 ? "agent" : "agents"} working`
73+
: "Toggle right panel"
74+
}
75+
variant="ghost"
76+
size="sm"
77+
disabled={!rightPanelAvailable}
78+
>
79+
<PanelRightIcon className="size-4" />
80+
{liveAgentCount > 0 ? (
81+
<span
82+
aria-hidden
83+
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"
84+
>
85+
{liveAgentCount}
86+
</span>
87+
) : null}
88+
</Toggle>
89+
</TooltipTrigger>
9090
<TooltipPopup side="bottom">
9191
{rightPanelAvailable
9292
? `Toggle right panel${rightPanelShortcutLabel ? ` (${rightPanelShortcutLabel})` : ""}${
9393
liveAgentCount > 0
9494
? ` · ${liveAgentCount} ${liveAgentCount === 1 ? "agent" : "agents"} working`
9595
: ""
9696
}`
97-
: "Right panel is unavailable"}
97+
: rightPanelUnavailableLabel}
9898
</TooltipPopup>
9999
</Tooltip>
100100
</div>

0 commit comments

Comments
 (0)