Skip to content

Commit 55bb56f

Browse files
cliffhallclaude
andcommitted
style(LogStreamPanel): match HistoryListPanel button styling
Clear / Export / Copy All on the Logging screen were rendered with the subtle ToolbarButton helper while History's equivalents use `Button variant="default"`. Switch all three to the default variant so the toolbars look identical across screens and mirror the disabling behavior — each button is now disabled when `entries.length === 0`. ToolbarButton helper is unused after this change and dropped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent de2861e commit 55bb56f

2 files changed

Lines changed: 40 additions & 10 deletions

File tree

clients/web/src/components/groups/LogStreamPanel/LogStreamPanel.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ const PanelContainer = Paper.withProps({
3131
variant: "panel",
3232
});
3333

34-
const ToolbarButton = Button.withProps({
35-
variant: "subtle",
36-
size: "sm",
37-
});
38-
3934
const EmptyCenter = Stack.withProps({
4035
flex: 1,
4136
align: "center",
@@ -88,9 +83,27 @@ export function LogStreamPanel({
8883
checked={autoScroll}
8984
onChange={onToggleAutoScroll}
9085
/>
91-
<ToolbarButton onClick={onClear}>Clear</ToolbarButton>
92-
<ToolbarButton onClick={onExport}>Export</ToolbarButton>
93-
<ToolbarButton onClick={onCopyAll}>Copy All</ToolbarButton>
86+
<Button
87+
variant="default"
88+
onClick={onClear}
89+
disabled={entries.length === 0}
90+
>
91+
Clear
92+
</Button>
93+
<Button
94+
variant="default"
95+
onClick={onExport}
96+
disabled={entries.length === 0}
97+
>
98+
Export
99+
</Button>
100+
<Button
101+
variant="default"
102+
onClick={onCopyAll}
103+
disabled={entries.length === 0}
104+
>
105+
Copy All
106+
</Button>
94107
</Group>
95108
</Group>
96109
{filteredEntries.length > 0 ? (

clients/web/src/components/screens/LoggingScreen/LoggingScreen.test.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,36 @@ describe("LoggingScreen", () => {
3535
it("invokes onClear when clear is clicked", async () => {
3636
const user = userEvent.setup();
3737
const onClear = vi.fn();
38-
renderWithMantine(<LoggingScreen {...baseProps} onClear={onClear} />);
38+
const entries = [
39+
{ receivedAt: new Date(), params: { level: "info" as const, data: "x" } },
40+
];
41+
renderWithMantine(
42+
<LoggingScreen {...baseProps} entries={entries} onClear={onClear} />,
43+
);
3944
await user.click(screen.getByRole("button", { name: "Clear" }));
4045
expect(onClear).toHaveBeenCalledTimes(1);
4146
});
4247

4348
it("invokes onCopyAll when Copy All is clicked", async () => {
4449
const user = userEvent.setup();
4550
const onCopyAll = vi.fn();
46-
renderWithMantine(<LoggingScreen {...baseProps} onCopyAll={onCopyAll} />);
51+
const entries = [
52+
{ receivedAt: new Date(), params: { level: "info" as const, data: "x" } },
53+
];
54+
renderWithMantine(
55+
<LoggingScreen {...baseProps} entries={entries} onCopyAll={onCopyAll} />,
56+
);
4757
await user.click(screen.getByRole("button", { name: "Copy All" }));
4858
expect(onCopyAll).toHaveBeenCalledTimes(1);
4959
});
5060

61+
it("disables Clear / Export / Copy All when there are no entries", () => {
62+
renderWithMantine(<LoggingScreen {...baseProps} />);
63+
expect(screen.getByRole("button", { name: "Clear" })).toBeDisabled();
64+
expect(screen.getByRole("button", { name: "Export" })).toBeDisabled();
65+
expect(screen.getByRole("button", { name: "Copy All" })).toBeDisabled();
66+
});
67+
5168
it("toggles a single level on level button click", async () => {
5269
const user = userEvent.setup();
5370
const entries = [

0 commit comments

Comments
 (0)