Skip to content

Commit

Permalink
Add story book
Browse files Browse the repository at this point in the history
  • Loading branch information
abeatrix committed Jan 10, 2025
1 parent a4dec41 commit 37f2c08
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import type { Meta, StoryObj } from '@storybook/react'
import { VSCodeStandaloneComponent } from '../../../../../storybook/VSCodeStoryDecorator'
import { ToolboxButton } from './ToolboxButton'

const meta: Meta<typeof ToolboxButton> = {
title: 'cody/ToolboxButton',
component: ToolboxButton,
decorators: [VSCodeStandaloneComponent],
args: {
isFirstMessage: true,
},
}

export default meta

type Story = StoryObj<typeof ToolboxButton>

export const Default: Story = {
args: {
settings: {
agent: {
name: 'deep-cody',
},
},
},
}

export const AgentDisabled: Story = {
args: {
settings: {
agent: {
name: undefined,
},
shell: {
enabled: false,
},
},
},
}

export const FullyEnabled: Story = {
args: {
settings: {
agent: {
name: 'deep-cody',
},
shell: {
enabled: true,
},
},
},
}

export const ShellNotSupported: Story = {
args: {
settings: {
agent: {
name: 'deep-cody',
},
shell: {
enabled: false,
error: 'Terminal access is not enabled on either instance or client.',
},
},
},
}

export const NonFirstMessage: Story = {
args: {
settings: {
agent: {
name: 'deep-cody',
},
shell: {
enabled: true,
},
},
isFirstMessage: false,
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export const ToolboxButton: FC<ToolboxButtonProps> = memo(({ settings, api, isFi
popoverContent={_close => (
<div id="accordion-collapse" data-accordion="collapse" className="tw-w-full">
<h2 id="accordion-collapse-heading">
<button
type="button"
<div
className="tw-flex tw-items-center tw-justify-between tw-w-full tw-p-5 tw-font-medium tw-border tw-border-border tw-rounded-t-md tw-focus:ring-4 tw-focus:ring-gray-200 tw-gap-3 tw-bg-[color-mix(in_lch,currentColor_10%,transparent)]"
title="Agentic Chat Context"
>
Expand All @@ -114,7 +113,7 @@ export const ToolboxButton: FC<ToolboxButtonProps> = memo(({ settings, api, isFi
})
}
/>
</button>
</div>
</h2>
<div
id="accordion-collapse-body"
Expand Down

0 comments on commit 37f2c08

Please sign in to comment.