feat(ui): drop the slash and the argument echo from the command row
The web command row renders `title · summary` from one logged command lifecycle pair, and the two halves were written without knowing about each other: the title was the dispatched line rebuilt from `command/run` and the summary was `command/done`'s verbatim text, so every Access-chip pick read `/permission workspace-write · Permission preset: workspace-write.` — the command name twice and its argument twice. The title is now the bare command name (no `/`, no arguments — the summary already says what the command did), and a command handler's settlement text never repeats the command's own name, so `/permission` returns `preset workspace-write`. The row reads `permission · preset workspace-write`, and the TUI notice still names the preset that now applies. The log is unchanged: `command/run` keeps its structured name/args split for a richer registered row.
This commit is contained in:
@@ -89,7 +89,7 @@ describe('/permission command', () => {
|
||||
const { ctx, session } = await harness()
|
||||
const agent = await agentFor(ctx, session)
|
||||
const execution = await ctx.commands.execute(agent, '/permission danger-full-access', new AbortController().signal)
|
||||
expect(execution?.result).toEqual({ kind: 'success', text: 'Permission preset: danger-full-access.' })
|
||||
expect(execution?.result).toEqual({ kind: 'success', text: 'preset danger-full-access' })
|
||||
expect(ctx.permission.current(session.events)).toBe('danger-full-access')
|
||||
const run = session.events.find(event => event.type === 'command/run')
|
||||
expect(run?.data).toMatchObject({ name: 'permission', args: ' danger-full-access' })
|
||||
@@ -101,7 +101,7 @@ describe('/permission command', () => {
|
||||
const execution = await ctx.commands.execute(agent, '/permission', new AbortController().signal)
|
||||
expect(execution?.result).toEqual({
|
||||
kind: 'success',
|
||||
text: 'Current permission preset: workspace-write. Available: workspace-write, danger-full-access.',
|
||||
text: 'current preset workspace-write (available: workspace-write, danger-full-access)',
|
||||
})
|
||||
expect(session.events.filter(event => event.type === 'permission/preset')).toHaveLength(0)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user