fix HistoryEntry children prop conflict and overlay CopyButton in ContentViewer

Rename HistoryEntry's children prop to childEntries to avoid React's
reserved prop name. Replace ContentViewer's onCopy callback with a
copyable flag and overlay CopyButton in the top-right corner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
cliffhall 2026-03-22 16:03:56 -04:00
commit 8d434e2381

View file

@ -1,5 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react-vite";
import { fn } from "storybook/test";
import { ContentViewer } from "./ContentViewer";
const meta: Meta<typeof ContentViewer> = {
@ -74,6 +73,15 @@ export const WithCopyButton: Story = {
args: {
type: "text",
content: "Hello, world!\nThis text can be copied.",
onCopy: fn(),
copyable: true,
},
};
export const JsonWithCopy: Story = {
args: {
type: "json",
content:
'{"name":"my-app","version":"1.0.0","description":"Sample configuration file"}',
copyable: true,
},
};