Skip to content

fix(ui): select a range on shift click of compact checkbox - #14295

Open
lazerg wants to merge 1 commit into
nextcloud:mainfrom
lazerg:fix/issue-14287-compact-shift-select
Open

lazerg wants to merge 1 commit into
nextcloud:mainfrom
lazerg:fix/issue-14287-compact-shift-select

Conversation

@lazerg

@lazerg lazerg commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Context

Closes #14287

In compact mode, shift clicking a message's checkbox only toggled that message instead of selecting the range from the last selected one. The checkbox wrapper stops click propagation, so the envelope's shift click handler never ran.

Approach

The wrapper now catches shift clicks in the capture phase and emits selectMultiple, the same event the avatar wrapper uses outside compact mode. Stopping the event there also keeps the checkbox from toggling the clicked message on its own. Plain clicks on the checkbox work as before.

Testing

Added a unit test that shift clicks the compact checkbox and expects selectMultiple without update:selected. It fails without the fix. Not tested on a live instance. To check manually: enable compact mode, click the checkbox of the first message, then shift click the checkbox of the third one. All three should be selected.

AI assistance

Assisted by ClaudeCode:claude-opus-5-5

The compact mode checkbox wrapper stops click propagation, so a shift
click never reached the envelope's range selection handler and the
checkbox toggled only the clicked message. Handle shift clicks on the
wrapper in the capture phase before the checkbox toggles.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: lazerg <lazerg2@gmail.com>
@ChristophWurst

Copy link
Copy Markdown
Member

Thanks for the patch, @lazerg

Not tested on a live instance.

Please do that and report the testing results. Thanks!

@lazerg

lazerg commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

I tested it on Nextcloud 33.0.11 with Mail built from this branch, compact mode on and a local IMAP inbox of 30 messages. With the patch, clicking one checkbox and then shift-clicking one four rows below selects all five; without it, the shift-click only toggles that one message. Plain and Cmd clicks still toggle a single message and don't open it, same as before.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compact-Mode: Checkbox breaks range selection with Shift key

2 participants