dsh-gufa-code 1.1.4 → 1.1.6

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/client.js CHANGED
@@ -1027,6 +1027,9 @@ G.errorText = (error) => {
1027
1027
  G.CSS = `
1028
1028
  .gufa-overlay-root{position:fixed;inset:0;z-index:1;display:flex;box-sizing:border-box;background:var(--gufa-solid-bg, var(--dsw-alias-bg-base));pointer-events:auto;overflow:hidden}
1029
1029
  .gufa-backdrop{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
1030
+ /* 桌宠(@linxin666/dsh-pet)在 IDE 模式提到覆盖层之上,避免被古法编程面板遮住 */
1031
+ html[data-gufa-ide] div[data-dsh-pet-root]{position:fixed;inset:0;z-index:2147483400;pointer-events:none}
1032
+ html[data-gufa-ide] div[data-dsh-pet-root] *{pointer-events:auto}
1030
1033
  .gufa-backdrop-page{position:absolute;inset:0;transition:background-color 200ms linear}
1031
1034
  .gufa-backdrop-glow{position:absolute;inset:0;pointer-events:none;
1032
1035
  background:
@@ -1301,8 +1304,6 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
1301
1304
  .gufa-project{appearance:none;border:0;background:transparent;font:inherit;color:inherit;cursor:pointer}
1302
1305
  .gufa-project:hover{background:var(--gufa-hover)}
1303
1306
  .gufa-workspace-row{height:auto;min-height:38px;padding:5px 8px}
1304
- .gufa-workspace-row-wrap{display:flex;align-items:center;gap:4px}
1305
- .gufa-workspace-row-wrap .gufa-workspace-row{flex:1 1 auto;min-width:0}
1306
1307
  .gufa-workspace-title{display:block;font-size:12px;line-height:1.3}
1307
1308
  .gufa-workspace-path{display:block;font-size:10.5px;color:var(--gufa-text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1308
1309
  .gufa-project{display:flex;align-items:center;gap:6px;min-width:0;margin-left:6px;padding:3px 9px;border-radius:7px;
@@ -9965,8 +9966,6 @@ G.GufaApp = function GufaApp(props) {
9965
9966
  }))
9966
9967
  }, [])
9967
9968
 
9968
- /* 「仅切换 IDE 项目」:项目固定为用户手动打开的目录,不跟随 DSH 会话/工作区 */
9969
- const projectPinnedRef = useRef(false)
9970
9969
  /* 会话弹窗里选了别的工作区的会话:右侧会话保持不动,不再自动把 IDE 项目切过去 */
9971
9970
  const sessionPinnedRef = useRef(false)
9972
9971
 
@@ -9975,7 +9974,7 @@ G.GufaApp = function GufaApp(props) {
9975
9974
  * (重启恢复、手动切换会话后常见)。项目根变化时自动切到当前工作区的会话。 */
9976
9975
  const dockSyncRef = useRef('')
9977
9976
  useEffect(() => {
9978
- if (projectPinnedRef.current === true || sessionPinnedRef.current === true) return undefined
9977
+ if (sessionPinnedRef.current === true) return undefined
9979
9978
  if (project === null || typeof project.root !== 'string' || project.root === '') return undefined
9980
9979
  if (dockSyncRef.current === project.root) return undefined
9981
9980
  if (typeof sessionCwd === 'string' && sessionCwd !== '' && sessionCwd === project.root) {
@@ -10227,7 +10226,6 @@ G.GufaApp = function GufaApp(props) {
10227
10226
  /* 点击左侧工作区名 → 切换已有工作区(与经典模式同一份 workspace 列表) */
10228
10227
  const switchWorkspace = useCallback(async (workspace) => {
10229
10228
  if (workspace === null || workspace === undefined) return
10230
- projectPinnedRef.current = false
10231
10229
  sessionPinnedRef.current = false
10232
10230
  const service = workspaceService()
10233
10231
  try {
@@ -10264,21 +10262,6 @@ G.GufaApp = function GufaApp(props) {
10264
10262
  }, [openProjectPath, closeWorkspaceDialog, showBanner])
10265
10263
 
10266
10264
  /* 新建工作区:走经典模式同样的「选目录 → 创建 workspace → 打开并新建会话」 */
10267
- /* 只切换 IDE 项目目录,不切换 DSH 会话/工作区(方便在同一个会话里边看别的项目边聊) */
10268
- const pinProjectOnly = useCallback(async (workspace) => {
10269
- if (workspace === null || workspace === undefined || typeof workspace.path !== 'string' || workspace.path === '') return
10270
- try {
10271
- projectPinnedRef.current = true
10272
- sessionPinnedRef.current = false
10273
- await openProjectPath(workspace.path)
10274
- closeWorkspaceDialog()
10275
- showBanner('已切换 IDE 项目(当前会话保持不变)', 'success')
10276
- } catch (error) {
10277
- projectPinnedRef.current = false
10278
- setBanner(G.errorText(error))
10279
- }
10280
- }, [openProjectPath, closeWorkspaceDialog, showBanner])
10281
-
10282
10265
  const createWorkspace = useCallback(async () => {
10283
10266
  const ui = workspaceService()
10284
10267
  const registry = workspacesService()
@@ -11116,36 +11099,25 @@ G.GufaApp = function GufaApp(props) {
11116
11099
  ? h('div', { className: 'gufa-hint', style: { padding: '10px 8px' } }, t('workspace.empty'))
11117
11100
  : workspaceDialog.workspaces.map((workspace) =>
11118
11101
  h(
11119
- 'div',
11120
- { key: workspace.id, className: 'gufa-workspace-row-wrap' },
11102
+ 'button',
11103
+ {
11104
+ key: workspace.id,
11105
+ type: 'button',
11106
+ className: 'gufa-branch-row gufa-workspace-row',
11107
+ 'data-current': project !== null && project.root === workspace.path ? '' : undefined,
11108
+ title: workspace.path,
11109
+ onClick: () => void switchWorkspace(workspace),
11110
+ },
11111
+ h(G.Icon, { name: 'folder-open', size: 13 }),
11121
11112
  h(
11122
- 'button',
11123
- {
11124
- type: 'button',
11125
- className: 'gufa-branch-row gufa-workspace-row',
11126
- 'data-current': project !== null && project.root === workspace.path ? '' : undefined,
11127
- title: `切换工作区 + 会话:${workspace.path}`,
11128
- onClick: () => void switchWorkspace(workspace),
11129
- },
11130
- h(G.Icon, { name: 'folder-open', size: 13 }),
11131
- h(
11132
- 'span',
11133
- { className: 'gufa-branch-name' },
11134
- h('span', { className: 'gufa-workspace-title' }, workspace.title !== '' ? workspace.title : G.basename(workspace.path)),
11135
- h('span', { className: 'gufa-workspace-path' }, workspace.path),
11136
- ),
11137
- project !== null && project.root === workspace.path
11138
- ? h('span', { className: 'gufa-branch-tag' }, t('workspace.current'))
11139
- : null,
11113
+ 'span',
11114
+ { className: 'gufa-branch-name' },
11115
+ h('span', { className: 'gufa-workspace-title' }, workspace.title !== '' ? workspace.title : G.basename(workspace.path)),
11116
+ h('span', { className: 'gufa-workspace-path' }, workspace.path),
11140
11117
  ),
11141
- h(G.IconButton, {
11142
- title: '只切换 IDE 项目(保持当前会话)',
11143
- onClick: (event) => {
11144
- event.preventDefault()
11145
- event.stopPropagation()
11146
- void pinProjectOnly(workspace)
11147
- },
11148
- }, h(G.Icon, { name: 'panel-left', size: 13 })),
11118
+ project !== null && project.root === workspace.path
11119
+ ? h('span', { className: 'gufa-branch-tag' }, t('workspace.current'))
11120
+ : null,
11149
11121
  ),
11150
11122
  ),
11151
11123
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gufa-code",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "古法编程 · AI 辅助:一键把 DSH 主面板变成 VS Code 风格 IDE(Monaco 编辑器、文件树、Git、SSH、真实终端 + 右侧官方会话);主张亲手写、每个改动心中有数,AI 是助理、你是第一责任人",
5
5
  "icon": "icon.svg",
6
6
  "keywords": [
@@ -1019,6 +1019,9 @@ G.errorText = (error) => {
1019
1019
  G.CSS = `
1020
1020
  .gufa-overlay-root{position:fixed;inset:0;z-index:1;display:flex;box-sizing:border-box;background:var(--gufa-solid-bg, var(--dsw-alias-bg-base));pointer-events:auto;overflow:hidden}
1021
1021
  .gufa-backdrop{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
1022
+ /* 桌宠(@linxin666/dsh-pet)在 IDE 模式提到覆盖层之上,避免被古法编程面板遮住 */
1023
+ html[data-gufa-ide] div[data-dsh-pet-root]{position:fixed;inset:0;z-index:2147483400;pointer-events:none}
1024
+ html[data-gufa-ide] div[data-dsh-pet-root] *{pointer-events:auto}
1022
1025
  .gufa-backdrop-page{position:absolute;inset:0;transition:background-color 200ms linear}
1023
1026
  .gufa-backdrop-glow{position:absolute;inset:0;pointer-events:none;
1024
1027
  background:
@@ -1293,8 +1296,6 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
1293
1296
  .gufa-project{appearance:none;border:0;background:transparent;font:inherit;color:inherit;cursor:pointer}
1294
1297
  .gufa-project:hover{background:var(--gufa-hover)}
1295
1298
  .gufa-workspace-row{height:auto;min-height:38px;padding:5px 8px}
1296
- .gufa-workspace-row-wrap{display:flex;align-items:center;gap:4px}
1297
- .gufa-workspace-row-wrap .gufa-workspace-row{flex:1 1 auto;min-width:0}
1298
1299
  .gufa-workspace-title{display:block;font-size:12px;line-height:1.3}
1299
1300
  .gufa-workspace-path{display:block;font-size:10.5px;color:var(--gufa-text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1300
1301
  .gufa-project{display:flex;align-items:center;gap:6px;min-width:0;margin-left:6px;padding:3px 9px;border-radius:7px;
@@ -787,8 +787,6 @@ G.GufaApp = function GufaApp(props) {
787
787
  }))
788
788
  }, [])
789
789
 
790
- /* 「仅切换 IDE 项目」:项目固定为用户手动打开的目录,不跟随 DSH 会话/工作区 */
791
- const projectPinnedRef = useRef(false)
792
790
  /* 会话弹窗里选了别的工作区的会话:右侧会话保持不动,不再自动把 IDE 项目切过去 */
793
791
  const sessionPinnedRef = useRef(false)
794
792
 
@@ -797,7 +795,7 @@ G.GufaApp = function GufaApp(props) {
797
795
  * (重启恢复、手动切换会话后常见)。项目根变化时自动切到当前工作区的会话。 */
798
796
  const dockSyncRef = useRef('')
799
797
  useEffect(() => {
800
- if (projectPinnedRef.current === true || sessionPinnedRef.current === true) return undefined
798
+ if (sessionPinnedRef.current === true) return undefined
801
799
  if (project === null || typeof project.root !== 'string' || project.root === '') return undefined
802
800
  if (dockSyncRef.current === project.root) return undefined
803
801
  if (typeof sessionCwd === 'string' && sessionCwd !== '' && sessionCwd === project.root) {
@@ -1049,7 +1047,6 @@ G.GufaApp = function GufaApp(props) {
1049
1047
  /* 点击左侧工作区名 → 切换已有工作区(与经典模式同一份 workspace 列表) */
1050
1048
  const switchWorkspace = useCallback(async (workspace) => {
1051
1049
  if (workspace === null || workspace === undefined) return
1052
- projectPinnedRef.current = false
1053
1050
  sessionPinnedRef.current = false
1054
1051
  const service = workspaceService()
1055
1052
  try {
@@ -1086,21 +1083,6 @@ G.GufaApp = function GufaApp(props) {
1086
1083
  }, [openProjectPath, closeWorkspaceDialog, showBanner])
1087
1084
 
1088
1085
  /* 新建工作区:走经典模式同样的「选目录 → 创建 workspace → 打开并新建会话」 */
1089
- /* 只切换 IDE 项目目录,不切换 DSH 会话/工作区(方便在同一个会话里边看别的项目边聊) */
1090
- const pinProjectOnly = useCallback(async (workspace) => {
1091
- if (workspace === null || workspace === undefined || typeof workspace.path !== 'string' || workspace.path === '') return
1092
- try {
1093
- projectPinnedRef.current = true
1094
- sessionPinnedRef.current = false
1095
- await openProjectPath(workspace.path)
1096
- closeWorkspaceDialog()
1097
- showBanner('已切换 IDE 项目(当前会话保持不变)', 'success')
1098
- } catch (error) {
1099
- projectPinnedRef.current = false
1100
- setBanner(G.errorText(error))
1101
- }
1102
- }, [openProjectPath, closeWorkspaceDialog, showBanner])
1103
-
1104
1086
  const createWorkspace = useCallback(async () => {
1105
1087
  const ui = workspaceService()
1106
1088
  const registry = workspacesService()
@@ -1938,36 +1920,25 @@ G.GufaApp = function GufaApp(props) {
1938
1920
  ? h('div', { className: 'gufa-hint', style: { padding: '10px 8px' } }, t('workspace.empty'))
1939
1921
  : workspaceDialog.workspaces.map((workspace) =>
1940
1922
  h(
1941
- 'div',
1942
- { key: workspace.id, className: 'gufa-workspace-row-wrap' },
1923
+ 'button',
1924
+ {
1925
+ key: workspace.id,
1926
+ type: 'button',
1927
+ className: 'gufa-branch-row gufa-workspace-row',
1928
+ 'data-current': project !== null && project.root === workspace.path ? '' : undefined,
1929
+ title: workspace.path,
1930
+ onClick: () => void switchWorkspace(workspace),
1931
+ },
1932
+ h(G.Icon, { name: 'folder-open', size: 13 }),
1943
1933
  h(
1944
- 'button',
1945
- {
1946
- type: 'button',
1947
- className: 'gufa-branch-row gufa-workspace-row',
1948
- 'data-current': project !== null && project.root === workspace.path ? '' : undefined,
1949
- title: `切换工作区 + 会话:${workspace.path}`,
1950
- onClick: () => void switchWorkspace(workspace),
1951
- },
1952
- h(G.Icon, { name: 'folder-open', size: 13 }),
1953
- h(
1954
- 'span',
1955
- { className: 'gufa-branch-name' },
1956
- h('span', { className: 'gufa-workspace-title' }, workspace.title !== '' ? workspace.title : G.basename(workspace.path)),
1957
- h('span', { className: 'gufa-workspace-path' }, workspace.path),
1958
- ),
1959
- project !== null && project.root === workspace.path
1960
- ? h('span', { className: 'gufa-branch-tag' }, t('workspace.current'))
1961
- : null,
1934
+ 'span',
1935
+ { className: 'gufa-branch-name' },
1936
+ h('span', { className: 'gufa-workspace-title' }, workspace.title !== '' ? workspace.title : G.basename(workspace.path)),
1937
+ h('span', { className: 'gufa-workspace-path' }, workspace.path),
1962
1938
  ),
1963
- h(G.IconButton, {
1964
- title: '只切换 IDE 项目(保持当前会话)',
1965
- onClick: (event) => {
1966
- event.preventDefault()
1967
- event.stopPropagation()
1968
- void pinProjectOnly(workspace)
1969
- },
1970
- }, h(G.Icon, { name: 'panel-left', size: 13 })),
1939
+ project !== null && project.root === workspace.path
1940
+ ? h('span', { className: 'gufa-branch-tag' }, t('workspace.current'))
1941
+ : null,
1971
1942
  ),
1972
1943
  ),
1973
1944
  ),