-
Notifications
You must be signed in to change notification settings - Fork 4
fix(web): display slash command args in message view #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| <script module> | ||
| import { defineMeta } from '@storybook/addon-svelte-csf' | ||
| import MessageItem from './MessageItem.svelte' | ||
|
|
||
| const noop = () => {} | ||
|
|
||
| const { Story } = defineMeta({ | ||
| title: 'Components/MessageItem', | ||
| component: MessageItem, | ||
| tags: ['autodocs'], | ||
| args: { | ||
| sessionId: 'test-session', | ||
| onDelete: noop, | ||
| }, | ||
| }) | ||
| </script> | ||
|
|
||
| <Story | ||
| name="Slash Command Without Args" | ||
| args={{ | ||
| msg: { | ||
| uuid: 'msg-1', | ||
| type: 'human', | ||
| timestamp: new Date().toISOString(), | ||
| message: { content: '<command-name>/vsix</command-name>' }, | ||
| }, | ||
| }} | ||
| > | ||
| {#snippet children(args)} | ||
| <div class="p-4 bg-gh-canvas text-gh-text max-w-2xl"> | ||
| <MessageItem {...args} /> | ||
| </div> | ||
| {/snippet} | ||
| </Story> | ||
|
|
||
| <Story | ||
| name="Slash Command With Args" | ||
| args={{ | ||
| msg: { | ||
| uuid: 'msg-2', | ||
| type: 'human', | ||
| timestamp: new Date().toISOString(), | ||
| message: { | ||
| content: | ||
| '<command-name>/session</command-name>\n<command-args>repair --dry-run e15f9f9a</command-args>', | ||
| }, | ||
| }, | ||
| }} | ||
| > | ||
| {#snippet children(args)} | ||
| <div class="p-4 bg-gh-canvas text-gh-text max-w-2xl"> | ||
| <MessageItem {...args} /> | ||
| </div> | ||
| {/snippet} | ||
| </Story> | ||
|
|
||
| <Story | ||
| name="Slash Command With Short Args" | ||
| args={{ | ||
| msg: { | ||
| uuid: 'msg-3', | ||
| type: 'human', | ||
| timestamp: new Date().toISOString(), | ||
| message: { | ||
| content: '<command-name>/skill-name</command-name>\n<command-args>topic</command-args>', | ||
| }, | ||
| }, | ||
| }} | ||
| > | ||
| {#snippet children(args)} | ||
| <div class="p-4 bg-gh-canvas text-gh-text max-w-2xl"> | ||
| <MessageItem {...args} /> | ||
| </div> | ||
| {/snippet} | ||
| </Story> | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -293,7 +293,12 @@ | |||||||||||||||||
| class="p-3 rounded-lg bg-gh-accent/15 border-l-3 border-l-gh-accent group relative" | ||||||||||||||||||
| > | ||||||||||||||||||
| <div class="flex justify-between items-center text-xs text-gh-text-secondary"> | ||||||||||||||||||
| <span class="font-semibold text-gh-accent">{commandData.name || 'Command'}</span> | ||||||||||||||||||
| <span> | ||||||||||||||||||
| <span class="font-semibold text-gh-accent">{commandData.name || 'Command'}</span> | ||||||||||||||||||
| {#if commandData.args} | ||||||||||||||||||
| <span class="text-gh-text-secondary">{commandData.args}</span> | ||||||||||||||||||
| {/if} | ||||||||||||||||||
|
Comment on lines
+297
to
+300
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an explicit separator between command name and args.
💡 Proposed fix <span class="font-semibold text-gh-accent">{commandData.name || 'Command'}</span>
{`#if` commandData.args}
- <span class="text-gh-text-secondary">{commandData.args}</span>
+ <span class="ml-1 text-gh-text-secondary">{commandData.args}</span>
{/if}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| </span> | ||||||||||||||||||
| <div class="flex items-center gap-2"> | ||||||||||||||||||
| <span>{formatDate(msg.timestamp)}</span> | ||||||||||||||||||
| {@render splitButton()} | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use fixed timestamps in stories to keep snapshots deterministic.
Using
new Date().toISOString()introduces run-to-run UI diffs in Storybook visual regression flows. Prefer a static timestamp.💡 Proposed fix
<script module> import { defineMeta } from '@storybook/addon-svelte-csf' import MessageItem from './MessageItem.svelte' const noop = () => {} + const fixedTimestamp = '2026-01-20T10:00:00.000Z' @@ uuid: 'msg-1', type: 'human', - timestamp: new Date().toISOString(), + timestamp: fixedTimestamp, @@ uuid: 'msg-2', type: 'human', - timestamp: new Date().toISOString(), + timestamp: fixedTimestamp, @@ uuid: 'msg-3', type: 'human', - timestamp: new Date().toISOString(), + timestamp: fixedTimestamp,Also applies to: 42-42, 63-63
🤖 Prompt for AI Agents