Skip to content

fix(selection): deselect marks without clearing the filter - #317

Closed
itsmunzir wants to merge 1 commit into
thisisgm:mainfrom
itsmunzir:fix/deselect-all
Closed

itsmunzir wants to merge 1 commit into
thisisgm:mainfrom
itsmunzir:fix/deselect-all

Conversation

@itsmunzir

@itsmunzir itsmunzir commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Clearing marks had no standalone action: Escape also handles dismissing filters and search. Add Deselect all on Ctrl+Shift+A next to Select all in the listing menu and action sheet, using the existing selection-clear method without changing the filter, search or cursor.

The GUI already supports Invert selection on V. Wire both selection actions into the TUI too, and cover mixed selections with and without a filter. Update the current keyboard reference and generated keymap.

Verified:

  • New keymap regression against base 4c7b27b: ./tests/js.sh keymap fails 25 checks before the fix.
  • ./tests/js.sh: 15,661 standard checks, 4 Edmonton checks and 13 DST checks passed; the runner also logs QML fixture warnings.
  • cargo test --locked and cargo test --release --locked (Rust 1.98.1): passed, including both new TUI action tests.
  • cargo build --locked: passed.
  • ./tests/keymap-gen.sh and ./tools/flea-file-budget: passed.
  • FLEA_FIXTURE_ROOT=/tmp/flea164 ./tests/sheet-query.sh: passed 74 sheet checks and 33 real-pane checks.

./tests/startup-objects.sh is red on my machine on both base and this branch (719 objects against the 605 baseline), so it is unrelated to this change. The 180-unit source inventory matches the updated 1,774,115-byte pin. I did not run a native-input smoke test or the full run-all battery.

Fixes #164

Summary by CodeRabbit

  • New Features
    • Added Deselect all, available from the background menu and with Ctrl+Shift+A in the listing.
    • Added Invert selection with V to toggle selection for visible rows; rows outside an active filter remain unchanged.
    • Deselecting or inverting preserves the current filter, search query, and cursor.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce3e272a-a79f-4d2a-82b5-1769b6cc3c0c
📥 Commits

Reviewing files that changed from the base of the PR and between 9dbd11c and fc840ac.

📒 Files selected for processing: 4
  • AGENTS.md
  • README.md
  • tests/startup-units-off.txt
  • tests/startup-units.txt
🚧 Files skipped from review as they are similar to previous changes: 1
  • tests/startup-units.txt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The TUI and GUI add a dedicated deselect-all action. The TUI also implements invert selection. Keyboard shortcuts, key sheets, and the background menu expose the actions, with tests and documentation updated.

Changes: Selection actions

Layer / File(s) Summary
Implement and validate selection actions
src/tui/actions.rs, ui/js/Focus.js, src/tui/selection_tests.rs, src/tui/wire.rs, tests/js/marks.js
The TUI clears selection or inverts rows across all rows when unfiltered and shown rows when filtered. The GUI action dispatcher clears selection, and GUI tests cover deselecting and inverting drawn marks. Tests check that view state remains unchanged.
Expose actions through shortcuts and menus
keys.toml, ui/js/Keymap.js, ui/js/Menu.js, src/tui/keymap.rs, src/tui/keymap_tests.rs, tests/js/keymap.js, tests/js/menu.js, README.md, AGENTS.md, tests/startup-units*.txt, tools/flea-file-budget
Keymaps expose deselect all and invert selection, and the background menu adds Deselect all. Tests check bindings, menu behavior, and key-sheet entries. The README documents the actions; recorded startup totals and file ceilings are updated.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Keymap
  participant ActionDispatcher
  participant Selection
  Keymap->>ActionDispatcher: Resolve and dispatch selection action
  ActionDispatcher->>Selection: Clear selection or invert drawn rows
Loading

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to fc840

Deselect and invert remain available in the listing UI, including within filtered rows; no identified behavior change is expected to disrupt users.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 11 files. (4 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the primary change: adding deselection without clearing the active filter.
Linked Issues check Passed Issue #164 requires a separate deselect action and an invert-selection action. The PR adds deselectAll on Ctrl+Shift+A in the GUI and TUI, and it uses the existing selection-clear path without chang…
Out of Scope Changes check Passed The changes support Issue #164. They update action dispatch, keymaps, menus, keyboard documentation, generated keymap data, and GUI and TUI regression tests. The byte pins and file-budget updates supp…
Full details: Linked Issues check

Explanation

Issue #164 requires a separate deselect action and an invert-selection action. The PR adds deselectAll on Ctrl+Shift+A in the GUI and TUI, and it uses the existing selection-clear path without changing filter, search, or cursor state. The PR wires invertSelection into the TUI and limits inversion to the rows shown by the active filter. GUI and TUI regression tests cover filtered and unfiltered selection states. The issue's dedicated clear-filter action is optional wording, not a required coding objective.

Full details: Out of Scope Changes check

Explanation

The changes support Issue #164. They update action dispatch, keymaps, menus, keyboard documentation, generated keymap data, and GUI and TUI regression tests. The byte pins and file-budget updates support the changed source and test files. No unrelated product behavior is established by the supplied change summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 11 files. (4 skipped: 4 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thisisgm

thisisgm commented Nov 3, 2026

Copy link
Copy Markdown
Owner

The terminal interface lacked a standalone selection-clear action. The terminal interface can clear its selection without clearing the filter (2b087a04cd, v0.4.0). Further requested work is recorded for a later release: the GUI selection-clear action. Thanks @itsmunzir! Release.

@thisisgm thisisgm closed this Nov 3, 2026
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.

Add "deselect all" and "invert selection" actions (avoids interfering with other ESC actions like filter clearing)

2 participants