dsh-vscode-mode 0.1.61 → 0.1.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-vscode-mode",
3
- "version": "0.1.61",
3
+ "version": "0.1.62",
4
4
  "description": "DSH 上的类 VSCode 编码体验:Monaco 编辑器(文件页签/QuickOpen/状态栏,可驻 DSH 0.1.5+ 官方右侧 Sidebar 与对话同屏)+ Agent 编辑差异审查(整文件差异/采纳/拒绝/归档/回滚)+ 语言服务器(LSP)智能(跳转定义/引用/hover/大纲 + VSIX 扩展市场安装),状态持久化到工作区旁车",
5
5
  "keywords": [
6
6
  "dsh",
@@ -7,7 +7,7 @@
7
7
  [data-edrv-view] .edrv-tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 12px; border: none; border-radius: 6px 6px 0 0; background: transparent; color: var(--dsw-alias-label-secondary, #aaa); font-size: 12px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
8
8
  [data-edrv-view] .edrv-tab:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(255,255,255,.06)); }
9
9
  [data-edrv-view] .edrv-tab.edrv-tab-active { background: var(--dsw-alias-bg-base, #111); color: var(--dsw-alias-label-primary, #eee); box-shadow: inset 0 -2px 0 var(--dsw-alias-brand-primary, #4f8cff); }
10
- [data-edrv-view] .edrv-tab .edrv-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dsw-alias-brand-primary, #4f8cff); flex-shrink: 0; }
10
+ [data-edrv-view] .edrv-tab .edrv-tab-star { color: var(--dsw-alias-brand-primary, #4f8cff); font-size: 13px; font-weight: 700; line-height: 1; flex-shrink: 0; } /* 未保存修改星号 @author ddj 2026年09月09号 */
11
11
  [data-edrv-view] .edrv-tab .edrv-tab-x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; color: var(--dsw-alias-label-tertiary, #888); font-size: 11px; }
12
12
  [data-edrv-view] .edrv-tab .edrv-tab-x:hover { background: rgba(255,255,255,.12); color: var(--dsw-alias-label-primary, #eee); }
13
13
  [data-edrv-view] .edrv-tab-add { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 2px; border: none; border-radius: 6px; background: transparent; color: var(--dsw-alias-label-secondary, #aaa); font-size: 14px; cursor: pointer; flex-shrink: 0; }
@@ -142,6 +142,7 @@ export function EditorView(props) {
142
142
  const batchBusyRef = React.useRef(false) // 批量 Keep All/Undo All 防重入
143
143
  const menuHandlersRef = React.useRef(null) // 右键菜单动作的最新闭包(Monaco addAction 空依赖回调读取)
144
144
  const doSaveRef = React.useRef(null) // 保存动作的最新闭包(窗口级保存监听读取)
145
+ const onEditRef = React.useRef(null) // 编辑置脏的最新闭包(Monaco 内容变化监听经 ref 调用,防首帧 active=null 陈旧闭包)
145
146
  const saveViewStateRef = React.useRef(null) // 视图状态保存的最新闭包(卸载清理读取,避免过期 active)
146
147
  const diffRendererRef = React.useRef(null)
147
148
  const layoutRef = React.useRef(layout) // ensureEditor 空依赖闭包读取的稳定布局
@@ -913,6 +914,8 @@ export function EditorView(props) {
913
914
  if (saveTimerRef.current) saveTimerRef.current()
914
915
  saveTimerRef.current = schedule(() => doSave(true), 700)
915
916
  }
917
+ // @author ddj 2026年09月09号 空依赖监听只持有首帧 onEdit(active 恒 null→提前返回,星号与自动保存从未生效):每次渲染同步最新闭包
918
+ onEditRef.current = onEdit
916
919
 
917
920
  // model 同步(当前内容)
918
921
  React.useEffect(() => {
@@ -1007,7 +1010,7 @@ export function EditorView(props) {
1007
1010
  // 保存改由窗口级快捷键监听执行(键位可配置;见上方 edrv.save 监听)
1008
1011
  ed.onDidChangeModelContent(() => {
1009
1012
  if (!ed.getModel() || programmaticRef.current) return
1010
- onEdit()
1013
+ onEditRef.current?.()
1011
1014
  })
1012
1015
  ed.onDidChangeCursorPosition((e) => {
1013
1016
  setCursor('Ln ' + e.position.lineNumber + ', Col ' + e.position.column)
@@ -1480,7 +1483,9 @@ export function EditorView(props) {
1480
1483
  },
1481
1484
  },
1482
1485
  React.createElement('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis', maxWidth: 180 } }, t.path.split(/[\\/]/).pop() || t.path),
1483
- (dirtyMap[t.path] ? React.createElement('span', { className: 'edrv-tab-dot' }) : null),
1486
+ // 未保存修改页签显示 * 星号(保存成功消失、失败持续);替换原圆点脏标记
1487
+ // @author ddj 2026年09月09号
1488
+ (dirtyMap[t.path] ? React.createElement('span', { className: 'edrv-tab-star', title: '未保存修改' }, '*') : null),
1484
1489
  React.createElement('span', { className: 'edrv-tab-x', onClick: (e) => { e.stopPropagation(); closeTab(t.path) } }, '×'))),
1485
1490
  (openInput
1486
1491
  ? React.createElement('input', { className: 'edrv-path-input', autoFocus: true, placeholder: '输入工作区相对/绝对路径,回车打开', value: pathDraft, onChange: (e) => setPathDraft(e.target.value), onKeyDown: (e) => { if (e.key === 'Enter') openPath(); if (e.key === 'Escape') setOpenInput(false) } })