fix(web): display slash command args in message view#55
fix(web): display slash command args in message view#55
Conversation
Signed-off-by: DrumRobot <drumrobot43@gmail.com>
There was a problem hiding this comment.
Pull request overview
Fixes the web session viewer’s slash command rendering so that command arguments (commandData.args) are displayed alongside the command name, aligning behavior with existing command title rendering and the expected UX from #53.
Changes:
- Render
commandData.argsnext to the slash command name inMessageItem.svelte. - Add Storybook stories covering slash command rendering with and without args.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/web/src/lib/components/MessageItem.svelte | Updates slash command message header to conditionally render parsed command args. |
| packages/web/src/lib/components/MessageItem.stories.svelte | Adds Storybook coverage for slash command messages with/without args. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <span class="font-semibold text-gh-accent">{commandData.name || 'Command'}</span> | ||
| {#if commandData.args} | ||
| <span class="text-gh-text-secondary ml-1">{commandData.args}</span> | ||
| {/if} | ||
| <div class="flex items-center gap-2"> |
There was a problem hiding this comment.
In this flex justify-between header, adding args as a separate sibling creates 3 flex children, so justify-between will push the args toward the middle instead of keeping it adjacent to the command name. Consider grouping the command name + args into a single left-side container (e.g., a nested div/span with flex items-center gap-1 min-w-0), and optionally add truncate/overflow-hidden so long args don’t shove the timestamp/buttons off-screen.
| <span class="font-semibold text-gh-accent">{commandData.name || 'Command'}</span> | |
| {#if commandData.args} | |
| <span class="text-gh-text-secondary ml-1">{commandData.args}</span> | |
| {/if} | |
| <div class="flex items-center gap-2"> | |
| <div class="flex items-center gap-1 min-w-0"> | |
| <span class="font-semibold text-gh-accent">{commandData.name || 'Command'}</span> | |
| {#if commandData.args} | |
| <span class="text-gh-text-secondary truncate">{commandData.args}</span> | |
| {/if} | |
| </div> | |
| <div class="flex items-center gap-2 flex-shrink-0"> |
Summary
commandData.argsalongside the command name in slash command messages/session), now args are also displayed (e.g.,/session repair --dry-run)Relates to #53
Test plan