dsh-gufa-code 1.3.56 → 1.3.57

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
@@ -16,7 +16,7 @@ const GUFA_NS = 'gufa-code'
16
16
  const G = {}
17
17
  G.NS = GUFA_NS
18
18
  /** 客户端构建标记(排查页面是否加载了新代码时看标题栏) */
19
- G.BUILD = '1.3.56'
19
+ G.BUILD = '1.3.57'
20
20
  G.PANEL_ID = 'gufa-code'
21
21
  /** 从哪个工作区点进来的(工作区菜单/节点按钮写入,App 启动时消费)。 */
22
22
  G.pendingEntryWorkspace = null
@@ -832,6 +832,19 @@ G.compositeColor = function compositeColor(foreground, background) {
832
832
  * @returns {{bg:string, layer:string, layer2:string, overlay:string, sidebar:string}}
833
833
  */
834
834
  G.resolveSolidPalette = function resolveSolidPalette(container) {
835
+ /* 摸鱼悬浮窗是独立的 http origin,拿不到主窗口的 DSH 主题(默认会是浅色);
836
+ 摸鱼整窗本来就是深色半透明,这里强制返回深色实色板,避免出现浅色面板/看不清的弹窗。 */
837
+ try {
838
+ if (typeof document !== 'undefined' && document.documentElement !== null && document.documentElement.hasAttribute('data-gufa-float')) {
839
+ return {
840
+ bg: 'rgb(13, 15, 19)', layer: 'rgb(20, 22, 27)', layer2: 'rgb(26, 28, 34)', overlay: 'rgb(30, 33, 40)',
841
+ sidebar: 'rgb(18, 20, 24)', text: 'rgb(244, 241, 232)', textDim: 'rgb(166, 170, 176)',
842
+ accent: 'rgb(192, 57, 43)', isDark: true,
843
+ }
844
+ }
845
+ } catch {
846
+ /* ignore */
847
+ }
835
848
  const dark = G.theme() === 'dark'
836
849
  const fallbackPage = dark ? [26, 27, 31, 1] : [250, 250, 252, 1]
837
850
  const fallbackSurface = dark ? [45, 46, 51, 1] : [255, 255, 255, 1]
@@ -1088,7 +1101,16 @@ G.CSS = `
1088
1101
  .gufa-backdrop{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
1089
1102
  /* 桌面悬浮层(摸鱼)模式:整窗半透明,透明度由 --gufa-float-alpha 控制(标题栏滑块) */
1090
1103
  html[data-gufa-float]{--gufa-float-alpha:0.55}
1091
- html[data-gufa-float] body{background:transparent!important}
1104
+ html[data-gufa-float] body{background:transparent!important;color-scheme:dark;
1105
+ --dsw-alias-label-primary:#f4f1e8!important;--dsw-alias-label-secondary:rgba(244,241,232,0.72)!important;
1106
+ --dsw-alias-bg-base:#0d0f13!important;--dsw-alias-bg-layer-1:#14161b!important;--dsw-alias-bg-layer-2:#1a1e24!important;
1107
+ --dsw-alias-bg-overlay:#22262e!important;
1108
+ --dsw-alias-border-l1:rgba(255,255,255,0.12)!important;--dsw-alias-border-l2:rgba(255,255,255,0.2)!important;
1109
+ }
1110
+ html[data-gufa-float] .gufa-root,
1111
+ html[data-gufa-float] .gufa-overlay-root{
1112
+ --gufa-solid-text:#f4f1e8!important;--gufa-solid-text-dim:rgba(244,241,232,0.68)!important;
1113
+ }
1092
1114
  html[data-gufa-float] .gufa-overlay-root,
1093
1115
  html[data-gufa-float] .gufa-root{
1094
1116
  --gufa-solid-bg:rgba(13,15,19,var(--gufa-float-alpha))!important;--gufa-bg:rgba(13,15,19,var(--gufa-float-alpha))!important;
@@ -1108,6 +1130,29 @@ html[data-gufa-float] .gufa-overlay-root::before{
1108
1130
  background:rgba(13,15,19,var(--gufa-float-alpha));z-index:1;
1109
1131
  }
1110
1132
  html[data-gufa-float] .gufa-overlay-root{background:transparent!important;padding-top:22px;box-sizing:border-box}
1133
+ /* 摸鱼模式:弹窗/菜单都在 body 级 portal 里,拿不到摸鱼覆盖层的深色主题;
1134
+ 强制给 portal 一套深色可读变量,避免出现「浅色弹窗 + 浅色文字」看不清的问题。 */
1135
+ html[data-gufa-float] #gufa-portal-root{
1136
+ --gufa-solid-bg:#121418!important;--gufa-solid-layer:#191c21!important;--gufa-solid-layer2:#1e2228!important;--gufa-solid-overlay:#23272e!important;
1137
+ --gufa-solid-text:#f4f1e8!important;--gufa-solid-text-dim:rgba(244,241,232,0.68)!important;
1138
+ --dsw-alias-bg-base:#121418!important;--dsw-alias-bg-layer-1:#191c21!important;--dsw-alias-bg-layer-2:#1e2228!important;--dsw-alias-bg-overlay:#23272e!important;
1139
+ --dsw-alias-label-primary:#f4f1e8!important;--dsw-alias-label-secondary:rgba(244,241,232,0.68)!important;
1140
+ --dsw-alias-border-l1:rgba(255,255,255,0.12)!important;--dsw-alias-border-l2:rgba(255,255,255,0.2)!important;
1141
+ color:#f4f1e8!important;
1142
+ }
1143
+ html[data-gufa-float] #gufa-portal-root .gufa-modal,
1144
+ html[data-gufa-float] #gufa-portal-root .gufa-sessions-dialog,
1145
+ html[data-gufa-float] #gufa-portal-root .gufa-workspace-dialog,
1146
+ html[data-gufa-float] #gufa-portal-root .gufa-float-picker,
1147
+ html[data-gufa-float] #gufa-portal-root .gufa-shortcuts-dialog,
1148
+ html[data-gufa-float] #gufa-portal-root .gufa-graph-dialog{background:#1b1f26!important;color:#f4f1e8!important}
1149
+ html[data-gufa-float] #gufa-portal-root .gufa-modal-backdrop,
1150
+ html[data-gufa-float] .gufa-float-backdrop{
1151
+ background:rgba(0,0,0,0.66)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
1152
+ }
1153
+ /* 摸鱼:所有 portal 弹窗/菜单/输入框不透明,保证字看得清 */
1154
+ html[data-gufa-float] #gufa-portal-root *{color:inherit}
1155
+ html[data-gufa-float] #gufa-portal-root .gufa-hint{color:rgba(244,241,232,0.72)!important}
1111
1156
  /* 摸鱼:整窗只保留「覆盖层根节点」这一层半透明底,其余面板/会话/终端全部透明,
1112
1157
  保证编辑器、会话框、终端框看到的透明度完全一致(都等于滑块的 alpha)。 */
1113
1158
  html[data-gufa-float] .gufa-overlay-root{background:rgba(13,15,19,var(--gufa-float-alpha))!important}
@@ -11795,6 +11840,7 @@ G.GufaApp = function GufaApp(props) {
11795
11840
  if (selectionTimerRef.current !== null) { window.clearTimeout(selectionTimerRef.current); selectionTimerRef.current = null }
11796
11841
  }, [])
11797
11842
 
11843
+ const uiTheme = moyuMode ? 'dark' : theme
11798
11844
  const statusBranch = project?.isGit === true && gitStatus?.branch ? gitStatus.branch : null
11799
11845
  const lineCount = activeTab === null || activeTab.kind === 'graph' ? 0 : String(activeTab.content ?? '').split('\n').length
11800
11846
 
@@ -11985,7 +12031,7 @@ G.GufaApp = function GufaApp(props) {
11985
12031
  : h(G.EditorPane, {
11986
12032
  tabs,
11987
12033
  activePath,
11988
- theme,
12034
+ theme: uiTheme,
11989
12035
  palette: solidPalette,
11990
12036
  root: project?.root ?? '',
11991
12037
  onSelectTab: handleSelectTab,
@@ -12008,7 +12054,7 @@ G.GufaApp = function GufaApp(props) {
12008
12054
  root: project?.root ?? null,
12009
12055
  visible: true,
12010
12056
  height: terminalHeight,
12011
- theme,
12057
+ theme: uiTheme,
12012
12058
  palette: solidPalette,
12013
12059
  onToggleHeight: () => patchUi({ terminalOpen: false }),
12014
12060
  }),
@@ -12028,11 +12074,12 @@ G.GufaApp = function GufaApp(props) {
12028
12074
  project,
12029
12075
  activeFile: activeFileForChat,
12030
12076
  selection: selectionForChat,
12031
- theme,
12077
+ theme: uiTheme,
12032
12078
  width: chatWidth,
12033
12079
  active: true,
12034
12080
  paused: sessionsOpen,
12035
12081
  backdrop: backdropActive,
12082
+ theme: uiTheme,
12036
12083
  sessionTitle,
12037
12084
  onOpenSessions: () => setSessionsOpen(true),
12038
12085
  onInsertCode: insertCode,
@@ -13217,6 +13264,56 @@ const GUFA_PLUGIN = {
13217
13264
  }
13218
13265
  }
13219
13266
 
13267
+ // 临时诊断(1.3.57):摸鱼窗口里点不到左树/编辑器时,看看点击落到了哪个元素
13268
+ try {
13269
+ if (document.documentElement.hasAttribute('data-gufa-float') || /[?&]gufa-float=1/.test(location.search)) {
13270
+ setTimeout(() => {
13271
+ const probeAt = (x, y) => {
13272
+ try {
13273
+ const node = document.elementFromPoint(x, y)
13274
+ if (node === null) return `${x},${y}:none`
13275
+ const cls = typeof node.className === 'string' ? node.className : ''
13276
+ return `${x},${y}:${node.tagName}.${String(cls).slice(0, 60)}`
13277
+ } catch (error) {
13278
+ return `${x},${y}:err`
13279
+ }
13280
+ }
13281
+ // 模态框深色可读性:往 portal 里塞一个临时 .gufa-modal 读计算样式
13282
+ let modalInfo = 'none'
13283
+ try {
13284
+ const host = document.getElementById('gufa-portal-root')
13285
+ if (host !== null) {
13286
+ const probe = document.createElement('div')
13287
+ probe.className = 'gufa-modal'
13288
+ probe.style.cssText = 'position:fixed;left:-9999px;top:0;width:120px;height:60px'
13289
+ host.appendChild(probe)
13290
+ const cs = window.getComputedStyle(probe)
13291
+ modalInfo = `bg=${cs.backgroundColor} color=${cs.color}`
13292
+ probe.remove()
13293
+ }
13294
+ } catch {
13295
+ modalInfo = 'err'
13296
+ }
13297
+ // 找树行实际坐标(摸鱼窗半透明,肉眼看不清哪些行是古法的)
13298
+ const rows = []
13299
+ for (let y = 80; y < 1000; y += 22) {
13300
+ try {
13301
+ const node = document.elementFromPoint(100, y)
13302
+ if (node !== null && typeof node.closest === 'function') {
13303
+ const row = node.closest('.gufa-tree-row')
13304
+ if (row !== null) rows.push(`${y}:${String(row.textContent ?? '').trim().slice(0, 24)}`)
13305
+ }
13306
+ } catch {
13307
+ /* ignore */
13308
+ }
13309
+ }
13310
+ void G.api('dev.log', { message: `float-hittest ${probeAt(135, 713)} | ${probeAt(300, 713)} | ${probeAt(900, 500)} | ${probeAt(1500, 60)} | modal[${modalInfo}] | rows[${rows.slice(0, 12).join(' ; ')}]` }).catch(() => {})
13311
+ }, 5000)
13312
+ }
13313
+ } catch {
13314
+ /* ignore */
13315
+ }
13316
+
13220
13317
  // 启动诊断:记录页面地址、真实 Host 基址与传输信息(排查桌面壳 dsh-app:// 连接问题)。
13221
13318
  try {
13222
13319
  const transport = typeof globalThis.__DSH_TRANSPORT__ === 'object' && globalThis.__DSH_TRANSPORT__ !== null ? globalThis.__DSH_TRANSPORT__ : null
@@ -63,6 +63,15 @@ static void GufaInstallTermHandler(void);
63
63
 
64
64
  static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
65
65
 
66
+ /* 无边框窗口默认 canBecomeKeyWindow=NO;显式允许成为 key/main 窗口,
67
+ 否则悬浮层里的终端/编辑器/聊天输入都收不到键盘事件。 */
68
+ @interface GufaFloatWindow : NSWindow
69
+ @end
70
+ @implementation GufaFloatWindow
71
+ - (BOOL)canBecomeKeyWindow { return YES; }
72
+ - (BOOL)canBecomeMainWindow { return YES; }
73
+ @end
74
+
66
75
  @interface GufaDragStrip : NSView
67
76
  @end
68
77
 
@@ -341,7 +350,7 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
341
350
  }
342
351
  }
343
352
 
344
- self.window = [[NSWindow alloc] initWithContentRect:frame
353
+ self.window = [[GufaFloatWindow alloc] initWithContentRect:frame
345
354
  styleMask:(NSWindowStyleMaskBorderless | NSWindowStyleMaskResizable)
346
355
  backing:NSBackingStoreBuffered
347
356
  defer:NO];
@@ -7,8 +7,8 @@
7
7
  <key>CFBundleDisplayName</key><string>古法编程悬浮层</string>
8
8
  <key>CFBundleExecutable</key><string>gufa-float</string>
9
9
  <key>CFBundlePackageType</key><string>APPL</string>
10
- <key>CFBundleShortVersionString</key><string>1.3.56</string>
11
- <key>CFBundleVersion</key><string>1.3.56</string>
10
+ <key>CFBundleShortVersionString</key><string>1.3.57</string>
11
+ <key>CFBundleVersion</key><string>1.3.57</string>
12
12
  <key>LSUIElement</key><true/>
13
13
  <key>NSHighResolutionCapable</key><true/>
14
14
  <key>NSPrincipalClass</key><string>NSApplication</string>
@@ -104,6 +104,19 @@
104
104
  `SLSAddWindowsToSpaces` 把自己的窗口加进去(实测 `use-active-space=8234 err=0`)。
105
105
  3. 私有 API 全部 dlsym,符号缺失时只记日志不影响主流程。
106
106
 
107
+ ## 摸鱼窗口里的两个系统性问题(1.3.57 修复)
108
+
109
+ 1. **摸鱼窗口是独立 http origin,DSH 主题默认是浅色**:主窗口(dsh-app://)的深色主题在悬浮窗里不存在,
110
+ 导致 IDE 面板/弹窗呈现浅色:深色半透明底 + 浅色文字/弹窗,字看不清。
111
+ - 修复:`G.resolveSolidPalette` 在 `html[data-gufa-float]` 下强制返回深色实色板;
112
+ `html[data-gufa-float] body` 与 `#gufa-portal-root` 强制深色 `--dsw-alias-*` token;
113
+ App 在摸鱼模式把 `theme` 固定为 `dark`(Monaco/终端)。
114
+ - 注意:portal/弹窗在 body 层,CSS 变量要用 `!important`,因为 `applyPalette` 会往 portal 上写 inline 变量。
115
+ 2. **无边框 NSWindow 默认 `canBecomeKeyWindow=NO`**:悬浮窗收不到键盘事件,终端/编辑器/聊天都输入不了。
116
+ - 修复:`GufaFloatWindow` 子类覆写 `canBecomeKeyWindow/canBecomeMainWindow` 返回 YES。
117
+ - 排查要点:`float-hittest` 日志会打印 elementFromPoint 与临时 `.gufa-modal` 的计算样式(bg/color),
118
+ `float-styles` 打印覆盖层透明度;终端输入问题优先看窗口是否 key,而不是 transport。
119
+
107
120
  ## 5.1 摸鱼会话框比编辑器黑:官方会话根节点自己又画了一层底
108
121
 
109
122
  - 现象:摸鱼里编辑器/终端都统一了,右侧会话框看起来明显更黑更实。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gufa-code",
3
- "version": "1.3.56",
3
+ "version": "1.3.57",
4
4
  "description": "古法编程 · AI 辅助:一键把 DSH 主面板变成 VS Code 风格 IDE(Monaco 编辑器、文件树、Git、SSH、真实终端 + 右侧官方会话);主张亲手写、每个改动心中有数,AI 是助理、你是第一责任人",
5
5
  "icon": "icon.svg",
6
6
  "keywords": [
@@ -824,6 +824,19 @@ G.compositeColor = function compositeColor(foreground, background) {
824
824
  * @returns {{bg:string, layer:string, layer2:string, overlay:string, sidebar:string}}
825
825
  */
826
826
  G.resolveSolidPalette = function resolveSolidPalette(container) {
827
+ /* 摸鱼悬浮窗是独立的 http origin,拿不到主窗口的 DSH 主题(默认会是浅色);
828
+ 摸鱼整窗本来就是深色半透明,这里强制返回深色实色板,避免出现浅色面板/看不清的弹窗。 */
829
+ try {
830
+ if (typeof document !== 'undefined' && document.documentElement !== null && document.documentElement.hasAttribute('data-gufa-float')) {
831
+ return {
832
+ bg: 'rgb(13, 15, 19)', layer: 'rgb(20, 22, 27)', layer2: 'rgb(26, 28, 34)', overlay: 'rgb(30, 33, 40)',
833
+ sidebar: 'rgb(18, 20, 24)', text: 'rgb(244, 241, 232)', textDim: 'rgb(166, 170, 176)',
834
+ accent: 'rgb(192, 57, 43)', isDark: true,
835
+ }
836
+ }
837
+ } catch {
838
+ /* ignore */
839
+ }
827
840
  const dark = G.theme() === 'dark'
828
841
  const fallbackPage = dark ? [26, 27, 31, 1] : [250, 250, 252, 1]
829
842
  const fallbackSurface = dark ? [45, 46, 51, 1] : [255, 255, 255, 1]
@@ -1080,7 +1093,16 @@ G.CSS = `
1080
1093
  .gufa-backdrop{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
1081
1094
  /* 桌面悬浮层(摸鱼)模式:整窗半透明,透明度由 --gufa-float-alpha 控制(标题栏滑块) */
1082
1095
  html[data-gufa-float]{--gufa-float-alpha:0.55}
1083
- html[data-gufa-float] body{background:transparent!important}
1096
+ html[data-gufa-float] body{background:transparent!important;color-scheme:dark;
1097
+ --dsw-alias-label-primary:#f4f1e8!important;--dsw-alias-label-secondary:rgba(244,241,232,0.72)!important;
1098
+ --dsw-alias-bg-base:#0d0f13!important;--dsw-alias-bg-layer-1:#14161b!important;--dsw-alias-bg-layer-2:#1a1e24!important;
1099
+ --dsw-alias-bg-overlay:#22262e!important;
1100
+ --dsw-alias-border-l1:rgba(255,255,255,0.12)!important;--dsw-alias-border-l2:rgba(255,255,255,0.2)!important;
1101
+ }
1102
+ html[data-gufa-float] .gufa-root,
1103
+ html[data-gufa-float] .gufa-overlay-root{
1104
+ --gufa-solid-text:#f4f1e8!important;--gufa-solid-text-dim:rgba(244,241,232,0.68)!important;
1105
+ }
1084
1106
  html[data-gufa-float] .gufa-overlay-root,
1085
1107
  html[data-gufa-float] .gufa-root{
1086
1108
  --gufa-solid-bg:rgba(13,15,19,var(--gufa-float-alpha))!important;--gufa-bg:rgba(13,15,19,var(--gufa-float-alpha))!important;
@@ -1100,6 +1122,29 @@ html[data-gufa-float] .gufa-overlay-root::before{
1100
1122
  background:rgba(13,15,19,var(--gufa-float-alpha));z-index:1;
1101
1123
  }
1102
1124
  html[data-gufa-float] .gufa-overlay-root{background:transparent!important;padding-top:22px;box-sizing:border-box}
1125
+ /* 摸鱼模式:弹窗/菜单都在 body 级 portal 里,拿不到摸鱼覆盖层的深色主题;
1126
+ 强制给 portal 一套深色可读变量,避免出现「浅色弹窗 + 浅色文字」看不清的问题。 */
1127
+ html[data-gufa-float] #gufa-portal-root{
1128
+ --gufa-solid-bg:#121418!important;--gufa-solid-layer:#191c21!important;--gufa-solid-layer2:#1e2228!important;--gufa-solid-overlay:#23272e!important;
1129
+ --gufa-solid-text:#f4f1e8!important;--gufa-solid-text-dim:rgba(244,241,232,0.68)!important;
1130
+ --dsw-alias-bg-base:#121418!important;--dsw-alias-bg-layer-1:#191c21!important;--dsw-alias-bg-layer-2:#1e2228!important;--dsw-alias-bg-overlay:#23272e!important;
1131
+ --dsw-alias-label-primary:#f4f1e8!important;--dsw-alias-label-secondary:rgba(244,241,232,0.68)!important;
1132
+ --dsw-alias-border-l1:rgba(255,255,255,0.12)!important;--dsw-alias-border-l2:rgba(255,255,255,0.2)!important;
1133
+ color:#f4f1e8!important;
1134
+ }
1135
+ html[data-gufa-float] #gufa-portal-root .gufa-modal,
1136
+ html[data-gufa-float] #gufa-portal-root .gufa-sessions-dialog,
1137
+ html[data-gufa-float] #gufa-portal-root .gufa-workspace-dialog,
1138
+ html[data-gufa-float] #gufa-portal-root .gufa-float-picker,
1139
+ html[data-gufa-float] #gufa-portal-root .gufa-shortcuts-dialog,
1140
+ html[data-gufa-float] #gufa-portal-root .gufa-graph-dialog{background:#1b1f26!important;color:#f4f1e8!important}
1141
+ html[data-gufa-float] #gufa-portal-root .gufa-modal-backdrop,
1142
+ html[data-gufa-float] .gufa-float-backdrop{
1143
+ background:rgba(0,0,0,0.66)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
1144
+ }
1145
+ /* 摸鱼:所有 portal 弹窗/菜单/输入框不透明,保证字看得清 */
1146
+ html[data-gufa-float] #gufa-portal-root *{color:inherit}
1147
+ html[data-gufa-float] #gufa-portal-root .gufa-hint{color:rgba(244,241,232,0.72)!important}
1103
1148
  /* 摸鱼:整窗只保留「覆盖层根节点」这一层半透明底,其余面板/会话/终端全部透明,
1104
1149
  保证编辑器、会话框、终端框看到的透明度完全一致(都等于滑块的 alpha)。 */
1105
1150
  html[data-gufa-float] .gufa-overlay-root{background:rgba(13,15,19,var(--gufa-float-alpha))!important}
@@ -2180,6 +2180,7 @@ G.GufaApp = function GufaApp(props) {
2180
2180
  if (selectionTimerRef.current !== null) { window.clearTimeout(selectionTimerRef.current); selectionTimerRef.current = null }
2181
2181
  }, [])
2182
2182
 
2183
+ const uiTheme = moyuMode ? 'dark' : theme
2183
2184
  const statusBranch = project?.isGit === true && gitStatus?.branch ? gitStatus.branch : null
2184
2185
  const lineCount = activeTab === null || activeTab.kind === 'graph' ? 0 : String(activeTab.content ?? '').split('\n').length
2185
2186
 
@@ -2370,7 +2371,7 @@ G.GufaApp = function GufaApp(props) {
2370
2371
  : h(G.EditorPane, {
2371
2372
  tabs,
2372
2373
  activePath,
2373
- theme,
2374
+ theme: uiTheme,
2374
2375
  palette: solidPalette,
2375
2376
  root: project?.root ?? '',
2376
2377
  onSelectTab: handleSelectTab,
@@ -2393,7 +2394,7 @@ G.GufaApp = function GufaApp(props) {
2393
2394
  root: project?.root ?? null,
2394
2395
  visible: true,
2395
2396
  height: terminalHeight,
2396
- theme,
2397
+ theme: uiTheme,
2397
2398
  palette: solidPalette,
2398
2399
  onToggleHeight: () => patchUi({ terminalOpen: false }),
2399
2400
  }),
@@ -2413,11 +2414,12 @@ G.GufaApp = function GufaApp(props) {
2413
2414
  project,
2414
2415
  activeFile: activeFileForChat,
2415
2416
  selection: selectionForChat,
2416
- theme,
2417
+ theme: uiTheme,
2417
2418
  width: chatWidth,
2418
2419
  active: true,
2419
2420
  paused: sessionsOpen,
2420
2421
  backdrop: backdropActive,
2422
+ theme: uiTheme,
2421
2423
  sessionTitle,
2422
2424
  onOpenSessions: () => setSessionsOpen(true),
2423
2425
  onInsertCode: insertCode,
@@ -503,6 +503,56 @@ const GUFA_PLUGIN = {
503
503
  }
504
504
  }
505
505
 
506
+ // 临时诊断(1.3.57):摸鱼窗口里点不到左树/编辑器时,看看点击落到了哪个元素
507
+ try {
508
+ if (document.documentElement.hasAttribute('data-gufa-float') || /[?&]gufa-float=1/.test(location.search)) {
509
+ setTimeout(() => {
510
+ const probeAt = (x, y) => {
511
+ try {
512
+ const node = document.elementFromPoint(x, y)
513
+ if (node === null) return `${x},${y}:none`
514
+ const cls = typeof node.className === 'string' ? node.className : ''
515
+ return `${x},${y}:${node.tagName}.${String(cls).slice(0, 60)}`
516
+ } catch (error) {
517
+ return `${x},${y}:err`
518
+ }
519
+ }
520
+ // 模态框深色可读性:往 portal 里塞一个临时 .gufa-modal 读计算样式
521
+ let modalInfo = 'none'
522
+ try {
523
+ const host = document.getElementById('gufa-portal-root')
524
+ if (host !== null) {
525
+ const probe = document.createElement('div')
526
+ probe.className = 'gufa-modal'
527
+ probe.style.cssText = 'position:fixed;left:-9999px;top:0;width:120px;height:60px'
528
+ host.appendChild(probe)
529
+ const cs = window.getComputedStyle(probe)
530
+ modalInfo = `bg=${cs.backgroundColor} color=${cs.color}`
531
+ probe.remove()
532
+ }
533
+ } catch {
534
+ modalInfo = 'err'
535
+ }
536
+ // 找树行实际坐标(摸鱼窗半透明,肉眼看不清哪些行是古法的)
537
+ const rows = []
538
+ for (let y = 80; y < 1000; y += 22) {
539
+ try {
540
+ const node = document.elementFromPoint(100, y)
541
+ if (node !== null && typeof node.closest === 'function') {
542
+ const row = node.closest('.gufa-tree-row')
543
+ if (row !== null) rows.push(`${y}:${String(row.textContent ?? '').trim().slice(0, 24)}`)
544
+ }
545
+ } catch {
546
+ /* ignore */
547
+ }
548
+ }
549
+ void G.api('dev.log', { message: `float-hittest ${probeAt(135, 713)} | ${probeAt(300, 713)} | ${probeAt(900, 500)} | ${probeAt(1500, 60)} | modal[${modalInfo}] | rows[${rows.slice(0, 12).join(' ; ')}]` }).catch(() => {})
550
+ }, 5000)
551
+ }
552
+ } catch {
553
+ /* ignore */
554
+ }
555
+
506
556
  // 启动诊断:记录页面地址、真实 Host 基址与传输信息(排查桌面壳 dsh-app:// 连接问题)。
507
557
  try {
508
558
  const transport = typeof globalThis.__DSH_TRANSPORT__ === 'object' && globalThis.__DSH_TRANSPORT__ !== null ? globalThis.__DSH_TRANSPORT__ : null