Skip to content

feat: #2452 add traditional formatting toolbar - #4325

Closed
Tux69140 wants to merge 5 commits into
marktext:developfrom
Tux69140:feature/2452-traditional-toolbar
Closed

Tux69140 wants to merge 5 commits into
marktext:developfrom
Tux69140:feature/2452-traditional-toolbar

Conversation

@Tux69140

Copy link
Copy Markdown

Closes #2452

Summary

Implements an optional traditional formatting toolbar for MarkText.

This PR adds a user preference to show or hide the toolbar, integrates the toolbar into the editor UI, and supports toolbar actions in both WYSIWYG and source mode. In source mode, link and image actions insert Markdown placeholders directly instead of opening dialogs.

A demo video is attached below.

Marktext-toolbar-20260530.mp4

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added (or explain why not needed)
  • Manually tested on: Linux - debian 12 uptodate

Automated checks run locally:

  • pnpm run lint
    • Passed with 77 pre-existing warnings, 0 errors
  • pnpm run typecheck
  • pnpm run test
    • Unit tests: 550 passed
  • pnpm -C packages/desktop build
  • env -u ELECTRON_RUN_AS_NODE pnpm run test:e2e
    • E2E: 80 passed, 2 skipped

The two skipped E2E tests are existing skipped tests in paragraph-blocks.spec.ts:

  • Paragraph block transforms › Horizontal rule
  • Paragraph block transforms › Insert table dialog opens and accepts default

They were already marked as skipped in the test suite and were not skipped specifically for this PR.

Notes for reviewers [optional]

Source mode toolbar behavior is intentionally Markdown-oriented:

  • Link and image buttons insert editable Markdown placeholders instead of opening dialogs.
  • Table, code fence, and front matter insertions rebuild the CodeMirror source editor to avoid stale cursor/measurement state.
  • Undo/redo is routed through the source editor history handling so toolbar, menu, and keyboard shortcuts stay consistent.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@Jocs

Jocs commented Jul 5, 2026

Copy link
Copy Markdown
Member

@Tux69140 I'm very sorry for replying so late. Over the past month, I've been mainly working on migrating the muya engine, so I prioritized bug fix PRs. The muya migration is now basically complete. Could you please fix the code conflicts first? So I can review this PR.

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.

Traditional toolbar?

2 participants