Dashboard and Search Improvements #6

Closed
clanker wants to merge 0 commits from fix/dashboard-search-improvements into master
Owner

Fixes

5. DashboardPanel uses correct section query context

Previously open_current_thread() always used self.queries[0][1] (the first section's query) regardless of which section the selected thread belongs to. Now looks up the correct section header for the row and uses its associated SearchModel.q. This fixes search-highlighting in thread view for non-first dashboard sections.

6. Dashboard refresh debouncing

Full dashboard refreshes spawn N notmuch search calls (one per section). On rapid tag changes, this could queue dozens of redundant subprocess calls. Added a 500ms debounce timer via update_thread() so refreshes coalesce.

9. SearchPanel selection restoration by thread ID

SearchPanel.refresh() previously saved the current row number and tried to restore it after model reset. If threads were deleted or added, the row could point to a different thread. Now restores by thread_id lookup in model.threads dict, with fallback to first row.

Removed the now-unused snapshot_index() and restore_index() helper methods.

Files Changed

  • dodo/dashboard.py: Section query lookup, debounce timer, QTimer import
  • dodo/search.py: Thread-ID-based selection restoration, remove dead helpers

Testing

  • Open a thread from dashboard section 2/3 → correct query context in thread view
  • Rapidly tag threads in dashboard → single refresh instead of N
  • Delete a thread in search panel → selection stays on a valid thread
## Fixes ### 5. DashboardPanel uses correct section query context Previously `open_current_thread()` always used `self.queries[0][1]` (the first section's query) regardless of which section the selected thread belongs to. Now looks up the correct section header for the row and uses its associated `SearchModel.q`. This fixes search-highlighting in thread view for non-first dashboard sections. ### 6. Dashboard refresh debouncing Full dashboard refreshes spawn N `notmuch search` calls (one per section). On rapid tag changes, this could queue dozens of redundant subprocess calls. Added a 500ms debounce timer via `update_thread()` so refreshes coalesce. ### 9. SearchPanel selection restoration by thread ID `SearchPanel.refresh()` previously saved the current row number and tried to restore it after model reset. If threads were deleted or added, the row could point to a different thread. Now restores by `thread_id` lookup in `model.threads` dict, with fallback to first row. Removed the now-unused `snapshot_index()` and `restore_index()` helper methods. ## Files Changed - `dodo/dashboard.py`: Section query lookup, debounce timer, QTimer import - `dodo/search.py`: Thread-ID-based selection restoration, remove dead helpers ## Testing - Open a thread from dashboard section 2/3 → correct query context in thread view - Rapidly tag threads in dashboard → single refresh instead of N - Delete a thread in search panel → selection stays on a valid thread
- DashboardPanel.open_current_thread() now looks up the correct section
  query from the model instead of always using queries[0][1] (#5)

- Add 500ms debounce timer to DashboardPanel.refresh() via
  update_thread() to avoid running N notmuch search calls on rapid
  tag changes (#6)

- SearchPanel.refresh() now restores selection by thread_id lookup
  instead of by row position, preventing selection drift when
  threads are added/removed between refreshes (#9)

- Remove now-unused snapshot_index() and restore_index() helpers
RulyTafzil closed this pull request 2026-07-24 20:37:12 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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
Home/lazarus!6
No description provided.