Skip to content

Editor UI polish: toolbar mode toggle + immersive stats#116

Merged
rogerdigital merged 2 commits into
mainfrom
feat/editor-ui-polish
Jun 23, 2026
Merged

Editor UI polish: toolbar mode toggle + immersive stats#116
rogerdigital merged 2 commits into
mainfrom
feat/editor-ui-polish

Conversation

@rogerdigital

@rogerdigital rogerdigital commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Changes

Align toolbar mode toggle style

The 源码/实时 (source/live) toggle was a bordered pill control that visually clashed with the md-editor native flat icon buttons.

  • Removed container border and overflow:hidden; switched to borderless inline-flex flat layout.
  • Button corner radius set to radius.xs (matching native buttons); hover/active use accentSoft background, identical to native toolbar button:hover.
  • Added title attributes to both buttons to match the native command buttons' browser tooltip behavior (previously only had aria-label without title, so hover showed nothing).

Align immersive mode stats

Immersive mode stats now match the writing desk editor area exactly.

  • Added char limit {titleCount}/{TITLE_LIMIT} next to the title input (red when over), plus IME composition event handling (previously missing in immersive title input, so pinyin intermediate chars were counted).
  • Filled out the footer: chars / CONTENT_LIMIT (red when over) · paragraphs · headings · read time, reusing the statsValue/statsUnit/statsDot styles, consistent with the editor bottom stats bar.

Verification

  • pnpm build passes
  • lint-staged (prettier + eslint) passes

Out of scope

The immersive mode top bar is intentionally kept clean, without 源码/实时 or 保存 buttons — immersive mode is a focused-writing context where a live split view conflicts with focus, and autosave provides a fallback.

源码/实时切换按钮原是带边框的胶囊控件,与 md-editor 原生平铺图标
按钮视觉割裂:

- 去掉容器边框和 overflow:hidden,改为无边框 inline-flex 平铺。
- 按钮圆角改 radius.xs(与原生按钮一致),hover/active 用 accentSoft
  背景,与原生 toolbar button:hover 完全一致。
- 给两个按钮补 title 属性,与原生命令按钮的浏览器原生 tooltip 行为
  对齐(之前只有 aria-label 无 title,hover 无提示)。
沉浸模式统计条目与写作台编辑区对齐:

- 标题输入框旁补字符限制 {titleCount}/{TITLE_LIMIT}(超限标红),并补
  IME 合成事件处理(之前沉浸标题输入无 composition 处理,拼音临时字符
  会计入统计)。
- footer 补全:字符 / CONTENT_LIMIT(超限标红)· 段落 · 标题数 · 阅读
  时间,复用 statsValue/statsUnit/statsDot 样式,与写作台底部统计栏
  完全一致。
@rogerdigital rogerdigital changed the title 编辑器 UI 一致性打磨:工具栏切换按钮 + 沉浸模式统计 Editor UI polish: toolbar mode toggle + immersive stats Jun 23, 2026
@rogerdigital rogerdigital merged commit 84e1fcc into main Jun 23, 2026
3 checks passed
@rogerdigital rogerdigital deleted the feat/editor-ui-polish branch June 23, 2026 16:16
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