Repository navigation
feat: 同步 velotype #116/#119/#121/#125 优化 - #406
Merged
Merged
Conversation
从 velotype 上游 a61c719 迁移四项改动,适配 navop 的 host 渲染/WASM 分枝: - #119 双击选词:`on_mouse_down` 按 click_count 命中 Unicode 词边界。 - #125 IME 崩溃修复:新增 `text_offsets` 模块统一 UTF-8/UTF-16 边界换算, runtime/inline/code/input 各处的偏移裁剪改用字符边界安全实现。 - #125 div 块渲染:解析容器内 Markdown 图片与行内片段,`div` 子的连续 链接徽章合并为一行居中换行布局。 - #121 字体栈:新增 `fonts` 模块(FontCatalog/FontPreferences/FontSettings), 代码相关渲染路径与表格列宽测量改用可配置 code font;host 可通过 `set_font_stacks` 注入字体栈。 - #116 大纲导航:新增 `Editor::reveal_outline_heading`,按序列化源码行定位并 滚动到对应块(velotype 的侧栏 UI 属于其 app workspace,navop 未包含)。 cargo test -p markdown-editor:551 + 7 + 1 全通过。
字体(承接 velotype #121): - core/settings 新增 markdown_code_font_family(默认等宽字体)并纳入 normalize - notes::init 从 AppSettings 构造 FontPreferences 调 set_font_stacks, 并 observe_global::<AppSettings>,设置面板改字体后立即生效 - settings.rs 的 set_font_stacks 每次调用重建字体目录,兼容运行期导入的自定义字体 - 设置页新增「Markdown 代码字体」下拉项 大纲(承接 velotype #116): - markdown-editor 新增 outline::outline_entries(感知围栏的 ATX 标题解析) - notes 新增右侧可折叠大纲面板,点击调用 Editor::reveal_outline_heading 跳转 - 工具栏加切换按钮,并绑定 view.toggle_outline(Cmd/Ctrl+Shift+O)
This was referenced Oct 16, 2026
ekovovo
pushed a commit
to ekovovo/navop
that referenced
this pull request
Oct 19, 2026
- main/Cargo.toml、Cargo.lock:0.20.2 -> 0.20.3 - CHANGELOG.md:新增 v0.20.3 双语发布说明 本版自 v0.20.2 以来已合入 main 的变更: - 终端按行 / 按屏滚动回看历史输出(feigeCode#409) - Auto 模式 SQL 编辑器粘性会话,跨执行保留会话变量(feigeCode#312) - 笔记 Markdown 大纲面板与代码字体设置(feigeCode#406) - Redis:启用 TLS 修复、集群汇总全部 master、空库切换崩溃修复(feigeCode#414、feigeCode#416) - SFTP:上传可立即取消、同连接 3 条并发车道、目录符号链接处理(feigeCode#417、feigeCode#418) - 清空表刷新数据页签、结果集保存限定库名、剪贴板 JSON 原文复制(feigeCode#412、feigeCode#413)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
navop 的
crates/markdown-editorfork 自 velotype(fork 点050943e)。本次把 velotype 上游a61c719的四个优化按 navop 现有架构(host 渲染 + WASM 高亮)搬过来,并接到 navop 自己的设置与 Notes UI 上,不照抄上游代码。上游同步(
180bca693)components/block/interactions.rs(unicode_segmentation)text_offsets.rs,runtime/mod.rs、inline.rs、runtime/code.rs、block/input.rs改用边界安全的 UTF-8/UTF-16 换算image.rs、html.rs、render.rs(适配 navop 的render_inline_image_content)fonts.rs(保留原生解析/回退,裁掉上游 CSS/导出与偏好 UI)navop 接入(
8ab8bd2db)代码字体
core/settings.rs新增markdown_code_font_family,随normalize_font_settings归一化notes::init用AppSettings构造FontPreferences调set_font_stacks,并observe_global::<AppSettings>—— 设置面板改字体立即生效,无需重启文档大纲(#116)
workspace.rs,navop 无此层;本次把Editor::reveal_outline_heading作为编辑器能力移植,另加outline::outline_entries(感知围栏的 ATX 解析)view.toggle_outline(Cmd/Ctrl+Shift+O)切换验证
cargo check -p markdown-editor -p notes -p one-core -p main --all-targets:0 error / 0 warningcargo test -p markdown-editor -p notes:554 + 7 + 1(ignored) + 86 全通过cargo test -p main --bin navop -- shortcut:14 passed(含快捷键标签覆盖与 SQL 注释快捷键不被抢占的守卫)