Commit Graph

4 Commits

Author SHA1 Message Date
teernisse
d4b8a4baea feat(bd-318): implement QueueView container with filtering and batch support
QueueView now supports:
- Filtering items via CommandPalette (Cmd+K)
- Hide snoozed items by default (showSnoozed prop)
- Show snooze count indicator when items are hidden
- Support batch mode entry for sections with 2+ items
- Filter by type prop for programmatic filtering

Added snoozedUntil field to FocusItem type and updated fixtures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 11:00:16 -05:00
teernisse
29b44f1b4c fix: patch memory leaks in event hooks and strengthen type guard
Fix three bugs found during code review:

1. useTauriEvent/useTauriEvents: If the component unmounts before the
   async listen() promise resolves, the unlisten function was lost,
   leaking the event subscription. Added a cancelled flag to call
   unlisten immediately when the promise resolves after cleanup.

2. useTauriEvents: The handlers object was used directly as a useEffect
   dependency, causing re-subscription on every render when callers
   pass an inline object literal. Replaced with a useRef for handler
   stability and a derived eventNames string as the dependency.

3. isMcError type guard: Only checked property existence via 'in'
   operator, not property types. An object with wrong-typed properties
   (e.g. code: 42) would pass the guard. Now validates that code and
   message are strings and recoverable is boolean.

4. AppShell global shortcut listener: Same race condition as (1), plus
   missing .catch() on the listen promise could produce unhandled
   rejections.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 10:13:17 -05:00
teernisse
175c1994fc feat: implement Inbox view with triage actions
- Add InboxItem types and TriageAction/DeferDuration types
- Create Inbox component with:
  - Accept/Defer/Archive actions for each item
  - Keyboard shortcuts (A/D/X) for fast triage
  - Defer duration picker popup
  - Inbox Zero celebration state
  - Type-specific badges with colors
- Add comprehensive tests for all functionality

Closes bd-qvc

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 10:08:54 -05:00
teernisse
e01e93f846 feat: add frontend TypeScript types and IPC layer
Establishes type-safe communication between React frontend and Rust backend.
Types mirror the Rust structs to ensure consistency across the Tauri boundary.

Type definitions (src/lib/types.ts):
- LoreStatus, LoreSummaryStatus: Lore CLI response shapes
- BridgeStatus, SyncResult: Bridge operation results
- McError, McErrorCode: Structured error handling with type guard
- FocusItem, FocusItemType: THE ONE THING work items
- FocusAction, DecisionEntry: User action tracking
- Staleness computation: fresh/normal/amber/urgent based on age

IPC wrapper (src/lib/tauri.ts):
- Typed invoke() calls for each Rust command
- getLoreStatus, getBridgeStatus, syncNow, reconcile, quickCapture

Data transformation (src/lib/transform.ts):
- transformLoreData: Converts lore response to FocusItem[]
- Priority ordering: reviews first (blocking others), issues, authored MRs
- Generates stable IDs matching bridge mapping keys

Formatting utilities (src/lib/format.ts):
- formatIid: Prefix with ! for MRs, # for issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 09:54:24 -05:00