增加功能,修改样式 - #19
Open
redtramp wants to merge 60 commits into
Open
Conversation
redtramp
commented
Jul 25, 2026
- 增加tab切换时,文件树同步切换
- 增加外部程序修改tab打开的文件时,给用户呈现提示面板,用户可以选择执行加载更新、忽略、查看差异等操作
- 程序界面优化
# Conflicts: # README.md
Co-Authored-By: Claude <noreply@anthropic.com>
- 多标签页:同时打开多个文件,状态按标签隔离,重启恢复 - CodeMirror 源码编辑模式 + 未保存修改保护 - 中文 README 默认显示,新增英文 README.en.md - 新增 GitHub Actions:experimental(手动)+ release(tag 触发,附加 macOS/Linux 实验包到 Release) - 生成完整图标集(含 macOS icon.icns) - 修复关闭按钮、pnpm esbuild 构建脚本
导出 PDF/HTML/DOCX 时保存对话框默认路径改为源文件同目录同名文件。感谢 @openxin2023 贡献。
- Add shortcuts registry (useShortcuts.ts) with 21 definitions, localStorage persistence, conflict detection - Add ShortcutsDialog with recording UI: click key cap -> press combo -> save - Refactor App.vue onKeydown to use getBinding() for matching - Add keymapCompartment to MarkdownEditor for dynamic CodeMirror keymap rebuild - Toolbar tooltips reactively show customized shortcuts - Filter modifier-only key presses during recording
…ze (Neilooo#15) Add tauri-plugin-window-state to persist window position and size across restarts. Thanks @andychey for the contribution!
- Refresh button saves scroll position and suppresses watcher-triggered reload, stays on current file while refreshing file tree - Use drawSelection() for separate selection layer on top of active line - Add --editor-active-line-bg: subtle active line (was --bg-active #e3f0ff) - Light mode selection: rgba(173,214,255,0.7) (was rgba(9,105,218,0.3)) - Dark mode selection: rgba(100,160,255,0.45) (was rgba(100,160,255,0.3))
- FileTree.vue: watch currentPath, collapse all dirs, expand ancestors, scrollIntoView on active file after nextTick+50ms - FileTree.test.ts: 12 Vitest tests (12 pass, RED→GREEN validated) - vite.config.ts: add vitest config with jsdom environment - package.json: add test/test:run/test:coverage scripts - deps: vitest, @vue/test-utils, jsdom, @types/jsdom TDD checkpoint: RED=5 failing tests, GREEN=12 passing tests
- App.vue: add treeScrollEl ref and watch to set __treeScrollContainer - FileTree.vue: auto-expand parent dirs and scroll to active file - FileTree.test.ts: 12 tests all passing (TDD RED→GREEN)
- Tab 接口新增 staleSince: number | null 字段 - createTab 默认 staleSince: null - 21 个测试通过
- Banner.vue: 顶部固定 banner,四个操作按钮 (重新加载/查看差异/忽略/启用自动重载) - 12 个测试通过: 渲染、按钮、事件
- DiffView.vue: 全屏 diff modal,自实现逐行 diff 算法 - 7 个测试通过: 渲染、diff 输出、事件
- TabBar.vue: 增加 (!) 警告标记,autoReload 白名单中 tab 不显示 - 8 个测试通过: 渲染、stale 标记、事件
- Banner.vue: 顶部固定 banner,四个操作按钮(重新加载/查看差异/忽略/启用自动重载) - DiffView.vue: 全屏 diff modal,自实现逐行 diff 算法 - TabBar.vue: 增加 (!) stale 警告标记,支持 autoReload 白名单 - useTabs.ts: Tab 接口新增 staleSince 字段 - App.vue: onFilesChanged 标记 stale 替代 forceReload,switchToTab 检测 stale - i18n: 新增 banner/diff 中英文翻译 - 53 个测试全部通过,lint 无错误,build 成功
2. 外部文件变更时,给出提示,由用户确定是否变更当前稳 3. 软件界面优化
# Conflicts: # package.json # pnpm-lock.yaml # src/App.vue # src/components/FileTree.vue # src/components/FindBar.vue # src/components/SearchPanel.vue # src/components/TabBar.vue # src/components/TocPanel.vue # src/composables/useTabs.ts # src/i18n/en-US.ts # src/i18n/zh-CN.ts
- 切换根目录后重启文件监听器,修复外部变更检测对非初始监听目录失效 - 自动重载白名单在存在未保存编辑时不再静默覆盖草稿(防数据丢失) - DiffView 改用 LCS 差异算法,正确处理中间插入/删除 - 更新 FileTree 失败单测(caret 文本断言改为 is-collapsed class) - 修复 TabBar 白名单路径未归一化比较的潜在 bug - FileTree 滚动容器改为 prop 传入,去除 window 全局耦合 - 清理冗余的 eslint-disable 指令 - 删除误提交的 useTabs.ts.orig
Author
|
@Neilooo 你好,感谢 review 这个 PR。为了方便你合入,附上几点说明: 本 PR 的功能
冲突已解决
合并方式建议:Squash and merge
质量与测试
一点说明
谢谢!期待你的反馈。 |
- TabBar: 右键菜单支持「关闭左侧」「关闭右侧」「关闭所有」标签 - useTabs: 新增 closeTabsLeft/closeTabsRight/closeAllTabs - App.vue: 批量关闭含未保存弹窗处理 - .viewer 预览模式改为 overflow:auto,添加 tabindex 支持键盘滚动
- 新增 tauri-plugin-system-fonts 获取系统已安装字体 - 字体下拉框显示 5 个预设 + 所有系统字体(去重排序) - 选中系统字体直接使用字体名作为 font-family - 字体下拉框增加 .font-select-wrapper 限制宽度,去除原生样式,与对话框风格统一
- 从 CSS 变量 --editor-font-family 读取字体,替代硬编码字体栈 - 使用 fontFamilyCompartment 动态配置,支持运行时切换 - MutationObserver 监听 CSS 变量变化实时更新编辑器字体
Rust 后端: - pdf_export: wait_for_valid_pdf 区分正常/损坏/IO错误三种结果 - lib: search_in_files 增加最小查询长度(2字符)和超大文件(512KB)跳过 - pdf_utils: 补充 Windows 编译所需的 Command import - tauri.conf: 设置 CSP 白名单策略 (default-src 'self') 前端 TypeScript: - App.vue: @ts-nocheck → @ts-check,修复 toReversed,升级 tsconfig lib - App.vue: getPreviewTopSourceLine 边界逻辑修正 - DiffView.vue: 清理错误的 Myers 差异算法,恢复稳定的 LCS - SettingsDialog.vue: fontSize slider 范围对齐代码逻辑 (10-28) - useHistory.ts: saveScroll 消除 O(n²) 冗余循环 - MarkdownEditor.vue: 修复 search counter 竞态条件 - useLinkRewriter.ts: 内部链接点击事件 WeakSet 去重 - useMarkdown.ts: extractHeadings 大文件(>200KB) fallback 优化
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.