Skip to content

✨ feat: page document nodes, chart visual form and table editing polish [force major] - #236

Open
Innei wants to merge 1 commit into
masterfrom
feat/page-document-nodes
Open

Innei wants to merge 1 commit into
masterfrom
feat/page-document-nodes

Conversation

@Innei

@Innei Innei commented Oct 27, 2026

Copy link
Copy Markdown
Member

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

🔀 变更说明 | Description of Change

New nodes (each with Markdown, LiteXML, headless and LexicalRenderer support):

  • Alert: note / tip / important / warning / caution, switchable from the header.
  • Footnote + footnote section: hover preview, auto numbering, an inline back link.
  • Chart: backed by @lobehub/charts (lazy loaded); bar / line / area / pie stored as a JSON spec.

Existing nodes, new fields and interactions:

  • Heading: anchor slugs, copy link, fold.
  • Table: column alignment (colAligns).
  • File: mimeType / ext, a type icon, preview and download.
  • Image: caption serialization, thumbhash / accent placeholder, lightbox.
  • Checklist: LiteXML <ul type="check"><li checked>.

Chart visual form: an Edit chart popover with Setup / Data / Style tabs next to the </> JSON editor. Every change applies at once, invalid input reverts, and each change is one undo step.

Table polish:

  • Resting look: no vertical rules and a quiet header.
  • Editing: grips on the row and column edges plus a corner grip, each opening one grouped menu (insert / align icon row / column width / delete).
  • Insert dots between rows and columns.

⚠️ Breaking change (major bump)

  • TablePluginOptions.decoratorCol / decoratorRow → a single decorator(node, editor) option.
  • Removed the old table controller rails, the cell action menu and hover actions, together with their exports.
  • Table menu items: action items may carry icon, and there are new label / segmented item types plus a table axis.

📝 补充信息 | Additional Information

UI verification (Chrome, real pointer): https://ryugi.innei.dev/a/KooUZu_GJ3r7W2XKzQi2

  • Round 2: Table polish ✅ passed, Chart visual form ✅ passed (approved design vs real app, with recordings).
  • Round 1: the alert / footnote / chart / table / heading / image / file groups are still pending review.

Checks: pnpm type-check ✅, pnpm lint:circular ✅, eslint 0 errors, vitest 837 passed / 1 skipped.

Known follow-ups (not in this PR):

  • Merged-cell geometry for grips.
  • Sticky row grips when a wide table scrolls.
  • Menu keyboard navigation and a drag drop indicator.
  • Rejected chart-form edits still push an empty undo step.

…sh [force major]

- add alert, footnote/footnote-section and chart (@lobehub/charts) nodes with Markdown, LiteXML, headless and renderer support
- heading anchors and folding, table column alignment, file mimeType/ext with preview/download, image caption/thumbhash/accent/lightbox, checklist LiteXML
- chart: visual config form (setup/data/style) next to the JSON source editor
- table: quiet resting look, edge grips with one grouped menu, insert dots between rows/columns

BREAKING CHANGE: TablePluginOptions decoratorCol/decoratorRow are replaced by a single decorator option; the old table controller, action menu and hover-action components are removed.
@lobe-tsukumo

lobe-tsukumo Bot commented Oct 27, 2026

Copy link
Copy Markdown

👍 @Innei

Thank you for raising your pull request and contributing to our Community.
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.

非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lobe-editor Ready Ready Preview Oct 27, 2026 5:58pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T17:10:16.854848Z 227f5a6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Oct 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@lobehub/editor@236

commit: 227f5a6

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 227f5a6d4c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +47 to +49
markdownService.registerMarkdownReader('footnoteReference', (node) =>
INodeHelper.createTypeNode(FootnoteNode.getType(), {
identifier: normalizeFootnoteIdentifier(node.label ?? node.identifier),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use canonical Markdown identifiers to associate footnotes

For valid Markdown containing Text[^NOTE] and [^note]: Source, these readers store different identifiers because they prefer the original label and normalizeFootnoteIdentifier does not case-fold it. Consequently, $collectFootnotes treats the reference as missing and the definition as orphaned, breaking previews, navigation, and read-only rendering. The mdast Association specification provides a normalized, case-folded identifier specifically for these associations. Use that identifier consistently in both readers and add a mixed-case Markdown round-trip test.

AGENTS.md reference: AGENTS.md:L113-L115

Useful? React with 👍 / 👎.

Comment on lines +33 to +34
markdownService.registerMarkdownWriter(FootnoteSectionNode.getType(), (ctx, node) => {
if (!$isFootnoteSectionNode(node)) return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Generate missing definitions even without a footnote section

When the last definition is removed, for example through a LiteXML removal operation, registerFootnoteStructure removes the now-empty section while leaving references intact. Missing-definition generation only runs inside this section writer, so Markdown export then emits references without definitions. Reimporting that Markdown turns them into ordinary text, losing the footnote nodes. Generate missing definitions independently of section existence and cover removal of the final definition in a headless round-trip test; the existing test retains another definition and therefore misses this case.

AGENTS.md reference: AGENTS.md:L113-L115

Useful? React with 👍 / 👎.

This branch was successfully deployed

1 active deployment
Preview — 227f5a6d Deployed Oct 27, 2026 by vercel[bot]
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