Skip to content

feat(windows): pinned cards + self-compact settings#117

Open
Aryansharma28 wants to merge 1 commit into
feat/windows-channels-followup-part1from
feat/windows-pinned-and-self-compact
Open

feat(windows): pinned cards + self-compact settings#117
Aryansharma28 wants to merge 1 commit into
feat/windows-channels-followup-part1from
feat/windows-pinned-and-self-compact

Conversation

@Aryansharma28

Copy link
Copy Markdown
Contributor

Summary

Two macOS-side features that landed in late May / early June and were
missed by the Phase 7 parity audit (which focused on the chat surface,
not board/orchestrator additions). Targets PR #115's branch so it
lands as part of the Part 1 follow-up bundle, not directly on `main`.

Pinned cards

  • `Link` grows `pinned_at` + `pinned_sort_order`, byte-compatible with macOS
  • New Pinned strip above the columns with horizontal drag-reorder
  • Pinned cards hidden from their real lane (mirrors macOS `unpinnedCards(in:)`)
  • Context menu: Pin to top / Unpin from top; gold pin glyph by the title
  • Archive + move-to-all-sessions clear the pin
  • `merge_ops` inherits the pin from source when target wasn't pinned

Self-compact (data shapes + stale-nudge drop guard)

  • `SelfCompactSettings` / `SelfCompactRule` / `SelfCompactAction` with the same defaults as macOS (500k/600k/700k queue, 750k `/compact`)
  • `QueuedPrompt.selfCompactThresholdTokens` so the guard can tell auto-nudges apart from manual prompts
  • New `context_usage.rs` reads `<data_dir>/context/.json` (same statusline shape as macOS)
  • New `should_drop_self_compact_prompt` command runs the macOS `shouldDropStaleSelfCompactPrompt` logic
  • Wired into `CardDetailView`'s hook-driven auto-send path so a compact nudge the user already addressed gets dropped instead of sent
  • SettingsView gets an enable toggle + read-only threshold summary

Verify

  • `cd windows && npm run build` — green
  • `cd windows/src-tauri && cargo build` — green (only pre-existing warnings)
  • `cargo test` — 58 passed, 0 failed

Out of scope (deliberate, follow-up issues recommended)

  • Self-compact polling/generation loop — actually enqueueing compact nudges when context usage crosses a threshold. Requires the Claude Code statusline to be emitting `<data_dir>/context/.json` first; that statusline plumbing doesn't exist on Windows yet. Once it lands, this PR's drop guard + data shapes are ready.
  • Channel reorder — the macOS commit bundled "channels + pinned reorder"; only pinned is ported here. Channel reorder is a smaller follow-up.

Test plan

  • Right-click any card → Pin to top → appears in Pinned strip with gold pin glyph
  • Right-click pinned card → Unpin from top → returns to its real lane
  • Drag-reorder within the Pinned strip → order persists across refresh
  • Pin a card, then archive it → pin clears, card lands in All Sessions
  • Merge an unpinned card into a pinned one → target stays pinned in same slot
  • Merge a pinned card into an unpinned one → target inherits the pin
  • Toggle Self-compact in General Settings → toggle persists
  • (manual) Drop the file `\kanban-code\context<sessionId>.json` with a sub-threshold reading; queue a prompt with `selfCompactThresholdTokens` set; trigger a Stop hook → prompt is dropped, not sent

🤖 Generated with Claude Code

Two macOS-side features from late May/early June that were missed in the
Phase 7 parity audit. Both ride into the Part 1 follow-up branch.

Pinned cards (mirrors macOS Sources/.../BoardStore + BoardView):
- Adds pinned_at / pinned_sort_order to Link, byte-compatible with the
  macOS JSON shape. Archive/move-to-all-sessions clear the pin.
- Adds set_card_pinned + reorder_pinned_cards Tauri commands.
- Adds a Pinned strip above the columns in BoardView with horizontal
  drag-reorder. Pinned cards are hidden from their real lane so they
  don't double-render.
- Right-click "Pin to top" / "Unpin from top" in the card context menu;
  pinned cards show a small gold pin glyph next to the title.
- merge_ops inherits the pin from source when target wasn't pinned.

Self-compact (data shapes + drop-guard, mirrors macOS SelfCompactSettings):
- New SelfCompactSettings struct with byte-compatible defaults (500k/
  600k/700k queueing, 750k /compact).
- QueuedPrompt grows a selfCompactThresholdTokens field so the guard
  can distinguish auto-enqueued nudges from manual prompts.
- New context_usage.rs reads <data_dir>/context/<sessionId>.json (the
  statusline-emitted file, same path layout as macOS).
- New should_drop_self_compact_prompt command runs the macOS
  shouldDropStaleSelfCompactPrompt logic. Wired into the
  CardDetailView auto-send path so a compact nudge that the user
  already addressed gets dropped instead of sent.
- SettingsView gets a Self-compact toggle plus a read-only summary of
  the configured thresholds.

Out of scope here (each deserves its own PR):
- Polling/generation loop that *enqueues* compact prompts when usage
  crosses a threshold. Needs the statusline script to emit the
  context-usage JSON in the first place — no plumbing on Windows yet.
- Channel reorder (the macOS commit bundled "channels + pinned" — only
  pinned ported here).
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