Skip to content

fix: 修复工具栏配置为 false 时的渲染问题#1591

Merged
RSS1102 merged 21 commits intodevfrom
rss1102/fix/toolbar/hidden
Apr 15, 2026
Merged

fix: 修复工具栏配置为 false 时的渲染问题#1591
RSS1102 merged 21 commits intodevfrom
rss1102/fix/toolbar/hidden

Conversation

@RSS1102
Copy link
Copy Markdown
Collaborator

@RSS1102 RSS1102 commented Jan 9, 2026

toolbartoolbarRight 都为 false 时,则隐藏顶部工具栏。

# toolbar toolbarRight showToolbar defaultModel toolbarUserDisabled shouldHideToolbar() 顶部工具栏
1 ['bold',...] [] true edit&preview ✅ 显示
2 ['bold',...] ['theme'] true edit&preview ✅ 显示
3 [] ['theme'] true edit&preview ✅ 显示
4 [] [] true edit&preview ❌ 隐藏
5 ['bold',...] [] false edit&preview ❌ 隐藏
6 false [] true edit&preview ❌ 隐藏
7 false ['theme'] true edit&preview ❌ 隐藏
8 false false true edit&preview ❌ 隐藏
9 ['bold',...] false true edit&preview ✅ 显示
10 ['bold',...] [] true editOnly ✅ 显示
11 ['bold',...] [] false editOnly ❌ 隐藏
12 ['bold',...] [] previewOnly ❌ 隐藏
13 false false previewOnly ❌ 隐藏
14 [] [] previewOnly ❌ 隐藏

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 9, 2026

🦋 Changeset detected

Latest commit: 6a3adea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
cherry-markdown Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread packages/cherry-markdown/src/Cherry.js Outdated
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jan 9, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/cherry-markdown@1591
npm i https://pkg.pr.new/cherry-markdown@1591
yarn add https://pkg.pr.new/cherry-markdown@1591.tgz

commit: 6a3adea

@cherry-markdown-bot
Copy link
Copy Markdown
Collaborator

cherry-markdown-bot commented Jan 9, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 9, 2026

Size Change: -1.05 kB (-0.01%)

Total Size: 7.84 MB

📦 View Changed
Filename Size Change
packages/cherry-markdown/dist/cherry-markdown.core.js 674 kB -217 B (-0.03%)
packages/cherry-markdown/dist/cherry-markdown.esm.js 1.65 MB -160 B (-0.01%)
packages/cherry-markdown/dist/cherry-markdown.js 3.32 MB -714 B (-0.02%)
packages/cherry-markdown/dist/types/Cherry.d.ts 4.66 kB +42 B (+0.91%)
ℹ️ View Unchanged
Filename Size
packages/cherry-markdown/dist/addons/advance/cherry-codeblock-echarts-plugin.esm.js 29.7 kB
packages/cherry-markdown/dist/addons/advance/cherry-codeblock-echarts-plugin.js 29.8 kB
packages/cherry-markdown/dist/addons/advance/cherry-table-echarts-plugin.esm.js 49.4 kB
packages/cherry-markdown/dist/addons/advance/cherry-table-echarts-plugin.js 49.5 kB
packages/cherry-markdown/dist/addons/advance/cherry-tapd-checklist-plugin.esm.js 22.4 kB
packages/cherry-markdown/dist/addons/advance/cherry-tapd-checklist-plugin.js 22.5 kB
packages/cherry-markdown/dist/addons/advance/cherry-tapd-html-tag-plugin.esm.js 22.4 kB
packages/cherry-markdown/dist/addons/advance/cherry-tapd-html-tag-plugin.js 22.4 kB
packages/cherry-markdown/dist/addons/advance/cherry-tapd-table-plugin.esm.js 25.4 kB
packages/cherry-markdown/dist/addons/advance/cherry-tapd-table-plugin.js 25.5 kB
packages/cherry-markdown/dist/addons/cherry-code-block-mermaid-plugin.esm.js 23.3 kB
packages/cherry-markdown/dist/addons/cherry-code-block-mermaid-plugin.js 23.3 kB
packages/cherry-markdown/dist/addons/cherry-code-block-plantuml-plugin.esm.js 24.7 kB
packages/cherry-markdown/dist/addons/cherry-code-block-plantuml-plugin.js 24.8 kB
packages/cherry-markdown/dist/cherry-markdown.core.d.ts 106 B
packages/cherry-markdown/dist/cherry-markdown.css 35.3 kB
packages/cherry-markdown/dist/cherry-markdown.d.ts 101 B
packages/cherry-markdown/dist/cherry-markdown.engine.core.d.ts 116 B
packages/cherry-markdown/dist/cherry-markdown.engine.core.esm.d.ts 116 B
packages/cherry-markdown/dist/cherry-markdown.engine.core.esm.js 301 kB
packages/cherry-markdown/dist/cherry-markdown.engine.core.js 301 kB
packages/cherry-markdown/dist/cherry-markdown.esm.d.ts 101 B
packages/cherry-markdown/dist/cherry-markdown.markdown.css 20.7 kB
packages/cherry-markdown/dist/cherry-markdown.markdown.min.css 14.4 kB
packages/cherry-markdown/dist/cherry-markdown.min.css 27.8 kB
packages/cherry-markdown/dist/cherry-markdown.stream.d.ts 100 B
packages/cherry-markdown/dist/cherry-markdown.stream.esm.d.ts 100 B
packages/cherry-markdown/dist/cherry-markdown.stream.esm.js 484 kB
packages/cherry-markdown/dist/cherry-markdown.stream.js 484 kB
packages/cherry-markdown/dist/types/addons/advance/cherry-codeblock-echarts-plugin.d.ts 461 B
packages/cherry-markdown/dist/types/addons/advance/cherry-table-echarts-plugin.d.ts 1.73 kB
packages/cherry-markdown/dist/types/addons/advance/cherry-tapd-checklist-plugin.d.ts 323 B
packages/cherry-markdown/dist/types/addons/advance/cherry-tapd-html-tag-plugin.d.ts 494 B
packages/cherry-markdown/dist/types/addons/advance/cherry-tapd-table-plugin.d.ts 1.15 kB
packages/cherry-markdown/dist/types/addons/cherry-code-block-mermaid-plugin.d.ts 1.45 kB
packages/cherry-markdown/dist/types/addons/cherry-code-block-plantuml-plugin.d.ts 160 B
packages/cherry-markdown/dist/types/Cherry.config.d.ts 122 B
packages/cherry-markdown/dist/types/CherryStatic.d.ts 547 B
packages/cherry-markdown/dist/types/CherryStream.d.ts 1.59 kB
packages/cherry-markdown/dist/types/core/HookCenter.d.ts 789 B
packages/cherry-markdown/dist/types/core/hooks/AiFlowAutoClose.d.ts 370 B
packages/cherry-markdown/dist/types/core/hooks/AutoLink.d.ts 948 B
packages/cherry-markdown/dist/types/core/hooks/BackgroundColor.d.ts 189 B
packages/cherry-markdown/dist/types/core/hooks/Blockquote.d.ts 195 B
packages/cherry-markdown/dist/types/core/hooks/Br.d.ts 193 B
packages/cherry-markdown/dist/types/core/hooks/CodeBlock.d.ts 1.61 kB
packages/cherry-markdown/dist/types/core/hooks/Color.d.ts 183 B
packages/cherry-markdown/dist/types/core/hooks/CommentReference.d.ts 665 B
packages/cherry-markdown/dist/types/core/hooks/Detail.d.ts 328 B
packages/cherry-markdown/dist/types/core/hooks/Emoji.config.d.ts 9.31 kB
packages/cherry-markdown/dist/types/core/hooks/Emoji.d.ts 9.36 kB
packages/cherry-markdown/dist/types/core/hooks/Emphasis.d.ts 263 B
packages/cherry-markdown/dist/types/core/hooks/Footnote.d.ts 307 B
packages/cherry-markdown/dist/types/core/hooks/FrontMatter.d.ts 192 B
packages/cherry-markdown/dist/types/core/hooks/Header.d.ts 605 B
packages/cherry-markdown/dist/types/core/hooks/HighLight.d.ts 157 B
packages/cherry-markdown/dist/types/core/hooks/Hr.d.ts 223 B
packages/cherry-markdown/dist/types/core/hooks/HtmlBlock.d.ts 313 B
packages/cherry-markdown/dist/types/core/hooks/Image.d.ts 325 B
packages/cherry-markdown/dist/types/core/hooks/InlineCode.d.ts 181 B
packages/cherry-markdown/dist/types/core/hooks/InlineMath.d.ts 707 B
packages/cherry-markdown/dist/types/core/hooks/Link.d.ts 582 B
packages/cherry-markdown/dist/types/core/hooks/List.d.ts 347 B
packages/cherry-markdown/dist/types/core/hooks/MathBlock.d.ts 461 B
packages/cherry-markdown/dist/types/core/hooks/Panel.d.ts 436 B
packages/cherry-markdown/dist/types/core/hooks/Paragraph.d.ts 664 B
packages/cherry-markdown/dist/types/core/hooks/Ruby.d.ts 154 B
packages/cherry-markdown/dist/types/core/hooks/Size.d.ts 176 B
packages/cherry-markdown/dist/types/core/hooks/Space.d.ts 199 B
packages/cherry-markdown/dist/types/core/hooks/Strikethrough.d.ts 241 B
packages/cherry-markdown/dist/types/core/hooks/Sub.d.ts 179 B
packages/cherry-markdown/dist/types/core/hooks/Suggester.d.ts 2.23 kB
packages/cherry-markdown/dist/types/core/hooks/SuggestList.d.ts 158 B
packages/cherry-markdown/dist/types/core/hooks/Sup.d.ts 179 B
packages/cherry-markdown/dist/types/core/hooks/Table.d.ts 554 B
packages/cherry-markdown/dist/types/core/hooks/Toc.d.ts 974 B
packages/cherry-markdown/dist/types/core/hooks/Transfer.d.ts 175 B
packages/cherry-markdown/dist/types/core/hooks/Underline.d.ts 156 B
packages/cherry-markdown/dist/types/core/HooksConfig.d.ts 523 B
packages/cherry-markdown/dist/types/core/ParagraphBase.d.ts 1.39 kB
packages/cherry-markdown/dist/types/core/SyntaxBase.d.ts 956 B
packages/cherry-markdown/dist/types/Editor.d.ts 5.68 kB
packages/cherry-markdown/dist/types/Engine.d.ts 1.55 kB
packages/cherry-markdown/dist/types/Event.d.ts 531 B
packages/cherry-markdown/dist/types/Factory.d.ts 1.02 kB
packages/cherry-markdown/dist/types/index.core.d.ts 122 B
packages/cherry-markdown/dist/types/index.d.ts 122 B
packages/cherry-markdown/dist/types/index.engine.core.d.ts 377 B
packages/cherry-markdown/dist/types/index.engine.d.ts 93 B
packages/cherry-markdown/dist/types/index.stream.d.ts 107 B
packages/cherry-markdown/dist/types/libs/rawdeflate.d.ts 87 B
packages/cherry-markdown/dist/types/locales/en_US.d.ts 1.11 kB
packages/cherry-markdown/dist/types/locales/index.d.ts 141 B
packages/cherry-markdown/dist/types/locales/ru_RU.d.ts 1.11 kB
packages/cherry-markdown/dist/types/locales/zh_CN.d.ts 1.12 kB
packages/cherry-markdown/dist/types/Logger.d.ts 441 B
packages/cherry-markdown/dist/types/Previewer.d.ts 2.81 kB
packages/cherry-markdown/dist/types/Sanitizer.d.ts 69 B
packages/cherry-markdown/dist/types/toolbars/Bubble.d.ts 1.02 kB
packages/cherry-markdown/dist/types/toolbars/BubbleFormula.d.ts 1.38 kB
packages/cherry-markdown/dist/types/toolbars/BubbleTable.d.ts 329 B
packages/cherry-markdown/dist/types/toolbars/FloatMenu.d.ts 783 B
packages/cherry-markdown/dist/types/toolbars/HiddenToolbar.d.ts 226 B
packages/cherry-markdown/dist/types/toolbars/HookCenter.d.ts 512 B
packages/cherry-markdown/dist/types/toolbars/hooks/Align.d.ts 191 B
packages/cherry-markdown/dist/types/toolbars/hooks/Audio.d.ts 322 B
packages/cherry-markdown/dist/types/toolbars/hooks/Bold.d.ts 455 B
packages/cherry-markdown/dist/types/toolbars/hooks/Br.d.ts 318 B
packages/cherry-markdown/dist/types/toolbars/hooks/ChangeLocale.d.ts 252 B
packages/cherry-markdown/dist/types/toolbars/hooks/CheckList.d.ts 353 B
packages/cherry-markdown/dist/types/toolbars/hooks/Code.d.ts 398 B
packages/cherry-markdown/dist/types/toolbars/hooks/CodeTheme.d.ts 451 B
packages/cherry-markdown/dist/types/toolbars/hooks/Color.d.ts 2.11 kB
packages/cherry-markdown/dist/types/toolbars/hooks/Copy.d.ts 697 B
packages/cherry-markdown/dist/types/toolbars/hooks/CursorPosition.d.ts 207 B
packages/cherry-markdown/dist/types/toolbars/hooks/Detail.d.ts 324 B
packages/cherry-markdown/dist/types/toolbars/hooks/DrawIo.d.ts 420 B
packages/cherry-markdown/dist/types/toolbars/hooks/Export.d.ts 195 B
packages/cherry-markdown/dist/types/toolbars/hooks/File.d.ts 319 B
packages/cherry-markdown/dist/types/toolbars/hooks/Formula.d.ts 459 B
packages/cherry-markdown/dist/types/toolbars/hooks/FullScreen.d.ts 206 B
packages/cherry-markdown/dist/types/toolbars/hooks/Graph.d.ts 736 B
packages/cherry-markdown/dist/types/toolbars/hooks/H1.d.ts 390 B
packages/cherry-markdown/dist/types/toolbars/hooks/H2.d.ts 391 B
packages/cherry-markdown/dist/types/toolbars/hooks/H3.d.ts 391 B
packages/cherry-markdown/dist/types/toolbars/hooks/Header.d.ts 505 B
packages/cherry-markdown/dist/types/toolbars/hooks/Hr.d.ts 322 B
packages/cherry-markdown/dist/types/toolbars/hooks/Image.d.ts 345 B
packages/cherry-markdown/dist/types/toolbars/hooks/InlineCode.d.ts 436 B
packages/cherry-markdown/dist/types/toolbars/hooks/Insert.d.ts 473 B
packages/cherry-markdown/dist/types/toolbars/hooks/Italic.d.ts 463 B
packages/cherry-markdown/dist/types/toolbars/hooks/Justify.d.ts 163 B
packages/cherry-markdown/dist/types/toolbars/hooks/Link.d.ts 347 B
packages/cherry-markdown/dist/types/toolbars/hooks/List.d.ts 488 B
packages/cherry-markdown/dist/types/toolbars/hooks/MobilePreview.d.ts 316 B
packages/cherry-markdown/dist/types/toolbars/hooks/Ol.d.ts 349 B
packages/cherry-markdown/dist/types/toolbars/hooks/Panel.d.ts 475 B
packages/cherry-markdown/dist/types/toolbars/hooks/Pdf.d.ts 318 B
packages/cherry-markdown/dist/types/toolbars/hooks/ProTable.d.ts 561 B
packages/cherry-markdown/dist/types/toolbars/hooks/Publish.d.ts 390 B
packages/cherry-markdown/dist/types/toolbars/hooks/QuickTable.d.ts 440 B
packages/cherry-markdown/dist/types/toolbars/hooks/Quote.d.ts 245 B
packages/cherry-markdown/dist/types/toolbars/hooks/Redo.d.ts 263 B
packages/cherry-markdown/dist/types/toolbars/hooks/Ruby.d.ts 447 B
packages/cherry-markdown/dist/types/toolbars/hooks/Search.d.ts 369 B
packages/cherry-markdown/dist/types/toolbars/hooks/Settings.d.ts 753 B
packages/cherry-markdown/dist/types/toolbars/hooks/ShortcutKey.d.ts 442 B
packages/cherry-markdown/dist/types/toolbars/hooks/Size.d.ts 300 B
packages/cherry-markdown/dist/types/toolbars/hooks/Split.d.ts 319 B
packages/cherry-markdown/dist/types/toolbars/hooks/Strikethrough.d.ts 405 B
packages/cherry-markdown/dist/types/toolbars/hooks/Sub.d.ts 372 B
packages/cherry-markdown/dist/types/toolbars/hooks/Sup.d.ts 372 B
packages/cherry-markdown/dist/types/toolbars/hooks/SwitchModel.d.ts 285 B
packages/cherry-markdown/dist/types/toolbars/hooks/Table.d.ts 364 B
packages/cherry-markdown/dist/types/toolbars/hooks/Theme.d.ts 465 B
packages/cherry-markdown/dist/types/toolbars/hooks/Toc.d.ts 320 B
packages/cherry-markdown/dist/types/toolbars/hooks/TogglePreview.d.ts 342 B
packages/cherry-markdown/dist/types/toolbars/hooks/Ul.d.ts 350 B
packages/cherry-markdown/dist/types/toolbars/hooks/Underline.d.ts 403 B
packages/cherry-markdown/dist/types/toolbars/hooks/Undo.d.ts 244 B
packages/cherry-markdown/dist/types/toolbars/hooks/Video.d.ts 322 B
packages/cherry-markdown/dist/types/toolbars/hooks/Word.d.ts 318 B
packages/cherry-markdown/dist/types/toolbars/hooks/WordCount.d.ts 376 B
packages/cherry-markdown/dist/types/toolbars/MenuBase.d.ts 2.79 kB
packages/cherry-markdown/dist/types/toolbars/PreviewerBubble.d.ts 2.88 kB
packages/cherry-markdown/dist/types/toolbars/ShortcutKeyConfigPanel.d.ts 1.38 kB
packages/cherry-markdown/dist/types/toolbars/Sidebar.d.ts 224 B
packages/cherry-markdown/dist/types/toolbars/Toc.d.ts 384 B
packages/cherry-markdown/dist/types/toolbars/Toolbar.d.ts 2.24 kB
packages/cherry-markdown/dist/types/toolbars/ToolbarRight.d.ts 156 B
packages/cherry-markdown/dist/types/UrlCache.d.ts 529 B
packages/cherry-markdown/dist/types/utils/async-render-handler.d.ts 346 B
packages/cherry-markdown/dist/types/utils/autoindent.d.ts 239 B
packages/cherry-markdown/dist/types/utils/cm-search-replace.d.ts 1.75 kB
packages/cherry-markdown/dist/types/utils/code-preview-language-setting.d.ts 169 B
packages/cherry-markdown/dist/types/utils/codeBlockContentHandler.d.ts 949 B
packages/cherry-markdown/dist/types/utils/color.d.ts 205 B
packages/cherry-markdown/dist/types/utils/config.d.ts 984 B
packages/cherry-markdown/dist/types/utils/copy.d.ts 222 B
packages/cherry-markdown/dist/types/utils/dialog.d.ts 195 B
packages/cherry-markdown/dist/types/utils/dom.d.ts 650 B
packages/cherry-markdown/dist/types/utils/downloadUtil.d.ts 426 B
packages/cherry-markdown/dist/types/utils/env.d.ts 482 B
packages/cherry-markdown/dist/types/utils/error.d.ts 185 B
packages/cherry-markdown/dist/types/utils/event.d.ts 440 B
packages/cherry-markdown/dist/types/utils/export.d.ts 422 B
packages/cherry-markdown/dist/types/utils/exportWord.d.ts 424 B
packages/cherry-markdown/dist/types/utils/external.d.ts 576 B
packages/cherry-markdown/dist/types/utils/file.d.ts 848 B
packages/cherry-markdown/dist/types/utils/footnoteHoverHandler.d.ts 889 B
packages/cherry-markdown/dist/types/utils/formulaUtilsHandler.d.ts 638 B
packages/cherry-markdown/dist/types/utils/htmlparser.d.ts 1.55 kB
packages/cherry-markdown/dist/types/utils/image.d.ts 440 B
packages/cherry-markdown/dist/types/utils/imgSizeHandler.d.ts 912 B
packages/cherry-markdown/dist/types/utils/imgToolHandler.d.ts 412 B
packages/cherry-markdown/dist/types/utils/lazyLoadImg.d.ts 2.24 kB
packages/cherry-markdown/dist/types/utils/lineFeed.d.ts 720 B
packages/cherry-markdown/dist/types/utils/listContentHandler.d.ts 634 B
packages/cherry-markdown/dist/types/utils/lookbehind-replace.d.ts 381 B
packages/cherry-markdown/dist/types/utils/LRUCache.d.ts 554 B
packages/cherry-markdown/dist/types/utils/mathjax.d.ts 218 B
packages/cherry-markdown/dist/types/utils/myersDiff.d.ts 906 B
packages/cherry-markdown/dist/types/utils/pasteHelper.d.ts 934 B
packages/cherry-markdown/dist/types/utils/platformTransform.d.ts 152 B
packages/cherry-markdown/dist/types/utils/recount-pos.d.ts 259 B
packages/cherry-markdown/dist/types/utils/regexp.d.ts 1.58 kB
packages/cherry-markdown/dist/types/utils/sanitize.d.ts 423 B
packages/cherry-markdown/dist/types/utils/shortcutKey.d.ts 543 B
packages/cherry-markdown/dist/types/utils/svgUtils.d.ts 650 B
packages/cherry-markdown/dist/types/utils/tableContentHandler.d.ts 3.25 kB

compressed-size-action

@RSS1102 RSS1102 added the minor 破坏性更改,break change label Jan 9, 2026
@RSS1102 RSS1102 marked this pull request as draft January 9, 2026 07:50
@RSS1102 RSS1102 marked this pull request as ready for review January 28, 2026 07:23
@RSS1102 RSS1102 marked this pull request as draft January 28, 2026 07:23
RSS1102 added 4 commits April 7, 2026 16:53
当 toolbar 和 toolbarRight 都为 false/空数组时,隐藏顶部工具栏 DOM;
统一将非数组的工具栏配置归一化为空数组
@RSS1102 RSS1102 closed this Apr 14, 2026
@RSS1102 RSS1102 reopened this Apr 14, 2026
@RSS1102 RSS1102 closed this Apr 14, 2026
@RSS1102 RSS1102 reopened this Apr 14, 2026
@cherry-markdown-bot
Copy link
Copy Markdown
Collaborator

cherry-markdown-bot commented Apr 14, 2026

💻 Client 构建产物

平台 架构 产物类型 下载
macOS Apple Silicon App 应用 下载
macOS Apple Silicon DMG 安装包 下载
macOS x64 App 应用 下载
macOS x64 DMG 安装包 下载
Windows x64 EXE 安装程序 下载
Windows x64 MSI 安装包 下载
Linux x64 Deb 包 下载
Linux x64 AppImage 下载

⏰ 产物保留 5 天

@cherry-markdown-bot
Copy link
Copy Markdown
Collaborator

cherry-markdown-bot commented Apr 14, 2026

🔌 VSCode Plugin 构建产物

下载 .vsix

⏰ 产物保留 5 天

@cherry-markdown-bot
Copy link
Copy Markdown
Collaborator

cherry-markdown-bot commented Apr 14, 2026

@RSS1102 RSS1102 marked this pull request as ready for review April 14, 2026 14:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

该 PR 旨在修复 toolbars.toolbar / toolbars.toolbarRight 配置为 false 时顶部工具栏的渲染异常,并补充一个用于手动验证工具栏挂载/卸载与模式切换的 demo 页面。

Changes:

  • Cherry 初始化与模式切换/重置工具栏时,引入“是否应渲染工具栏 DOM”的统一计算与同步挂载逻辑(syncToolbarDom / #computeShouldRenderToolbar)。
  • 更新 CodeMirror EditorView 的类型引用方式(改为 JSDoc import() 类型),避免运行时依赖。
  • 新增 toolbar-toggle-demo.html 示例页,并将其加入 Vite 的可访问页面列表;新增 changeset 记录版本变更。

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/cherry-markdown/vite.config.ts 将新示例页加入 dev server 页面列表,便于验证修复效果
packages/cherry-markdown/src/Cherry.js 工具栏 DOM 挂载/卸载同步逻辑 + resetToolbar 清理逻辑 + 类型注释调整
examples/toolbar-toggle-demo.html 新增手动/半自动验证工具栏显示/隐藏/重置/模式切换的 demo
.changeset/yellow-cougars-flow.md 记录本次变更的发布说明与版本类型

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Comment thread .changeset/yellow-cougars-flow.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Comment thread examples/toolbar-toggle-demo.html Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cherry-markdown/src/toolbars/hooks/Settings.js Outdated
Comment thread packages/cherry-markdown/src/toolbars/hooks/Settings.js Outdated
Comment thread packages/cherry-markdown/src/Cherry.js
Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Comment thread packages/cherry-markdown/src/Cherry.js Outdated
Comment thread packages/cherry-markdown/src/Cherry.js Outdated
@RSS1102 RSS1102 merged commit 8216cfb into dev Apr 15, 2026
18 checks passed
@RSS1102 RSS1102 deleted the rss1102/fix/toolbar/hidden branch April 15, 2026 03:03
ethanflin pushed a commit to ethanflin/cherry-markdown that referenced this pull request Apr 16, 2026
* fix: 修复工具栏配置为 false 时的渲染问题

* Create yellow-cougars-flow.md

* refactor: 移除工具栏高度更新逻辑

* chore: 更新 changeset 版本类型为 minor

* fix: 修复工具栏配置为 false 时的渲染问题

当 toolbar 和 toolbarRight 都为 false/空数组时,隐藏顶部工具栏 DOM;
统一将非数组的工具栏配置归一化为空数组

* feat(examples): add toolbar toggle demo

* refactor(cherry): 优化工具栏渲染与清理逻辑

* fix(cherry): 修复工具栏配置为 false 时的渲染问题

* fix(cherry): 修复工具栏显式禁用时意外显示的问题

* refactor(ui): 统一管理工具栏状态和样式

* fix: 修复工具栏CSS类与DOM状态不同步的问题

* refactor(core): 简化工具栏显隐逻辑

* fix(examples): 更新测试断言以匹配 shouldHide 逻辑

* fix(toolbar): 隐藏顶部工具栏

* fix: 重构工具栏逻辑,显隐逻辑收纳到事件的回调里

---------

Co-authored-by: sunsonliu(刘阳) <sunsonliu@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor 破坏性更改,break change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants