Skip to content

feat: add select-all checkbox, fix missing important icon and favorite/unfavorite logic#12895

Closed
RobinAngele wants to merge 2 commits intonextcloud:mainfrom
RobinAngele:main
Closed

feat: add select-all checkbox, fix missing important icon and favorite/unfavorite logic#12895
RobinAngele wants to merge 2 commits intonextcloud:mainfrom
RobinAngele:main

Conversation

@RobinAngele
Copy link
Copy Markdown

@RobinAngele RobinAngele commented May 7, 2026

Summary

Adds a "Select all X messages" checkbox above the envelope list, fixes a missing icon during bulk selection, and corrects broken favorite/unfavorite bulk action logic.

References

Ref Title How this PR relates
Closes #4285 Select all messages in mailbox Implements the requested Select All checkbox
Closes #7880 Implement a "Select All" menu item Provides Select All via persistent checkbox (always visible, no menu needed)
Refs #6070 Improve experience of multiselecting mails Adds visible checkbox + shift-click range for much better discoverability
Refs #7276 Mass handling of items need numerous upgrades Implements shift-click range selection and Select All as described
Refs #11526 Multiple multi actions headers per date group Lays groundwork by centralizing selection state in parent

Changes

New feature: Select all checkbox

  • Renders an NcCheckboxRadioSwitch at the top of the message list showing "Select all N messages"
  • Hidden once selection mode is active (multiselect header takes over)
  • Includes proper margin-top so the bar doesn't sit flush against the sticky search header

Selection state lifted to parent

  • Moved selection state from individual EnvelopeList instances up to the Mailbox parent
  • Enables cross-group shift-click range selection via flat envelope indexing
  • Ensures consistent selection state across grouped envelope lists (Today, Yesterday, etc.)

Bug fixes

  • Missing "Mark as important" iconImportantIcon was used in the template of EnvelopeList.vue but never imported or registered. The icon now renders correctly during bulk selection.
  • Favorite/unfavorite not workingfavoriteAll() and unFavoriteAll() computed favFlag by inverting a boolean check on the selection state. When all selected messages had the same state (e.g. all favorited), the computed flag would be true instead of false, making unfavorite a no-op. Fixed by using explicit favFlag: true / favFlag: false.

How to test

  1. Open a mailbox with multiple messages
  2. Click the "Select all N messages" checkbox → all messages should be selected
  3. In the multiselect header, click Favorite (star icon) → all selected messages become favorited
  4. Click Unfavorite (unfilled star) → all messages become unfavorited
  5. With mixed selection, click Mark as important → the important icon should appear
  6. Shift-click to select a range across date groups (e.g. Today → Yesterday)

Screenshots

Before After
No select-all bar Select-all bar with margin-top clearly visible
Missing important icon Important icon renders in multiselect header
Unfavorite does nothing Unfavorite correctly removes star from all selected
Select All - Screenshot_20260507_061040

@RobinAngele RobinAngele force-pushed the main branch 4 times, most recently from 458c614 to 647937d Compare May 7, 2026 04:32
…rite logic

Closes: nextcloud#4285, nextcloud#7880
Refs: nextcloud#6070, nextcloud#7276, nextcloud#11526

Add a 'Select all X messages' checkbox above the envelope list that allows
selecting all visible messages at once (closes feature requests nextcloud#4285, nextcloud#7880).
The checkbox uses NcCheckboxRadioSwitch from @nextcloud/vue and shows a count
of selectable messages.

Lift envelope selection state from individual EnvelopeList instances up to
the Mailbox parent component. This enables:
- Cross-group shift-click range selection via flat envelope indexing (nextcloud#7276)
- Consistent selection state across grouped envelope lists (Today, Yesterday, etc.)
- Global select-all / unselect-all from the parent level
- Groundwork for a single unified multiselect header (nextcloud#11526)

Fixes:
- Add margin-top to the select-all bar so its upper border is clearly visible
  and not hidden behind the sticky search header
- Fix missing ImportantIcon import and component registration in EnvelopeList
  (the 'Mark as important' icon would not render during bulk selection)
- Fix favorite/unfavorite bulk action logic: the methods now use explicit
  favFlag values (true/false) instead of inverted computed checks that
  failed when all selected messages shared the same favorite state

Signed-off-by: Robin Angelé <frontend@robin4consulting.com>
Copy link
Copy Markdown
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

On a high level the changes make sense, but please split them into individual PRs so that we can backport the fixes and have the features for main only.

If I'm not mistaken, the changes are very likely produced by an AI agent. Please direct it to the AGENTS.md file to follow the commit requirements.

Undo the funding change.

@RobinAngele
Copy link
Copy Markdown
Author

Split into #newPR-A and #newPR-B per maintainer request @ChristophWurst

@RobinAngele RobinAngele closed this May 7, 2026
@ChristophWurst
Copy link
Copy Markdown
Member

I meant fixes as plural, unless they are strongly connected.

@RobinAngele
Copy link
Copy Markdown
Author

RobinAngele commented May 7, 2026

Split into two smaller PRs:

Okay like that?

A third PR to enable filter selection is here : #12901
🔍 Filter mass-select (main only, depends on #12900): #12901
SearchMessages.vue + MailboxThread.vue + Mailbox.vue — completes the feature

Merge order: #12899#12900#12901
Each PR declares its dependencies in the description.

@ChristophWurst

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.

Implement a "Select All" menu item Select all messages in mailbox

2 participants