Skip to content

fix: correct favorite/unfavorite bulk action logic#12899

Merged
ChristophWurst merged 1 commit intonextcloud:mainfrom
RobinAngele:fix/important-icon-and-favorite
May 8, 2026
Merged

fix: correct favorite/unfavorite bulk action logic#12899
ChristophWurst merged 1 commit intonextcloud:mainfrom
RobinAngele:fix/important-icon-and-favorite

Conversation

@RobinAngele
Copy link
Copy Markdown

@RobinAngele RobinAngele commented May 7, 2026

Refs #12149

Changes

Favorite/unfavorite logic

  • Rename methods: favoriteAll()unfavoriteAll(), unFavoriteAll()favoriteAll()
  • Use explicit favFlag: true / favFlag: false instead of inverted computed checks (!this.isAtLeastOneSelectedX)
  • Previously, when all selected messages shared the same state (e.g. all favorited), clicking "Unfavorite" computed favFlag = true (no-op). Now it always passes the correct flag.

How to test

  1. Select all favorited messages → click "Unfavorite" → all become unfavorited
  2. Select all unfavorited messages → click "Favorite" → all become favorited
  3. Repeat with mixed selection (some favorite, some not)

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced multiselect favorite and unfavorite controls. The "Favorite" button now reliably marks all selected items as favorites, while the "Unfavorite" button marks them as unfavorites. Selection is automatically cleared after each action. The updated controls provide more predictable and consistent behavior when managing multiple items.

@welcome
Copy link
Copy Markdown

welcome Bot commented May 7, 2026

Thanks for opening your first pull request in this repository! ✌️

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@ChristophWurst
Copy link
Copy Markdown
Member

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 56e553aa-5eb1-464a-a53f-469a0d6c1baf

📥 Commits

Reviewing files that changed from the base of the PR and between 4c789a8 and fcb160a.

📒 Files selected for processing (1)
  • src/components/EnvelopeList.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/EnvelopeList.vue

📝 Walkthrough

Walkthrough

The EnvelopeList component's favorite/unfavorite logic is refactored to use two explicit methods with fixed flag values. A new unfavoriteAll() method applies favFlag: false, while favoriteAll() is updated to apply favFlag: true without dynamic computation. The template wiring is updated to call the correctly-named method.

Changes

Favorite/Unfavorite Refactor

Layer / File(s) Summary
Favorite/Unfavorite Methods
src/components/EnvelopeList.vue
unfavoriteAll() is added to apply favFlag: false to all selected envelopes; favoriteAll() is refactored to apply favFlag: true instead of computing the flag dynamically. Both methods clear the selection after marking.
Template Action Wiring
src/components/EnvelopeList.vue
The "Unfavorite" multiselect action in the template is updated to invoke unfavoriteAll (instead of the previous unFavoriteAll); "Favorite" invokes favoriteAll.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: fixing the favorite/unfavorite bulk action logic by correcting method behavior and renaming.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

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.

Makes sense. Thank you!

The unfavorite button called favoriteAll() and vice versa, with favFlags
computed via negated 'isAtLeastOneSelected*' checks. When all selected
messages shared the same state, the flag was inverted, causing a no-op or
the wrong action. Replace with explicit favFlag: true/false and correctly
named methods.

Fixes nextcloud#12149

Signed-off-by: RobinAngele <robin@robin4consulting.com>
@ChristophWurst ChristophWurst force-pushed the fix/important-icon-and-favorite branch from 4c789a8 to fcb160a Compare May 8, 2026 08:08
@ChristophWurst ChristophWurst enabled auto-merge May 8, 2026 08:08
@ChristophWurst ChristophWurst changed the title fix: add missing ImportantIcon and correct favorite/unfavorite bulk actions fix: correct favorite/unfavorite bulk action logic May 8, 2026
@ChristophWurst
Copy link
Copy Markdown
Member

/backport to stable5.8

@ChristophWurst
Copy link
Copy Markdown
Member

/backport to stable5.7

@ChristophWurst ChristophWurst merged commit ebad775 into nextcloud:main May 8, 2026
42 checks passed
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.

3 participants