Skip to content

Add Quick Actions feature (Quick Chat + Bash tabs)#64

Merged
mcintyre94 merged 1 commit intomainfrom
side-chat-feature-for-wisp-05453dfb
Mar 15, 2026
Merged

Add Quick Actions feature (Quick Chat + Bash tabs)#64
mcintyre94 merged 1 commit intomainfrom
side-chat-feature-for-wisp-05453dfb

Conversation

@mcintyre94
Copy link
Copy Markdown
Owner

@mcintyre94 mcintyre94 commented Mar 11, 2026

Summary

  • Replaces the experimental SideChat with a polished Quick Actions sheet, accessible from the Chat toolbar and Sprite context/swipe actions
  • Two tabs: Quick Chat (Claude via claude -p, streaming NDJSON) and Bash (streaming command execution via streamService)
  • Bash output can be inserted into the chat input as a fenced code block
  • Fixes stream cancellation bug caused by QuickActionsViewModel being recreated on parent re-renders — now stored in @State and presented via .sheet(item:)

Test plan

  • Open a Sprite, tap the bolt toolbar button in Chat — Quick Actions sheet opens on Quick Chat tab
  • Ask a question in Quick Chat — response streams in correctly, user question shown above
  • Switch to Bash tab, run a command — output streams in with > command prompt shown
  • Tap "Insert into chat" in Bash — inserts formatted fenced code block, dismisses sheet
  • Long-press Sprite in dashboard or swipe — "Quick Actions" context menu entry opens sheet
  • Open sheet, start a Quick Chat stream, tap Done — stream cancels cleanly
  • Verify stream does not cancel mid-response when sprite status polling fires

🤖 Generated with Claude Code

@claude
Copy link
Copy Markdown

claude bot commented Mar 11, 2026

test

@claude
Copy link
Copy Markdown

claude bot commented Mar 11, 2026

Missing unit tests

File: Wisp/ViewModels/SideChatViewModel.swift (line 1)

SideChatViewModel is a new view model with non-trivial logic — including send() guard conditions (empty/whitespace trimming, streaming guard), the handle(_:) event dispatch (text accumulation, error detection), and cancel() state management — but no unit tests were added.

Per CLAUDE.md: "Add new unit tests when adding or modifying logic (models, parsers, utilities, view models)"

Please add a WispTests/SideChatViewModelTests.swift covering at least the send() guard conditions, cancel() behaviour, and handle(_:) event processing.

@claude
Copy link
Copy Markdown

claude bot commented Mar 11, 2026

Missing private(set) on view-read-only properties

File: Wisp/ViewModels/SideChatViewModel.swift (lines 14–16)

response, isStreaming, and error are only ever read by SideChatView — never set directly from the view. They should be private(set).

Per CLAUDE.md: "Use private(set) for properties that views only need to read, not set directly."

This is the same convention applied to ChatViewModel.sessionId in this very PR.

    private(set) var response = ""
    private(set) var isStreaming = false
    private(set) var error: String?

@claude
Copy link
Copy Markdown

claude bot commented Mar 11, 2026

isRunningOnMac should be a shared helper

File: Wisp/Views/SpriteDetail/Chat/SideChatView.swift (lines 89–95)

This is a local copy of the same isRunningOnMac implementation that already exists in ChatInputBar. Per CLAUDE.md: "A safe isRunningOnMac helper should return true in either case by combining the compile-time and runtime checks." — implying a shared utility, not per-view re-implementation.

Please extract this to a shared location (e.g. Wisp/Utilities/PlatformHelpers.swift or an extension) so both ChatInputBar and SideChatView use the same definition.

@mcintyre94 mcintyre94 marked this pull request as draft March 14, 2026 18:16
@mcintyre94 mcintyre94 changed the title Add side chat feature Add Quick Actions feature (Quick Chat + Bash tabs) Mar 14, 2026
@mcintyre94 mcintyre94 marked this pull request as ready for review March 14, 2026 22:09
@mcintyre94 mcintyre94 force-pushed the side-chat-feature-for-wisp-05453dfb branch 2 times, most recently from fcdc000 to c89f7cc Compare March 14, 2026 23:56
Replaces the experimental SideChat with a polished Quick Actions sheet
accessible from both the Chat toolbar and Sprite context menu. Features
two tabs: Quick Chat (Claude via claude -p) and Bash (streaming command
execution via streamService). Fixes stream cancellation caused by VM
recreation on parent re-renders by using .sheet(item:) with Identifiable
view model stored in @State.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mcintyre94 mcintyre94 force-pushed the side-chat-feature-for-wisp-05453dfb branch from c89f7cc to d8bbe76 Compare March 15, 2026 00:10
@mcintyre94 mcintyre94 merged commit 87a41c3 into main Mar 15, 2026
2 checks passed
@mcintyre94 mcintyre94 deleted the side-chat-feature-for-wisp-05453dfb branch March 15, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant