mattcasters opened a new pull request, #7715: URL: https://github.com/apache/hop/pull/7715
## Summary Implements [issue #2386](https://github.com/apache/hop/issues/2386) (formerly Jira HOP-2344): **Markdown notes** on pipeline and workflow canvases using **CommonMark + GFM** (tables, task lists), not MultiMarkdown-by-name. ### What users get - **Render as Markdown** on notes with semantic **note types** (General / Information / Important / Warning) for system-owned colors (light + dark mode) - Canvas rendering: headings, emphasis, code, lists, GFM tables, horizontal rules - **Clickable links**: `http(s)` in browser; relative Hop files (`.hpl` / `.hwf` / other registered types) open in Hop Gui - **Local images**: `` via HopVfs (PNG/JPEG/GIF/SVG); network images blocked - Editor: fixed-width source, **Preview**, **Help** (in-app Markdown guide), type selector; font tab ignored in Markdown mode - **Ctrl/⌘+click** a note (or link) to edit - Default new-note width ~`300 × native zoom`; Markdown min-width allows shrinking with reflow - Old plain-text notes still open/edit as before when Markdown is off - User manual: `hop-gui/notes.adoc` (+ nav / pipeline editor cross-links) ### Technical outline | Area | Changes | |------|---------| | Engine | `commonmark` deps; `MarkdownNoteRenderer`, `NoteImageSupport`, `NotePadType` / `NotePadStyle`; `BasePainter` markdown draw path; `IGc.drawFileImage` / `getFontHeight` | | UI | `NotePadDialog`, link navigation (`HopGuiNoteLinkSupport`), graph hover/click, preview & help | | RAP | `NOTE_LINK` serialization for web canvas area owners | | Docs | User manual notes page | Dialect choice: industry CommonMark/GFM (already used in Hop for Markdown file preview) rather than MultiMarkdown or flexmark. ## Reviewer guide ### Compatibility 1. Open a **pre-existing** pipeline/workflow with classic notes → body, colors, resize/move still work; no forced Markdown unless the flag is on. 2. New notes default to Markdown + General type; uncheck **Render as Markdown** for classic font/color mode. ### Canvas rendering (desktop) 1. Create a Markdown note with headings, `**bold**`, lists, a GFM table, and a horizontal rule. 2. Confirm font size is **comparable to transform/action names** (graph font), not oversized on HiDPI. 3. Try **all four note types** in **light and dark mode** for readable contrast. 4. **Resize width** narrower and wider → text reflows; width can shrink below full content width. ### Links 1. `[docs](https://hop.apache.org)` → browser opens. 2. `[sibling](other.hpl)` next to the current file → opens in Hop (or clear error if missing). 3. Plain click on link follows; **Ctrl/⌘+click** opens the note editor (does not follow). ### Images 1. Place a PNG/SVG next to the pipeline, e.g. ``. 2. Canvas shows the image (fit to note width, max height ~200, no upscale). 3. Remote `` must **not** load (placeholder `[alt]`). 4. **Preview** expands relative image `src` to absolute `file:` URLs so the browser can load them. ### Editor UX 1. **Help** (bottom-left) shows syntax examples and supported/not-supported lists. 2. **Preview** works with Markdown on; disabled when Markdown is off. 3. Font tab disabled when Markdown is on. ### Web / SVG (if practical) 1. Hop Web SVG canvas still draws notes; area owners include `noteLink` for hits. 2. Export SVG of a pipeline with a Markdown note for a quick visual smoke test. ### Tests / CI - Unit: `NotePadMetaTest`, `MarkdownNoteRendererTest`, `CommonMarkConfigTest`, `NoteImageSupportTest`, `HopGuiNoteLinkSupportTest`, `MarkdownNotePreviewTest`, `MarkdownNoteHelpTest` - Spotless / apache-rat already verified green by author - Worth a quick `./mvnw -pl engine,ui -am test -Dtest=…` if CI is slow ### Security notes for reviewers - Image loads: no `http(s)` / `data:` / `javascript:`; local/VFS paths only. - Link open: allowlist-style handling for URLs vs Hop file types via registry. ## Test plan - [x] Unit tests for parse/layout/links/images/preview help - [x] Spotless + apache-rat (author) - [ ] Manual: classic note compatibility - [ ] Manual: Markdown render + types light/dark - [ ] Manual: link click / Ctrl+click edit - [ ] Manual: local image + blocked remote image - [ ] Manual: Preview absolute image URLs - [ ] Optional: Hop Web / SVG export smoke Fixes #2386 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
