Skip to content

[8397] Remove viewPackages action from packageItems default set of actions#4908

Open
jvega190 wants to merge 1 commit into
craftercms:developfrom
jvega190:bugfix/8397
Open

[8397] Remove viewPackages action from packageItems default set of actions#4908
jvega190 wants to merge 1 commit into
craftercms:developfrom
jvega190:bugfix/8397

Conversation

@jvega190

@jvega190 jvega190 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Validate view packages action against actionsToInclude (actionsToInclude is set to 'all actions' if no override is set)

craftercms/craftercms#8397

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the “View packages” context-menu option could appear even when it was explicitly excluded by the available action filter.
    • The menu now respects the selected action set more consistently.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The viewPackages context-menu option now requires both an active workflow state and enabled status in actionsToInclude (derived from includeOnly), rather than only checking the workflow state, in generateSingleItemOptions.

Changes

Context Menu Option Fix

Layer / File(s) Summary
viewPackages inclusion condition
ui/app/src/utils/itemActions.ts
The condition for adding viewPackages to context-menu options now also checks actionsToInclude.viewPackages in addition to isInActiveWorkflow(item).

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is clear and matches the main change: tightening viewPackages inclusion for package items.
Description check ✅ Passed The description includes the ticket reference and a brief summary of the change, which matches the template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@jvega190

jvega190 commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd itemActions.ts
echo "---"
rg -n "viewPackages" ui/app/src/utils/itemActions.ts -C8

Length of output: 2083


🏁 Script executed:

#!/bin/bash
rg -n "actionsToInclude" ui/app/src/utils/itemActions.ts -B3 -A15 | head -80

Length of output: 2993


The change looks correct and consistent with how every other action in this function is gated. actionsToInclude defaults to createPresenceTable(allItemActions) when no includeOnly override is passed (Line 270), so by default actionsToInclude.viewPackages is true and the viewPackages menu option keeps showing up exactly as before whenever isInActiveWorkflow(item) is true. The only behavioral change is that consumers passing includeOnly can now correctly exclude viewPackages, matching the pattern used by every other action check in generateSingleItemOptions (Lines 295-338, 376-390). The diff is minimal (+1/-1) and doesn't touch the viewPackages menu option definition or its click handler (Lines 239-242, 961-964), so no other code paths are affected.

This is a clean, low-risk, single-line fix that aligns viewPackages with the existing actionsToInclude gating pattern used throughout the file. No issues found.

✅ Action performed

Review finished.

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.

@jvega190
jvega190 marked this pull request as ready for review July 6, 2026 18:07
@jvega190
jvega190 requested a review from rart as a code owner July 6, 2026 18:07
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.

1 participant