fix: Start bulk selection from the open message #3

Merged
exler merged 2 commits from fix/bulk-selection-anchor into main 2026-10-16 23:10:05 +02:00
Collaborator

Summary

Fixes the Obsidian report Bulk selection does not start with the selected item.

Starting bulk selection ignored the open message, and a stale lastChecked anchor could survive selection resets and navigation. Ctrl/Cmd-click now includes the currently open message and clicked row; a fresh selection derives its range anchor from the open message only when it is in the current list. Checkbox clicks remain independent and subsequent Ctrl/Cmd toggles and Shift ranges are preserved.

Verification

  • Browser fixture executes actual main.ts handlers: 11 regression scenarios passed (original code: 7 failed), covering Ctrl toggle, Shift range, checkbox, ordinary click, no open message, stale/missing item, sort and folder changes.
  • Independently rerun: bun run test, bun run build, bun run lint, git diff --check origin/main...HEAD — all passed.
  • Uses disposable in-memory Tauri API mocks; no real mailbox or account data.

Scope / risk

Small selection-state change only. Separate from the bulk context-menu fix. No deployment or Obsidian note edits.

Merge conflict resolution

Merged current main (including PR #2) without rewriting branch history. Resolved the package.json test-command conflict by running both browser suites; the bulk-anchor shell runner now visits only its fixture because the context-menu fixture requires its dedicated Vite configuration.

Verified after integration: bun run test (11 selection scenarios and 21 context-menu checks passed), bun run build, bun run lint (19 files), and git diff --cached --check all passed.

## Summary Fixes the Obsidian report **Bulk selection does not start with the selected item**. Starting bulk selection ignored the open message, and a stale lastChecked anchor could survive selection resets and navigation. Ctrl/Cmd-click now includes the currently open message and clicked row; a fresh selection derives its range anchor from the open message only when it is in the current list. Checkbox clicks remain independent and subsequent Ctrl/Cmd toggles and Shift ranges are preserved. ## Verification - Browser fixture executes actual main.ts handlers: **11 regression scenarios passed** (original code: 7 failed), covering Ctrl toggle, Shift range, checkbox, ordinary click, no open message, stale/missing item, sort and folder changes. - Independently rerun: `bun run test`, `bun run build`, `bun run lint`, `git diff --check origin/main...HEAD` — all passed. - Uses disposable in-memory Tauri API mocks; no real mailbox or account data. ## Scope / risk Small selection-state change only. Separate from the bulk context-menu fix. No deployment or Obsidian note edits. ## Merge conflict resolution Merged current main (including PR #2) without rewriting branch history. Resolved the package.json test-command conflict by running both browser suites; the bulk-anchor shell runner now visits only its fixture because the context-menu fixture requires its dedicated Vite configuration. Verified after integration: `bun run test` (11 selection scenarios and 21 context-menu checks passed), `bun run build`, `bun run lint` (19 files), and `git diff --cached --check` all passed.
Ctrl/Cmd-clicking a row while a message is open now checks the open
message together with the clicked one, and Shift-click ranges from it.
A new selection also drops any stale anchor left over from an earlier
selection, folder or sort order.

Adds a headless-browser regression (bun run test) that drives the real
row handlers against a mocked Tauri IPC fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
exler merged commit c3623e7b82 into main 2026-10-16 23:10:05 +02:00
exler deleted branch fix/bulk-selection-anchor 2026-10-16 23:10:05 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
exler/ambassador!3
No description provided.