refactor(agent): scope queue actions to edit and remove

This commit is contained in:
kingwl
2026-07-30 01:58:51 +08:00
parent e56c0699a9
commit 7ce330f0e4
49 changed files with 181 additions and 294 deletions

View File

@@ -20,7 +20,7 @@ const SID = 's1' as SessionId
const iid = (id: string): InboxItemId => id as InboxItemId
function row(id: string, text: string | null, preview = text ?? '[image]'): QueuedMessage {
return { id: iid(id), preview, text, placement: 'queued' }
return { id: iid(id), preview, text }
}
function snapshotWith(queue: QueuedMessage[]): ConversationSnapshot {
@@ -78,19 +78,6 @@ describe('QueueDock', () => {
expect(container.innerHTML).toBe('')
})
it('hides pending steering until it has a dedicated Web interaction', () => {
const steering = { ...row('i-steer', 'steer separately'), placement: 'steering' as const }
const snap = snapshotWith([steering])
const source = liveSession(snap)
const { container } = render(<QueueDock {...kitFor(snap)} useSession={source.useSession} />)
expect(container.innerHTML).toBe('')
act(() => { source.push(snapshotWith([steering, row('i-queue', 'queue visibly')])) })
expect(container.textContent).toContain('queue visibly')
expect(container.textContent).not.toContain('steer separately')
expect(container.querySelectorAll('button')).toHaveLength(2)
})
it('renders active actions and disables editing for mixed-content rows', () => {
const snap = snapshotWith([
row('i-1', '第一条排队消息'),