Skip to content

Fixed .md context menu losing all standard items after plugin install - #113

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/md-context-menu-missing-actions
May 12, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/md-context-menu-missing-actions

Conversation

@oleg68

@oleg68 oleg68 commented May 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • PreviewMarkdownAction was registered at Loaders/text/x-markdown-nb/Actions — NetBeans' MarkdownDataObject actually uses Loaders/text/text/x-markdown-nb/Actions for the context menu, where the NB markdown module registers all standard file actions (Open, Cut, Copy, Delete, etc.)
  • By creating the sibling Loaders/text/x-markdown-nb/Actions folder with only "Preview Markdown", the plugin was replacing the entire standard context menu
  • Fix: changed the @ActionReference path to Loaders/text/text/x-markdown-nb/Actions at position 150 (between Open and its separator), so "Preview Markdown" appears alongside the standard actions

Test plan

  • Install the plugin
  • Right-click a .md file in the Files panel
  • Confirm all standard items are present: Open, Cut, Copy, Delete, Rename, FileSystem, Tools, Properties
  • Confirm "Preview Markdown" also appears (right after Open)
  • Click "Preview Markdown" — confirm the preview tab opens correctly

🤖 Generated with Claude Code

The PreviewMarkdownAction was registered at Loaders/text/x-markdown-nb/Actions
(position 300). NetBeans' MarkdownDataObject looks for actions at
Loaders/text/text/x-markdown-nb/Actions — the NB markdown module registers
all standard file actions (Open, Cut, Copy, Delete, etc.) there. By creating
the sibling Loaders/text/x-markdown-nb/Actions folder with only our one action,
the plugin was inadvertently replacing the entire standard context menu.

Fix: change the @ActionReference path to Loaders/text/text/x-markdown-nb/Actions
at position 150 (between NB's OpenAction at 100 and its separator at 200),
so Preview Markdown is added alongside the standard actions instead of
replacing them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 657be2e into nbplugins:main May 12, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/md-context-menu-missing-actions branch May 12, 2026 07:22
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