Skip to content

Add a context menu and missing capability to the text editor #7549#7550

Closed
nadment wants to merge 1 commit into
apache:mainfrom
nadment:7549
Closed

Add a context menu and missing capability to the text editor #7549#7550
nadment wants to merge 1 commit into
apache:mainfrom
nadment:7549

Conversation

@nadment

@nadment nadment commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The Markdown preview button no longer works in RCP (GuiRegistry cannot find the listener method with the Facade).
The Markdown preview button is no longer visible in RAP because the toolbar is included in ContentEditorWidget, which is specific to RCP.
There is a missing implementation specific to hop-web for the Monaco editor.

@nadment nadment linked an issue Jul 16, 2026 that may be closed by this pull request
@nadment nadment added this to the 2.19 milestone Jul 16, 2026
@nadment
nadment marked this pull request as draft July 17, 2026 07:07
@mattcasters

Copy link
Copy Markdown
Contributor

Hey @nadment — I took a look at where this was stuck and opened a small follow-up with the three gaps fixed:

#7576 (branch help-7550-content-editor on my fork)

What was breaking CI

IContentEditorWidget.getLanguage() was added but RAP’s Monaco/fallback widgets didn’t implement it → hop-ui-rap compile failure.

Markdown preview + GuiRegistry

Once preview moved onto ContentEditor-Toolbar, the toolbar registers the editor widget, not the file handler. BaseGuiWidgets only resolved static listeners with an exact parameter class match, so previewMarkdown(IContentEditorWidget) never matched ContentEditorWidget.

Fix: resolve static listeners with an assignable parameter type (interface/facade), and keep preview as:

public static void previewMarkdown(IContentEditorWidget editorWidget)

hop-web toolbar

RAP now builds the shared ContentEditor-Toolbar so plugin actions (preview) can show in web as well. Full Monaco cut/copy/paste remote ops are still thin/no-op where the client doesn’t expose them yet.

Feel free to cherry-pick/merge from that branch into 7549 if you want to keep a single PR — happy either way.

@nadment

nadment commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Replace with PR #7576

@nadment nadment closed this Jul 19, 2026
@mattcasters

Copy link
Copy Markdown
Contributor

Follow-up on Hop Web content editor / Markdown preview

Further work is on #7576 (help-7550-content-editor), stacked on your #7550 changes:

  1. Tomcat 404hop-ui-rcp was on the Hop Web classpath (copied from client lib/core). Scanning the new ContentEditorWidget @GuiPlugin failed with NoClassDefFoundError: VerifyKeyListener. Dockerfile / run-hop-web-local.sh now strip hop-ui-rcp from the web image.
  2. Toolbar above text files on web — edit actions (@GuiToolbarElement) moved to shared ui class ContentEditorActions (static handlers on IContentEditorWidget). No new annotation type; same pattern as your Preview button. Desktop keeps context menu + keyboard shortcuts on RCP ContentEditorWidget.
  3. Markdown Preview click on webfile:// temp HTML is not visible to the client browser. On RAP we open ShowBrowserDialog with the rendered HTML; desktop still uses temp file + system browser.

Feel free to cherry-pick / merge from that branch into 7549, or we can keep helping via #7576 — whichever you prefer.

hansva pushed a commit that referenced this pull request Jul 20, 2026
…7576)

* Add a context menu and missing capability to the text editor #7549

* issue #7549 : fix content editor toolbar for RAP and Markdown preview

Unblock PR #7550 by addressing the three gaps Nicolas hit:

- RAP implements getLanguage() and builds the shared ContentEditor
  toolbar so plugin actions (Markdown preview) appear in hop-web.
- BaseGuiWidgets resolves static toolbar listeners with assignable
  parameter types (interface/facade), so previewMarkdown(IContentEditorWidget)
  works when the registered instance is ContentEditorWidget or RAP widgets.
- Markdown preview is a static listener taking IContentEditorWidget;
  dedupe content-editor i18n keys.

* issue #7549 : shared content-editor toolbar actions for Hop Web

Move ContentEditor-Toolbar @GuiToolbarElement handlers to a ui-module
GuiPlugin (ContentEditorActions) so Hop Web registers undo/copy/etc.
without loading hop-ui-rcp.

- Extend IContentEditorWidget with cut/paste/undo/redo
- RCP ContentEditorWidget keeps context menu + keyboard shortcuts
- RAP implements new ops (Text cut/paste; Monaco no-ops for now)
- Exclude hop-ui-rcp from Hop Web image (fixes Tomcat 404 startup)
- Skip ContentEditorWidget GuiPlugin scan on web as defense in depth

* issue #7549 : Markdown preview on Hop Web via in-app Browser dialog

Temp file:// URLs open on the client browser, so server-side temp HTML
never displays in Hop Web. Use ShowBrowserDialog for the RAP case;
desktop keeps the system browser + temp file path.

Also surface InvocationTargetException from static toolbar listeners
instead of silently falling through to a failed instance-method path.

* issue #7549 : Monaco dark theme for Hop Web content editors

Pass PropsUi dark mode into the Monaco remote widget as theme vs-dark
or vs (same pattern as canvas themeId). monaco-editor.js honors the
theme property on create and via setTheme.

---------

Co-authored-by: Nicolas Adment <39568358+nadment@users.noreply.github.com>
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.

Add a context menu and missing capability to the text editor

2 participants