Skip to content

fix: extension action 'context' category #2369

Merged
JammingBen merged 2 commits intomainfrom
fix/extensions-context-actions-category
Apr 16, 2026
Merged

fix: extension action 'context' category #2369
JammingBen merged 2 commits intomainfrom
fix/extensions-context-actions-category

Conversation

@JammingBen
Copy link
Copy Markdown
Member

Makes sure that extension actions of category context are the only actions that get used for the "Open with" menu while also being candidates for default actions.

This prevents certain actions from showing up multiple times in the context menu.

fixes #2256

Makes sure that extension actions of category `context` are the
only actions that get used for the "Open with" menu while also
being candidates for default actions.

This prevents certain actions from showing up multiple times in
the context menu.
@JammingBen JammingBen self-assigned this Apr 14, 2026
Comment on lines -103 to -106
.filter(
(action) =>
isNil(action.category) || action.category === 'context' || action.category === 'actions'
)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@kulmann Do you remember why you added the filter for isNil and category === 'actions' for extensionsContextActions in 3b48960? It doesn't look right to me, and I couldn't detect any fallout from removing those.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no clue 😅 should be fine like you have it now.

Comment on lines +21 to +32
/**
* Determines where an action will be displayed in the resource context menu.
*
* - actions: action will appear in the "actions" section of the resource context menu.
* - context: action will appear in the "Open with..."-menu of the resource context menu.
* It will also be the default when no other action is available for the given file type.
* - share: action will appear in the "shares" section of the resource context menu.
* - sidebar: action will appear in the "sidebar" section of the resource context menu.
*
* @default actions
*/
category?: ActionCategory
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't now what we were thinking when naming these, but it's super confusing to me. I hope this comment brings at least some clarity to devs using this interface.

@JammingBen JammingBen marked this pull request as ready for review April 14, 2026 13:33
Comment on lines -103 to -106
.filter(
(action) =>
isNil(action.category) || action.category === 'context' || action.category === 'actions'
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no clue 😅 should be fine like you have it now.

@JammingBen JammingBen merged commit 084c06e into main Apr 16, 2026
30 checks passed
@JammingBen JammingBen deleted the fix/extensions-context-actions-category branch April 16, 2026 12:05
@openclouders openclouders mentioned this pull request Apr 16, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension actions with category 'actions' appear in both "Open with..." dropdown and standalone context menu

2 participants