Skip to content

refactor(notification): use Element Plus Notification for global notices - #5798

Merged
Jocs merged 3 commits into
developfrom
feat/element-plus-notification
Oct 20, 2026
Merged

Jocs merged 3 commits into
developfrom
feat/element-plus-notification

Conversation

@Jocs

@Jocs Jocs commented Oct 20, 2026

Copy link
Copy Markdown
Member

Summary

Replace the custom DOM toast service with Element Plus Notification while keeping the existing notice.notify(options) API and its Promise semantics.

  • Route global notifications through ElNotification with bottom-right positioning and z-index 10100.
  • Render the confirm action through VNode content, resolve on confirm, and reject on dismissal.
  • Keep HTML message support through DOMPurify so pandoc warnings retain their line breaks.
  • Use the existing notification theme variables and preserve the mt-notification selector used by tests.
  • Update Playwright close-button selectors and add unit coverage for the adapter.

The per-tab inline notification banner is intentionally unchanged: it is tab-scoped persistent UI, not a global overlay.

Verification

  • pnpm run typecheck
  • pnpm run test:unit (104 files, 1133 tests)

The Playwright diagram-viewer spec selectors were updated. A local E2E run could not complete because an Electron dev instance was already active; CI will exercise the spec.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5798:

Run: https://github.com/marktext/marktext/actions/runs/39406171480

Artifact Size Link
marktext-windows-arm64 291.1 MB Download
marktext-linux-x64 667.6 MB Download
marktext-windows-x64 299.2 MB Download
marktext-macos-arm64 300.4 MB Download
marktext-macos-x64 313.7 MB Download
marktext-linux-arm64 522.5 MB Download

@Jocs
Jocs merged commit 21acfa7 into develop Oct 20, 2026
13 checks passed
@Jocs
Jocs deleted the feat/element-plus-notification branch October 20, 2026 10:27
Zane-0x5a added a commit to Zane-0x5a/marktext that referenced this pull request Oct 27, 2026
Brings in v0.22.0 and v0.23.0 and the start of 0.24.0: Electron 45,
GitHub Alerts, foldable headings, per-tab reading mode and --read-only,
the docked document outline, multiple folder roots, preview tabs, recent
files in quick open, Italian, and the large-document fixes of marktext#4942 and
marktext#5863.

Conflicts:

- muya state/inlineRenderer: marktext#4942 caches reference definitions per
  candidate state, which supersedes the fork's per-revision cache. Took
  upstream's; the fork's display math cache in mathPreview stays.
- editor.vue: kept the fork's deferred content snapshot (no getState()
  deep clone per keystroke), document virtualization and camera, on top
  of upstream's reading mode, shortcut resolvers and image drop. The
  json-change handler keeps upstream's loadingContent/readOnly guard,
  the source handoff and reload take upstream's loadingContent blocks,
  and scrollToHeader reveals folded headings before following the
  target. publishContentChange uses getSelectionState().
- Print/PDF: the fork's paged preview replaces MarkdownPrint and the
  printToPDF export path, so printService, its specs and the pdf branch
  of handleResponseForExport keep the fork's side. marktext#3323 moved image
  resolution into the engine; exportHtml drops its own image rewrite and
  keeps the fork's rendered-heading TOC.
- marktext#5802's assertExportDestination moves to main/filesystem so Save PDF in
  the preview refuses the source document too.
- syntheticHistory keeps the 53-bit cyrb53 hash over upstream's BigInt
  FNV-64 (~6 ms per key on a 500 KB note); the store keeps isSameList
  and drops deep-equal.
- Sidebar rows keep draggable alongside preview tabs; locales keep both
  printPreview and readingMode, and it.json gets the printPreview strings.

Merge adjustments:

- SET_READ_ONLY publishes the pending snapshot first: a read-only tab
  drops content changes, so an edit made within 150 ms of entering
  reading mode would otherwise be missing from the tab.
- marktext#5798 moved notices to the bottom-right corner, over the preview's
  Save PDF and Print buttons, and an export notice stays while hovered.
  The preview lifts notices clear of its actions while it is open.
- Specs: the docked outline is expanded by default and narrows the
  column, so the virtualization specs open it only when it is closed,
  measure the settled position and place their target inside the
  viewport. The camera specs press Control once before measuring,
  because since marktext#5878 the first key press re-renders the caret's heading
  with its marks shown.

Verified on Windows 11 (175%): typecheck, lint, the desktop unit suite
(1467) and the muya unit suite (3978) pass. In background windows the
e2e suite (514 passed, 45 failed) fails only where a build of
upstream/develop fails on this machine too (copy-anchor-link,
document-outline, image clipboard/relative path, 5394, 5685,
toc-active-heading, outline-layout, ...: 56 cases in 19 specs there),
plus media-viewer cases that flake on both when the 1 px image's resize
bar takes the click. print-preview, export-pdf, document-virtualization
and sidebar-file-drag pass, and editor-camera passes on screen.
reading-mode:54 needs the camera focus fix in the next commit.
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