Skip to content

fix(web): display slash command args in message view#55

Draft
DrumRobot wants to merge 1 commit intomainfrom
fix/53-slash-command-args-display
Draft

fix(web): display slash command args in message view#55
DrumRobot wants to merge 1 commit intomainfrom
fix/53-slash-command-args-display

Conversation

@DrumRobot
Copy link
Member

Summary

  • Display commandData.args alongside the command name in slash command messages
  • Previously only the command name was shown (e.g., /session), now args are also displayed (e.g., /session repair --dry-run)
  • Add Storybook stories for MessageItem slash command rendering

Relates to #53

Test plan

  • Verify slash commands with args display correctly in web session viewer
  • Verify slash commands without args still display correctly
  • Verify component in Storybook (MessageItem stories)
  • Build passes
  • All existing tests pass

Signed-off-by: DrumRobot <drumrobot43@gmail.com>
@DrumRobot DrumRobot added the bug Something isn't working label Mar 20, 2026
@DrumRobot DrumRobot linked an issue Mar 20, 2026 that may be closed by this pull request
@DrumRobot DrumRobot requested a review from Copilot March 20, 2026 13:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.args next to the slash command name in MessageItem.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.

Comment on lines 296 to 300
<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">
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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">

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slash command args not displayed in message view

2 participants