Repository navigation
[6013] 实现 STEM 左侧目录树功能(PDF 书签与 TMU/STEM 章节大纲) - #4698
Merged
Merged
Conversation
- Scheme 层重构 text-outline.scm:修复模块依赖,规范章节层级判定(part 到 subsubsection),提取纯净标题,实现递归嵌套构树算法与 outline-go-to 光标滚动定位 - C++ 侧重构 OutlineWidget:递归解析嵌套大纲构建具有父子关系的 QTreeWidget,新增操作顶栏(全部展开/折叠/关闭按钮),打通编辑器模式点击定位与键盘焦点恢复 - 多 Tab 联动:在 SLOT_FILE 挂载大纲刷新调度,在 PDF 书签、STEM 大纲及启动页之间自适应切换 - 界面与主题:在 liii.css 与 liii-night.css 中完善目录树样式规范,在【查看】菜单新增【目录】开关项 - 默认启用:解除旧版本的探索性屏蔽,默认开启大纲目录树 - 自动化测试:新增 Scheme 单元测试(TeXmacs/tests/6013.scm)、Qt C++ 单元测试(tests/Plugins/Qt/qt_outline_widget_test.cpp)及 Python 端到端自动化测试脚本(TeXmacs/tests/python/6013.py)
- 使用 QML (OutlineSidebar.qml) 重构目录侧边栏界面,全面适配深色与浅色主题 - 将全部展开/折叠功能移至搜索框右侧的三点「···」弹出菜单 - 优化树形导引线与层级缩进,单层章节时去除冗余分支符,节点支持右侧对齐页码 - 修复基于唯一 node.id 的单项折叠展开逻辑,支持三角指示符点击与整行双击展开/收起 - 完善侧边栏尺寸与宽度边界,支持用户拖拽记忆与持久化 - 完善 Python 端到端鼠标交互测试脚本,断言真实点击导航与跳转
- 在 outline-go-to 与 C++ 激活槽中补齐 make-cursor-visible 调用,确保点击章节时光标与文档视口自动居中滚动到位 - 使用旋转几何保持折叠与展开状态下 chevron 箭头尺寸完全对称一致(11px 粗体)
da-liii
force-pushed
the
da/6013/outline_sidebar
branch
from
October 10, 2026 05:53
766d49d to
7f44018
Compare
da-liii
marked this pull request as ready for review
October 10, 2026 05:53
- 删除 QTreeWidget 时代遗留的失效 CSS(两份主题各 ~104 行)与无调用方的 document-outline-widget - OutlineBridge 移除只写不读的 currentTarget 与单参 itemClicked,合并 convert 样板为 makeNode - qt_tm_widget 提取 restore_outline_dock_width 替代 3 处复制块,并移除 SLOT_FILE 中重复的大纲加载 - 侧边栏宽度偏好改为 300ms 防抖写盘,QML setSource 延迟到首次显示 - QML 搜索改为单遍自底向上匹配 + 200ms 防抖,弹出菜单合并为 Repeater - 修复 outline sidebar 偏好默认值 C++/scheme 两层不一致导致菜单勾选状态错位 - 测试补齐 cleanup/QTEST_MAIN 规范,qml_load_test 新增 OutlineSidebar 加载用例 Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
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.
Summary
本 PR 规划并实现了 Mogan STEM 的左侧目录树功能,同时支持 PDF 阅读模式与 TMU / STEM 文档编辑模式下的多级章节大纲导航。
devel/6013.stem主要变更
Scheme 逻辑层(
TeXmacs/progs/text/text-outline.scm)(text text-drd)与(text text-structure),解决tm/section-get-title-string报unbound variable的 bug;part到subsubsection的数值化层级映射section-level;outline-clean-title,妥善处理公式与宏;build-outline-tree,生成多层嵌套大纲结构((title path-str (child ...)) ...);(outline-go-to path-str)导航过程,配合(make-cursor-visible u)驱动主编辑区视口居中滚动与光标就位。QML 现代化控件与 C++ 桥接(
OutlineSidebar.qml&OutlineBridge&qt_pdf_outline_widget)OutlineBridge为树节点赋予全局唯一node.id,消除相同页码节点折叠冲突;主窗口多 Tab 切换联动与双向事件分发(
qt_tm_widget.cpp)outlineActivated信号:PDF 模式驱动翻页,编辑模式驱动章节定位居中滚屏与焦点同步;SLOT_FILE挂载生命周期同步,自适应 PDF 书签、STEM 章节大纲与空白状态。主题适配与菜单集成
liii.css与liii-night.css中注入侧边栏样式;全量测试保障
TeXmacs/tests/6013.scm(26/26 checks passed);tests/Plugins/Qt/qt_outline_widget_test.cpp(8/8 passed);tests/Plugins/Qt/qt_pdf_reader_widget_test.cpp(49/49 passed);TeXmacs/tests/1322.scm(6/6 passed);tests/mogan/python/6013.py。