Menghuan1918
7a4a15292e
chore(dsh): 适配 DSH 0.2.2-rc.1(基线/peer/CI/脚本/文档 + AgentModel 与 PTC 类型变化)
2026-11-04 22:13:07 +08:00
Kunping Wang
3ce803c691
fix(changes): 修复 Changes 视角切换按钮样式
2026-11-02 20:57:24 +08:00
Menghuan1918
6417547bb5
merge origin/dev: include Context diagnostics and graph layout fixes
...
# Conflicts:
# CHANGELOG.md
2026-10-17 11:52:48 +08:00
Menghuan1918
38d94bdb98
fix(git): let commit graph fill available sidebar height
...
Replace the 460px viewport cap with flex allocation. Bound the graph section minimum so long history scrolls internally instead of stretching the outer list. Verify tall and narrow panes, preview selection, folding and long Changes lists in the mounted host.
2026-10-17 11:33:55 +08:00
Menghuan1918
4ebd3e9bdd
chore: adapt sidebar to DSH 0.2.1-alpha.5
2026-10-17 02:12:44 +08:00
Menghuan1918
88ded478de
merge pr-969 ( #969 feat(git-graph): 只读提交图) into dev(@vlln)
...
融合(D5):#969 的图谱引擎作为 Git 镜头内的「提交图」区上线,不再新增第三个镜头。
- 保留:src/git-graph.ts(有界路由 + graph-stale/graph-limit)、graph-layout.ts、
graph.module.css、CommitDetails、DiffPane 的 PaneTabStrip 与 details/content/diff 分签、
hover 卡片、引用徽章、分支筛选、无限滚动、e2e 与设计文档;
- 落位:GitGraphLens → GitGraphSection(挂在 GitLens 的 Graph 区,目标读镜头自己的
仓库/worktree 选择,不再自持选择器);行右键接回 #944 的提交菜单(查看/复制/revert/cherry-pick);
- 去掉:第三镜头与 changesGraphLens 键、#944 的 GitGraph.tsx(及随之无消费者的
log 行样式与 historyLoadError/changesNoHistory 词典键);
- 镜头常驻保留(hidden 切换):Graph 的滚动/选中、Changes 的展开与草稿切走不丢,
同时 store 槽位与轮询按「可见 + 在屏」分别门控(切回不闪 loading);
- 两套重写过的测试按新契约对齐(底部面板分签、图谱区与 Git 镜头的关系、图行/历史断言)。
2026-10-16 17:30:44 +08:00
Menghuan1918
40ed740f3a
merge pr-944 ( #944 feat(git): Git 内容区改为 VS Code Source Control 结构) into dev(@hairyf)
...
冲突解决(按 D4 与仓库现役不变量):
- status() 改为 porcelain v2(branch/upstream/ahead-behind/detached/operation 一次读回),
但保留 dev 的行/字段上限、pathspec 化 numstat 与 #909 的分侧计数;v2 记录遍历抽成
porcelainV2Tokens,状态解析与 pathspec 提取共用同一份字段知识;
- GitLens 的 Merge/Staged/Changes 三组取 #944,两组各读自己那一侧(#909),
Merge 组不印行数(冲突不是行数故事,也不许把某一侧当「这个数」);
sideEntries 保留(每组只读自己那一半的 XY 字母);
- ChangesTab 保留 #939 的官方 Tabs 外观与 a11y 包装、刷新按 #944 只留给本轮文件镜头;
- 测试:git.spec 导入取并集、rmSync 清理改回 removeTree、smoke 的 branch/detached 断言
按 porcelain v2 语义改写,其余用例按新契约微调(band 顺序、changesOps 第 4 参 wait)。
剔除夹带(D4):.agents/skills/handle/SKILL.md、eslint/vitest 的 soruce/vscode 忽略项、
webRuntime→connection.requestRejection 栅栏与 ownEntryId 放宽(index.ts / context-types.ts
取 dev)、栅栏类测试桩与注释一并回退,栅栏归属留给 0.2.1 兼容批。
2026-10-16 17:14:06 +08:00
Menghuan1918
bb23b47fa5
merge pr-886 ( #886 fix(changes): 本轮文件按会话 cwd 解析完整路径) into dev(@wang-kaopu)
...
冲突解决:README.md 取 dev、README_EN.md 保持删除、CHANGELOG 里误落 v0.25.0 段的条目删掉(发版段统一在收尾批处理);
#886 的用例去掉 groupByFile(#940 已删除该分组函数),改断言解析后的完整路径。
2026-10-16 16:39:50 +08:00
Menghuan1918
9f630d1618
merge pr-940 ( #940 fix(changes): 本轮文件操作改为平铺行) into dev(@hairyf)
...
冲突解决:README.md 取 dev(PR 基于拆分前的旧中英双 README,改动目标已不存在),
README_EN.md 保持删除;guide 的 usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]
[--no-optional-locks] [--no-advice] [--bare] [--git-dir=<path>]
[--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>]
<command> [<args>]
These are common Git commands used in various situations:
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one
work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
restore Restore working tree files
rm Remove files from the working tree and from the index
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
diff Show changes between commits, commit and working tree, etc
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
grow, mark and tweak your common history
backfill Download missing objects in a partial clone
branch List, create, or delete branches
commit Record changes to the repository
history EXPERIMENTAL: Rewrite history
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
reset Set `HEAD` or the index to a known state
switch Switch branches
tag Create, list, delete or verify tags
collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system. 行合并「平铺措辞 + 下划线 Tabs 说明」;
editor-host.spec.tsx 的 RENDER_WAIT_MS 注释保留 dev 的 CI 史,并补记 PR 的夹具泄漏结论。
2026-10-16 16:38:37 +08:00
Menghuan1918
5b6f7319f9
merge pr-909 ( #909 fix(changes): 变更面板两侧行数不再相加,各分组各读自己那一侧) into dev(@UNscientific-9)
...
冲突解决:删除 addLineCounts,状态读数改为分侧(staged/unstaged 各自一张表),
保留 dev 的 pathspec 化 numstat 读取(--literal-pathspecs + 原路径 + 行/字段上限)。
同批带上 #607 落地后暴露的两处适配:
- discoverRepoRoots 的 BFS 发现根改走 realpath(macOS tmpdir 的 /var → /private/var 别名,
否则 rev-parse 的根与扫描根是同一仓库的两种拼法,dev 的 canonical() 断言当场红);
- tests/git-worktree 的 numstat pathspec 用例按分侧形状断言(合计仍为 +3/−0)。
2026-10-16 16:35:59 +08:00
vlln
a64f5cd8e9
feat(git-graph): 图谱视图与统一的底部面板(详情 / 内容 / 差异)
...
**图谱视图**(`GitGraphLens`):分支下拉框只筛选历史,不做任何写操作;提交行
是一行 28px——泳道连线 + 引用徽章 + 标题。徽章带图标(本地分支 = 分支图标、
远程跟踪分支 = 地球),`HEAD` 不单独成徽章,而是折叠进当前分支的徽章里做前置
✓;徽章的颜色就是它所在车道的颜色,和连线、圆点走同一个五色映射。行上不再
有短 hash 与作者时间:hover 350 ms 弹一张中等密度的卡片(标题、徽章、作者·
相对时间、短 hash + 绝对日期),点击后看到的「详情」才是完整信息(完整 hash、
父提交、Markdown 正文)。列表到底自动加载下一页(IntersectionObserver +
在飞守卫),并保留手动按钮作为兜底。
**底部面板**:三个视角共用同一个可拖拽区域,标签集合**固定**为
`提交详情 / 内容 / 差异`,不随上方视角或选中项变化;没有内容的标签显示空态
(未选择提交 / 读取没有差异 / 此视图暂无内容)而不是消失——此前按选中项推导
标签集合,同一个面板看起来像三个不同的面板。选择、高度、激活标签都持久化。
**内容视图**:操作记录(read 的带行号源码;md/html/pdf 用插件自己的渲染器)
与 git 工作区文件(`fs.read` 读文件本身,二进制/超大走既有下载面板)并列。
读取是懒加载的:只为看 diff 打开文件时不会去读整个文档。md 默认渲染,html
默认源码、点了才渲染 iframe(沿用「选中不自动加载 iframe」的沙箱契约)。
**配色**:五个色槽全部用状态色令牌(business/success/warn/error + 次级灰)。
原来槽位 0 用 `brand-primary`,实测在深色主题下是 rgb(15,17,21),主线几乎
不可见——状态色是给细线和小字设计的,两种主题下都能读。
顺带:Git 视角把当前仓库 / 工作树报给父组件(`onTargetChange`),图谱与预览
才能跟着同一个目标走。
测试:`tests/git-graph-ui.spec.tsx`(19 项:请求时机、错误与重试、分页游标、
竞态与中止、行结构、HEAD 折叠、hover 卡片、自动加载)、`tests/changes-tab.spec.tsx`
(固定三标签在各视角一致、内容视图懒加载、箭头键在标签间移动)、
`tests/markdown-surface.spec.tsx`(内容视图里的 markdown 链接认领)。
2026-10-15 20:44:33 -07:00
hairyf
812f1e9e70
fix(git): stage with the plus glyph and restore the tree indent guides
...
The per-row and per-directory stage action drew the unstage minus in every
group (vscode splits these as $(add) / $(remove)), and the SCM tree lost the
indent guides the pre-SCM nested tree drew. Staging rows now carry the host's
Plus, unstaging rows the minus, and every level above a row paints its 1px
border-l1 hairline in the same 12px column as before.
2026-10-14 00:09:47 +08:00
hairyf
4e1056fe66
fix(git): drop the redundant untracked note, square the count pill, pin the footer
...
The U badge already says a row is untracked, so the extra 新文件 note is a second label for the same fact; git never diffs those rows and the binary mark still covers blobs. The group count pill now takes the kit's sm control radius (--dsw-radius-sm) instead of a 20px circle. The branch/sync footer keeps its flex docking and is additionally sticky bottom:0, so a host tab body that scrolls the whole tab cannot carry the branch control off the bottom of the pane (#941 ).
2026-10-13 23:13:00 +08:00
hairyf
228b753ad2
fix(git): finalize reviewed SCM groups and scope-safe actions
2026-10-13 22:42:16 +08:00
hairyf
3a1cf3d4b7
fix(changes): flatten session operation rows
2026-10-13 16:18:07 +08:00
hairyf
872a975e15
fix(changes): reuse official conversation Tabs styling
2026-10-13 15:49:04 +08:00
unsc9
bdf3c33865
fix(changes): 变更面板两侧行数不再相加,各分组各读自己那一侧(#131)
...
同一文件同时有已暂存与未暂存改动(porcelain 'MM')时,status() 把
`git diff --cached --numstat`(index 对 HEAD)与 `git diff --numstat`
(worktree 对 index)按路径相加成一个数。两次 diff 的基线不同,相加会把
两者都看到的那几行算两遍:改写一行并暂存、再改同一行,两组各自显示
`+2 −2`,真值只有 `+1 −1`;面板里该文件出现两次,于是同一个虚高值被印
两遍、也被两个分组头各合计一遍。原注释写的「两侧都是对 HEAD 量的」前提
不成立——不带 --cached 的 git diff 量的是 worktree 对 index。
改为让两侧各自保留读数,一路传到分组:
- src/git.ts / src/client/api.ts:`counts` 拆成 `staged` / `unstaged`,
各查各的 numstat 表;删掉 addLineCounts
- src/client/changes/change-tree.ts:`buildChangeTree(entries, side)`
按分组取自己那一侧,叶子上的 `counts` 因此只代表所在分组
- src/client/changes/GitLens.tsx:两个分组各传自己的 side;内容键改成
同时含两侧,否则「只动了一侧的行数」不会重建树
- src/client/ui/git-status.ts:快照比较逐侧比,语义与原来一致
用例:`tests/git.spec.ts` 新增真实仓库用例钉住 `MM` 的两侧读数并断言不再
出现相加值(原用例正好钉着旧行为,一并改);`tests/change-tree-counts.spec.ts`
与 `tests/git-view-worktree.spec.tsx` 钉住每个分组只读自己那一侧。
2026-10-10 20:07:32 +08:00
Menghuan1918
504d428b79
fix(git-lens): 纯重命名不再计入分组合计,计数簇改用字体令牌(#131)
...
(a) numstat 为 0/0 的条目(纯重命名、仅改权限)行上什么都不打印,但
sumLineCounts 仍把它计进 files,于是「只含纯重命名的分组」在分组头渲染
出一个空的 +N −M 计数簇。合计函数改为跳过两侧都为 0 的条目:合计=「行上
真的打印出来的数字之和」,与既有「二进制 / 未跟踪不贡献任何数」同一条
口径。只改这一个源头,两个分组头共用的 files > 0 门控不用动。
(b) .lineCounts 的裸 font-size: 10px 换成 font: var(--dsw-font-xxxs-11)
(11px/14px,weight 400),并按简写要求在其后用 font-family 覆盖回
--ds-font-family-code 代码字体。前后值:10px(行高继承 18px)→ 11px/14px;
行与分组头都是 28px 固定高度、文字 18px 行高,故布局不变,只有数字本身
大 1px。
测试:
- change-tree-counts:新增 0/0 条目不参与合计(纯重命名 / 仅改权限),
同时钉住「改了内容的 rename 仍贡献数字」。
- changes-tab:新增「只含纯重命名的两个分组都查不到 [data-lines="group"]
空计数簇」用例(并断言两个重命名行确实渲染了,避免空过),配一条对照
用例「组内真有数字时计数簇照常出现且数字正确」;另加一条样式守护,钉住
.lineCounts 走 --dsw-font-* 令牌、不含裸 font-size px。
- 还原源码/CSS 改动后这三条全红(空 span 被断言到、font 令牌断言失败)。
2026-10-05 22:39:22 +08:00
Menghuan1918
97ba41d441
fix(git-lens): 分支条与提交框移出滚动体,只有列表内层滚动(#194)
2026-10-05 22:13:00 +08:00
Menghuan1918 and rainmanhhh
6615f63602
feat(git): AI 生成提交信息(Ctrl+G、多行提交框、可固定生成模型)
...
移植 PR #642(refs/tmp/pr642 → 当前 dev 重写,不机械解冲突)。
复用(与 dev clean 或纯逻辑无冲突面):
- src/commit-message.ts 纯逻辑模块原样取用:prompt 契约、provider/model 路由
词法、reasoning effort 取最低档、宽容的 provider/model 目录读取、建议文本清理。
- host 半边(git.suggest-message / git.commit-model / git.models 三条路由 +
pinned / 会话 / agent-default-model 三级路由解析)按 dev 现状重贴:ctx.llm、
agentDefaultModel、git.status/diff、sessionId 参数名逐条对照本机 0.2.0-rc.1 核实。
- 设置缝复用 dev 已有的 SidebarSettingsRenderProps + settings.render(PR 侧写在
同一接口上,零适配)。
- 三个新 spec 原样取用,只有 git-suggest 的 harness 改了「visible 默认 true」——
dev 的共享 git-status store 只在可见时订阅,不可见时 snapshot 恒 null,
commit bar 根本不渲染(PR 作者当年跑绿的是本机未提交状态)。
丢弃 / 按 dev 重写:
- PR 的 GitLens 客户端半边基于 #471 重写前的 GitLens:提交栏在 dev 已是
primitives Input + commitBar/commitRow/commitInput,且 Ctrl/Cmd+Enter 提交
已存在(重复实现)。现按 dev 的 .commitRow 结构重做多行 textarea + 自动增高,
保留既有快捷键,并追加 Ctrl/Cmd+G。
- 六个 Icon*16 具名导入在 0.2.0-rc.1 一个不剩(§3.1 第 2 条:缺导出 = render 期
Element type is invalid),改用 IconSparkleRegular size={14}。
- CSS 类名跟随 dev 的 commit* 前缀(PR 的 gitCommit*/gitSuggest*/gitError 在 dev
已不存在;错误行改走 dev 的 Notice,不新增自绘错误样式)。
- 消息 source kind 用生产者自有值 plugin:dsh-better-sidebar:0.1.7 起
kind:'plugin' 会被 format v4 硬拒。
- locales:dev 已删 commitError 锚点,且 19 份词典与 locales.ts 必须键集相等,
故按各文件在 commit 行后逐份插入,不整份取 PR 侧。
验收:pnpm typecheck 0;pnpm exec vitest run --maxWorkers=3 全绿(163 files /
1836 tests);新增 spec 单独跑绿;真机挂载冒烟未跑(见报告)。
Refs #642
Co-authored-by: rainmanhhh <13862623+rainmanhhh@users.noreply.github.com >
2026-10-05 02:19:58 +08:00
Menghuan1918
b011be1e98
feat(sidebar): 打开方式双源并存 + 多选压缩下载 + 文件变动层级树
...
用户追加三条需求,全部落地:
1) 打开方式 = 宿主探测应用 + 插件自研 open-with(并存)
- 逐字恢复 src/client/open-with.ts / open-with-settings.tsx / plugin-settings.ts /
src/open-external.ts / open.external 路由 / api.openExternal / editor descriptor
的 settings.render,以及 20 个 openWith* 词条(19 份词典从 main 取回原文)
- 恢复 menu-flip.ts + layout.css 子菜单翻转规则(子菜单回来了)
- FileTree 菜单段(无标题行):宿主行 → 分隔线 → 插件 pinned + 「在应用中打开 >」
子菜单(图钉 / SSH 后缀原样)→ 分隔线 → 宿主 reveal;宿主可用时过滤插件
explorer 目标,宿主不可用时插件行照旧(SSH 远端场景保持可用)
- 死键清理:菜单去掉标题行后 openInApp 词条无引用,已从 21 份词典删除
2) 文件页多选右键「压缩并打包下载」
- 新增 src/zip.ts(自研 ZIP:方法 0/8 按收益二选一、UTF-8 bit 11、目录条目、
自实现 CRC32、无第三方依赖)+ src/archive-route.ts(名净化 + 递归收集)+
GET /sidebar/archive(同一道 workspace fence、目录递归跳过符号链接、
10000 条目 / 256 MiB 上限)+ api.archiveUrl
- FileTree:多选 ≥2 项或单选目录时出现;fetch → blob → objectURL 下载,
路由错误(超限 / fence / 非 GET)以 zipFailed 显示在错误条
- 修掉真实缺陷:central directory 只写 MS-DOS 位而 version-made-by 声称 Unix,
Info-ZIP 会把每个文件解成 mode 000;改为 Unix 语义(0o100644 * 0x10000,
<< 16 会溢出 int32)。系统 unzip 复验:mode 644/755、unzip -t 无错
3) 文件变动页层级树 + 视觉打磨
- 新增 src/client/changes/change-tree.ts:单子目录链压缩成一行、目录先于文件、
大小写不敏感排序、文件带 GitFileStatus、目录带下级变更数
- GitLens 两组各自渲染树:折叠状态按「组+路径」独立、默认展开;分组头吸顶 +
计数胶囊;Stage all/Unstage all 改为带 aria-label 的 IconButton;选中 =
interactive-bg-active + 2px 内嵌强调条;12px/级缩进 + l1 参考线;
历史行 hash 徽标 / ref 胶囊 / 作者·时间右对齐
验证:typecheck / lint / test(134 文件 1422 通过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过;
真实宿主截图确认三条需求(多选+双源菜单+zip 项、变动页树形层级)
2026-09-28 18:08:21 +08:00
Menghuan1918
36fbc5ac7e
feat(sidebar): 文件页与文件变动页 UIUX 重构 + 全局组件抽取
...
文件页(FileTree/TreePanel)
- Ctrl/Cmd 多选 + Shift 按可见行序连选(Esc/点空白/右键收敛),批量条支持复制路径、批量删除(共享 ConfirmDialog + 顺序 fsRemove)
- Git 变更着色:行名按状态上色 + M/A/D/U 徽标,目录按 dirHasChanges 着色,非仓库静默降级(数据来自共享 git 状态存储)
- 新建文件夹:fs.mkdir 路由 + mkdirWorkspaceEntry + 内联输入行(Enter/Esc/blur/IME 守卫)
- 性能:FileRow/DirRow memo(含反向验证)、搜索 hidden 停车不再卸载树、level 拉取世代守卫 + AbortController、fs.tree truncated 提示、use-dir-watch 入参 memo
- 拖拽上传视觉 token 化(硬编码色清零);可见性下传后隐藏页签停止轮询
- 右键「打开方式」改为复用 DSH 自带 open-in-app(宿主探测的关联应用 + 文件管理器显示)
文件变动页(changes/diff)
- 36px 头(宿主 SegmentedControl)+ 单一 ChangeRow + SectionHeader 分组 + 吸底提交条单状态行 + 历史独立空态
- 修掉:双份空态、暂存失败 unhandled rejection、手动刷新被丢、仓库切换刷新两次、worktree 清单缺 repoRoot、工作树被自动切走、预览持旧快照、恢复高度未 clamp、session ops 无谓轮询
- DiffPane/DiffTab 共用 use-git-diff;修掉 DiffPane 的 untracked 预览从不渲染
全局组件与宿主接入
- 新增 src/client/ui(IconButton/Chip/SectionHeader/Notice/ConfirmDialog/StatusBadge + 共享 git 状态存储)
- 新增 src/client/open-in-app.ts(宿主 open-in-app 客户端适配),删除自研 open-with 全链路与 open.external 路由
- 客户端 inject 补 remote / remote.session:缺声明时 ctx.get('remote').session 会抛出并把整个面板打成错误条(真实挂载 lane 抓到)
- 词典:+25 键 / -20 openWith* / -noChanges,20 份同步
验证:typecheck / lint / test(126 文件 1322 通过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过(含 tab sweep 与 perf lane)
2026-09-28 00:27:31 +08:00
lhh010
16d8df2e93
Merge remote-tracking branch 'origin/main' into feat/changes-md-reading
...
# Conflicts:
# src/client/changes/DiffPane.tsx
# src/client/locales-ar.ts
# src/client/locales-de.ts
# src/client/locales-fr.ts
# src/client/locales-hi.ts
# src/client/locales-id.ts
# src/client/locales-it.ts
# src/client/locales-ja.ts
# src/client/locales-ko.ts
# src/client/locales-nl.ts
# src/client/locales-pl.ts
# src/client/locales-pt.ts
# src/client/locales-ru.ts
# src/client/locales-sv.ts
# src/client/locales-th.ts
# src/client/locales-tr.ts
# src/client/locales-vi.ts
# src/client/locales-zh-HK.ts
# src/client/locales-zh-MO.ts
# src/client/locales-zh-TW.ts
2026-09-04 14:13:34 +08:00
Menghuan1918
936df662b0
test(specs): 收敛 28 个组件 spec 的渲染样板到共享 test-utils
...
- 7 个 spec 的本地 mount()(createRoot + act 容器循环)替换为
renderRoot():sidechat-view、subagent-jobs-view、subagent-live-polling、
lazy-chunk、side-card-section-rows(本地 mount 删除,调用点改名);
editor-refresh、markdown-manual-refresh(EditorHost 包装 mount 改为
委托 renderRoot,调用点不动)
- 24 个 spec 的内联 IS_REACT_ACT_ENVIRONMENT 赋值替换为 setupReactAct()
(subagent-jobs-view / subagent-live-polling / lazy-chunk 原本未设
flag,保持原样不引入)
全部为语义相同的样板替换:迁移后全量 118 files / 1241 passed +
9 skipped,与迁移前一致。
2026-09-03 12:04:35 +08:00
lhh010
b7138cf4fd
feat(changes): markdown reading mode for .md op previews
...
The changes tab preview pane gains a Reading/Raw toggle for .md/.markdown/.mdx session ops (read, write, and edit alike). Reading mode renders the resulting document through the shared MarkdownText pass (the same stack as the editor preview): GFM tables with alignment, task lists, strikethrough, footnotes, math, and code fences, with local image destinations rewritten through the session-scoped /sidebar/file media route (rewriteLocalImageUrls). Content sources: read -> parseReadContent (envelope stripped, blank lines preserved — markdown block structure depends on them, which parseReadLines drops); write -> the written content; edit -> the reconstructed resulting document from the in-window prior content when known, else the new snippet. Ported from dsh-file-trace v0.2.0 (PR #471 lineage), re-based onto the unified changes tab (#475 ) and the repo shared-renderer conventions (markdownTextProps labels contract, skin tokens, 21-dictionary locale parity).
2026-09-01 18:23:28 +08:00
Menghuan1918
f024fbf092
fix(changes): 会话事件改走宿主 changes.ops 路由 + diff 展开二级设置 + 视觉迭代
...
CI 修复(plugin-mount 的 ctx.sessions.get TypeError ×1003):
- 客户端 runtime 无事件日志面——badge/SessionLens 原在客户端直读
ctx.sessions.get(id).events / ctx.on('session/event'),全部不可达。
- 新增宿主路由 changes.ops:live 会话日志优先,冷会话回放
sessionPersistence.inspect;afterSeq 增量(缺省游标含 seq 0,
显式游标为 seq > afterSeq,同 sidechat.events 约定),窗口上限
4000 与客户端累加器一致。
- ChangesTab 轮询(mount 一拉 + visible 2.5s 增量)折入 ops,写
模块级 opCounts 缓存供 badge 同步读取;SessionLens 改纯展示。
diff 展开二级设置(changesDiffFloat,默认浮窗):
- prefs 四处接线 + git tab settings select(浮窗/面板,图标选项卡)
- 预览面板「展开为 diff tab」按设置落点:浮窗居中弹出或源 pane
下方 split;i18n 全 21 词典同步。
视觉迭代(真机挂载截图审查后调整):
- Session 视角:kind 徽章为左轨,大小+相对时间右对齐元列;失败
操作行红色内嵌条;文件组头降为三级标签并加组间距。
- Git 视角:untracked '?' 徽章与新增同绿色;stage 按钮改 plus 图标。
- diff 折叠行:可展开折叠带 › 箭头 + 次级对比度,静态 gap 不再
显示 pointer/hover;预览头路径改尾部截断(RTL 技巧,保文件名)。
验证:typecheck ✓ / vitest 1123 ✓ / pnpm test:mount(钉 alpha.2 CLI)
14/14 ✓;真机挂载截图(badge=5、双视角、浮窗展开)0 console error。
2026-08-31 17:52:59 +08:00
Menghuan1918
24a3813c63
feat!: 合并 Git 面板与文件追踪为统一「文件变动」tab(双视角 + 统一 diff 栈)
...
在 PR #471(file-trace)基础上的演进:
- 合并 tab:git tab(id 保留,兼容持久化布局)升级为「文件变动」双视角
tab——Git 视角(原 GitView 全部能力:staged/unstaged/提交/历史/worktree·
子仓库选择/右键菜单/确认弹窗)+ 本轮文件视角(原 file-trace:会话事件
日志实时折叠的模型读写编辑记录,按文件分组、新增类型筛选 chips、相对
时间);file-trace tab 移除(未随任何版本发布)。
- 统一 diff 组件:新 src/client/diff/ 模块(rows.ts 引擎 + DiffRows/
DiffFiles 渲染器 + highlight.ts 语法着色)——git diff 与会话操作 diff
共用一套渲染:mod 改写配对(del-run/add-run 对半标蓝)、行内字符级
高亮(修复了旧实现旧侧失配不高亮的问题,改为行对象身份键)、上下文
hunk 折叠、git hunk 间未输出区间按行号范围生成不可展开折叠、语法着色
色相落位 diff 三色空档、+n −m 统计 chips、行底色 tint;DiffTab 改用
该栈(git diff tab 从此也有高亮)。
- 交互:两视角共用底部可拖拽预览面板(点击文件/提交/操作即预览,不再
直接开 diff tab;面板可刷新、可键盘/拖拽调高、git 目标可一键展开为
独立 diff tab);视角选择与面板高度持久化在 tab.meta;git 行 XY 徽章
按状态字母着色;选中行高亮。
- i18n:fileTrace* 十键重命名为 changes* 前缀,git 键值更新为「文件
变动」,新增 7 键(视角/筛选/面板操作),全部 21 个词典同步。
- 结构:src/client/changes/(ChangesTab/GitLens/SessionLens/DiffPane/
ops)+ src/client/diff/;GitView/DiffView/filetrace/ 删除;git 样式
从 sidebar.module.css 迁至 changes.module.css。
- 测试:builtins 8→7(git tab 承接 badge pin)、diff-rows(unified
转换/mod 配对/间隙折叠/统计)、changes-tab(壳交互 jsdom)、
diff-files-collapse(原 DiffView 折叠行为钉住)、changes-ops(原
filetrace 数据层)、git-view-worktree 迁移至 GitLens;全量 1122 通过。
- 文档:README ×2 功能矩阵合并、external-plugin-guide §4.4 与内置清单
7 tab、mount e2e 菜单标题同步。
2026-08-31 01:31:22 +08:00