Skip to content

feat(browser): add optional checkbox selection for multiple items - #955

Open
JoeJoeflyn wants to merge 15 commits into
mainfrom
feat/937-checkbox-selection
Open

JoeJoeflyn wants to merge 15 commits into
mainfrom
feat/937-checkbox-selection

Conversation

@JoeJoeflyn

@JoeJoeflyn JoeJoeflyn commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Description

Add a saved Checkbox selection switch under Settings → BROWSING, off by default. When enabled, each List view row shows a checkbox, plus a "select all" checkbox in the header. Clicking a row checkbox selects/deselects that item; clicking the header checkbox selects/deselects all. The header shows an inconsistent (dash) state when some but not all items are selected.

Checkboxes drive the existing gtk::MultiSelection model, so marquee, Ctrl+A, keyboard, and checkbox selection all stay in sync. A guard prevents the select_all checkbox's programmatic state updates from re-triggering selection changes (re-entrancy loop). Marquee origin surfaces now treat CheckButton as interactive chrome so clicks reach the checkbox instead of starting a drag. Selection changes (including Esc clearing) sync checkbox state even when the selection_changed handler is suppressed by the syncing guard.

This is off by default to preserve the existing modifier-based selection flow for power users.

Visual evidence

screenrecording-2026-09-13_23-43-34.mp4

How to test

  1. Open Settings → BROWSING, turn Checkbox selection on.
  2. Switch to List view (Ctrl+3). Each row should show a checkbox on the left, plus a "select all" checkbox in the header.
  3. Click individual row checkboxes to select/deselect items.
  4. Click the header "select all" checkbox to select/deselect all. Rows should show the accent highlight color.
  5. Select some but not all items — the header checkbox should show an inconsistent (dash) state.
  6. Press Ctrl+A — checkboxes and highlight should sync.
  7. Drag marquee — checkboxes should sync.
  8. Press Esc — all checkboxes and selection should clear.
  9. Toggle the pref off — checkboxes should hide.

Expected result: With the toggle on, checkboxes appear on every List row and the header. They stay in sync with all selection methods. The choice persists across restarts.

Related issue

Closes #937

Add Move to Trash and Permanently delete to the chooser item context
menu, gated by the same can_trash_at/can_delete_at visibility rules as
the main browser. Wire Delete and Shift+Delete keyboard shortcuts through
the existing confirm_delete path. Reuses context_entries, the visibility
helpers, and request_delete from the main browser context menu.
Add a persisted preference (off by default) that renders a checkbox on
each List view row plus a "select all" checkbox in the header. Toggling
the preference live shows/hides the checkboxes via ThemeManager binding.

- Checkboxes drive the existing gtk::MultiSelection model, so marquee,
  Ctrl+A, keyboard, and checkbox selection all stay in sync.
- A guard prevents the select_all checkbox's programmatic state updates
  from re-triggering selection changes (re-entrancy loop).
- Marquee origin surfaces now treat CheckButton as interactive chrome
  so clicks reach the checkbox instead of starting a drag.
- Selection changes (including Esc clearing) sync checkbox state even
  when the selection_changed handler is suppressed by the syncing guard.

Closes #937
@blacksmith-sh

This comment has been minimized.

- Fix exhaustive preference setter test to cover checkbox_selection
- Fix column width and pointer control tests to skip the select_all
  checkbox when iterating heading children
- Style checkboxes with semantic theme colors: accent for checked,
  semi-transparent accent for indeterminate, subtle border for unchecked
@wmfeht

wmfeht commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Blocker: the new Settings row is not registered for Settings search.

settings_option tags rows from settings/search.rs TARGETS by exact title. There is no TARGET for Checkbox selection, so search::tag is a no-op.

Searching Settings for "checkbox" / "checkbox selection" returns no matches. Untagged rows also stay visible when a sibling in the same BROWSING group matches, so a query like "Folder peeking" still shows this switch.

docs/preferences.md requires new settings to be registered in settings/search.rs. Please add a TARGET (id e.g. checkbox-selection, aliases for checkbox / multi-select / list) so the row gets a settings-search-* name.

@JoeJoeflyn

Copy link
Copy Markdown
Collaborator Author

Addressed the Settings search blocker in b17744c: registered Checkbox selection with checkbox/multi-select/list aliases and added coverage for direct matches plus sibling filtering.

@archisman-panigrahi

Copy link
Copy Markdown

This is already good. However, Windows file explorer and Dolphin (in KDE) also provide this feature in all views (the checkbox shows up after hovering with mouse in other views). It would also be nice to have.

@JoeJoeflyn

Copy link
Copy Markdown
Collaborator Author

@archisman-panigrahi sure, ill take a look at how they implemented on those apps

@archisman-panigrahi

Copy link
Copy Markdown

sure, ill take a look at how they implemented on those apps

You can also look at this merge request of thunar

@JoeJoeflyn

Copy link
Copy Markdown
Collaborator Author

still working on this

@blacksmith-sh

This comment has been minimized.

…labels

The optional selection checkbox is prepended to each Columns row, so code
that assumed the row's first child is the thumbnail icon stopped finding
the overlay that hosts the rename editor and the size label. Route those
lookups through the existing column_row_icon helper, which already skips
the checkbox, and update the saved-preferences fixtures for the new
Checkbox selection switch.
@JoeJoeflyn
JoeJoeflyn force-pushed the feat/937-checkbox-selection branch from 5daa323 to a9ae287 Compare September 16, 2026 11:45
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 checkboxes to select multiple items

3 participants