dsh-gufa-code 1.1.4 → 1.1.5

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
@@ -1301,8 +1301,6 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
1301
1301
  .gufa-project{appearance:none;border:0;background:transparent;font:inherit;color:inherit;cursor:pointer}
1302
1302
  .gufa-project:hover{background:var(--gufa-hover)}
1303
1303
  .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
1304
  .gufa-workspace-title{display:block;font-size:12px;line-height:1.3}
1307
1305
  .gufa-workspace-path{display:block;font-size:10.5px;color:var(--gufa-text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1308
1306
  .gufa-project{display:flex;align-items:center;gap:6px;min-width:0;margin-left:6px;padding:3px 9px;border-radius:7px;
@@ -9965,8 +9963,6 @@ G.GufaApp = function GufaApp(props) {
9965
9963
  }))
9966
9964
  }, [])
9967
9965
 
9968
- /* 「仅切换 IDE 项目」:项目固定为用户手动打开的目录,不跟随 DSH 会话/工作区 */
9969
- const projectPinnedRef = useRef(false)
9970
9966
  /* 会话弹窗里选了别的工作区的会话:右侧会话保持不动,不再自动把 IDE 项目切过去 */
9971
9967
  const sessionPinnedRef = useRef(false)
9972
9968
 
@@ -9975,7 +9971,7 @@ G.GufaApp = function GufaApp(props) {
9975
9971
  * (重启恢复、手动切换会话后常见)。项目根变化时自动切到当前工作区的会话。 */
9976
9972
  const dockSyncRef = useRef('')
9977
9973
  useEffect(() => {
9978
- if (projectPinnedRef.current === true || sessionPinnedRef.current === true) return undefined
9974
+ if (sessionPinnedRef.current === true) return undefined
9979
9975
  if (project === null || typeof project.root !== 'string' || project.root === '') return undefined
9980
9976
  if (dockSyncRef.current === project.root) return undefined
9981
9977
  if (typeof sessionCwd === 'string' && sessionCwd !== '' && sessionCwd === project.root) {
@@ -10227,7 +10223,6 @@ G.GufaApp = function GufaApp(props) {
10227
10223
  /* 点击左侧工作区名 → 切换已有工作区(与经典模式同一份 workspace 列表) */
10228
10224
  const switchWorkspace = useCallback(async (workspace) => {
10229
10225
  if (workspace === null || workspace === undefined) return
10230
- projectPinnedRef.current = false
10231
10226
  sessionPinnedRef.current = false
10232
10227
  const service = workspaceService()
10233
10228
  try {
@@ -10264,21 +10259,6 @@ G.GufaApp = function GufaApp(props) {
10264
10259
  }, [openProjectPath, closeWorkspaceDialog, showBanner])
10265
10260
 
10266
10261
  /* 新建工作区:走经典模式同样的「选目录 → 创建 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
10262
  const createWorkspace = useCallback(async () => {
10283
10263
  const ui = workspaceService()
10284
10264
  const registry = workspacesService()
@@ -11116,36 +11096,25 @@ G.GufaApp = function GufaApp(props) {
11116
11096
  ? h('div', { className: 'gufa-hint', style: { padding: '10px 8px' } }, t('workspace.empty'))
11117
11097
  : workspaceDialog.workspaces.map((workspace) =>
11118
11098
  h(
11119
- 'div',
11120
- { key: workspace.id, className: 'gufa-workspace-row-wrap' },
11099
+ 'button',
11100
+ {
11101
+ key: workspace.id,
11102
+ type: 'button',
11103
+ className: 'gufa-branch-row gufa-workspace-row',
11104
+ 'data-current': project !== null && project.root === workspace.path ? '' : undefined,
11105
+ title: workspace.path,
11106
+ onClick: () => void switchWorkspace(workspace),
11107
+ },
11108
+ h(G.Icon, { name: 'folder-open', size: 13 }),
11121
11109
  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,
11110
+ 'span',
11111
+ { className: 'gufa-branch-name' },
11112
+ h('span', { className: 'gufa-workspace-title' }, workspace.title !== '' ? workspace.title : G.basename(workspace.path)),
11113
+ h('span', { className: 'gufa-workspace-path' }, workspace.path),
11140
11114
  ),
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 })),
11115
+ project !== null && project.root === workspace.path
11116
+ ? h('span', { className: 'gufa-branch-tag' }, t('workspace.current'))
11117
+ : null,
11149
11118
  ),
11150
11119
  ),
11151
11120
  ),
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.5",
4
4
  "description": "古法编程 · AI 辅助:一键把 DSH 主面板变成 VS Code 风格 IDE(Monaco 编辑器、文件树、Git、SSH、真实终端 + 右侧官方会话);主张亲手写、每个改动心中有数,AI 是助理、你是第一责任人",
5
5
  "icon": "icon.svg",
6
6
  "keywords": [
@@ -1293,8 +1293,6 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
1293
1293
  .gufa-project{appearance:none;border:0;background:transparent;font:inherit;color:inherit;cursor:pointer}
1294
1294
  .gufa-project:hover{background:var(--gufa-hover)}
1295
1295
  .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
1296
  .gufa-workspace-title{display:block;font-size:12px;line-height:1.3}
1299
1297
  .gufa-workspace-path{display:block;font-size:10.5px;color:var(--gufa-text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1300
1298
  .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
  ),