Skip to content

Support batching tasks/notes to assistant with Ctrl+click staging - #25

Merged
utorque merged 1 commit into
mainfrom
claude/pin-assistant-button-notes-3jckq3
Jul 23, 2026
Merged

Support batching tasks/notes to assistant with Ctrl+click staging#25
utorque merged 1 commit into
mainfrom
claude/pin-assistant-button-notes-3jckq3

Conversation

@utorque

@utorque utorque commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

Extended the "Work on this with the assistant" feature to support staging multiple tasks and notes before opening the assistant, rather than immediately switching tabs. Users can now Ctrl/Cmd+click robot buttons on board cards and note rows to stage items into a queue, then open the assistant once to process them all together.

Key Changes

  • Queue-based pinning: Replaced single assistantPinnedTask localStorage key with assistantPinQueue array supporting multiple items of kind 'task' or 'note'
  • Ctrl+click staging: Modified robot button handlers to accept a stay parameter; plain clicks pin and switch tabs, Ctrl/Cmd+clicks stage without navigating
  • Visibility-aware delivery: Added assistantVisible() check in the bridge to only drain the queue when the assistant iframe is actually on-screen, preventing early delivery of background-staged items
  • Pin badge: Added a coral-colored count badge on the Assistant tab showing how many items are staged, cleared when the bridge delivers them
  • Note row support: Extended pinning to note rows in the Notes view with matching UI/UX to board card buttons
  • Backend batching: Updated on_window_message handler to support new simpler-pin message type with array of refs, while maintaining backward compatibility with legacy simpler-pin-task
  • New on_pin_refs() function: Processes batches of task/note references, injecting context for each and seeding the composer with all refs at once

Implementation Details

  • The queue persists in localStorage across page reloads, allowing users to stage items, reload, and still have them waiting
  • Storage events trigger immediate delivery when the assistant becomes visible, ensuring no race conditions
  • The bridge re-posts the batch every 500ms until the backend responds with a prefill, accommodating cold iframe startup
  • Composer seeds use #id for tasks (matching starters) and note #id for notes (for clarity in mixed batches)
  • CSS styling mirrors the board card button design with hover effects and active state handling

https://claude.ai/code/session_01YJMPjXGqtmikQgaHFHv9Vi

The robot button that hands a task to the assistant now lives on note rows
too, and both buttons support gathering several items before switching over.

- Ctrl/Cmd+click a robot button stages the task/note without opening the
  assistant, so multiple tasks and/or notes can be queued, then delivered
  together when the user comes over. A plain click still pins and switches.
- Pins accumulate in a localStorage queue (assistantPinQueue) instead of a
  single key. The bridge drains it only while the assistant iframe is
  visible, so background staging never delivers early, and posts one
  `simpler-pin` batch of {kind, id} refs.
- Backend on_pin_refs injects each item's context block (task + linked note,
  or full note content) and seeds the composer with all refs. The legacy
  single-task path is kept for older bridge builds.
- The Assistant nav tab shows a small count badge of staged items, kept in
  sync via a storage event when the bridge clears the queue.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJMPjXGqtmikQgaHFHv9Vi
@utorque
utorque merged commit 7d748b1 into main Jul 23, 2026
2 checks passed
@utorque
utorque deleted the claude/pin-assistant-button-notes-3jckq3 branch July 23, 2026 09:25
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.

2 participants