dsh-gufa-code 1.3.61 → 1.3.63
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/README.md +3 -2
- package/client.js +516 -1
- package/desktop/float/bin/gufa-float-macos-arm64 +0 -0
- package/desktop/float/bin/gufa-float-macos-universal +0 -0
- package/desktop/float/bin/gufa-float-macos-x64 +0 -0
- package/desktop/float//345/217/244/346/263/225/347/274/226/347/250/213/346/202/254/346/265/256/345/261/202.app/Contents/Info.plist +2 -2
- package/desktop/float//345/217/244/346/263/225/347/274/226/347/250/213/346/202/254/346/265/256/345/261/202.app/Contents/MacOS/gufa-float +0 -0
- package/docs/KNOWN-PITFALLS.md +15 -1
- package/host/fs.js +375 -1
- package/package.json +1 -1
- package/scripts/selftest-client.mjs +1 -0
- package/scripts/selftest-host.mjs +59 -0
- package/src/client/00-core.js +79 -0
- package/src/client/20-editor.js +37 -0
- package/src/client/50-panels.js +325 -0
- package/src/client/85-shortcuts.js +3 -0
- package/src/client/90-app.js +71 -0
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.
|
|
19
|
+
G.BUILD = '1.3.63'
|
|
20
20
|
G.PANEL_ID = 'gufa-code'
|
|
21
21
|
/** 从哪个工作区点进来的(工作区菜单/节点按钮写入,App 启动时消费)。 */
|
|
22
22
|
G.pendingEntryWorkspace = null
|
|
@@ -120,6 +120,7 @@ const DICT_ZH = {
|
|
|
120
120
|
'shortcuts.toggleSidebar': '显示 / 隐藏左侧栏',
|
|
121
121
|
'shortcuts.closeTab': '关闭当前标签页',
|
|
122
122
|
'shortcuts.explorer': '聚焦资源管理器',
|
|
123
|
+
'shortcuts.search': '聚焦全局搜索',
|
|
123
124
|
'shortcuts.git': '聚焦源代码管理',
|
|
124
125
|
'shortcuts.ssh': '聚焦 SSH 主机',
|
|
125
126
|
'shortcuts.newTerminal': '新建终端',
|
|
@@ -184,12 +185,33 @@ const DICT_ZH = {
|
|
|
184
185
|
'app.manualPath': '或直接输入路径',
|
|
185
186
|
'app.pathPlaceholder': '例如 /Users/me/project',
|
|
186
187
|
'activity.explorer': '资源管理器',
|
|
188
|
+
'activity.search': '搜索',
|
|
187
189
|
'activity.git': '源代码管理',
|
|
188
190
|
'activity.ssh': 'SSH 远程',
|
|
189
191
|
'activity.terminal': '终端',
|
|
190
192
|
'activity.chat': '古法 AI 助手',
|
|
191
193
|
'activity.collapseChat': '收起 AI 面板',
|
|
192
194
|
'activity.expandChat': '展开 AI 面板',
|
|
195
|
+
'search.placeholder': '搜索项目中的文本,回车立即搜索',
|
|
196
|
+
'search.caseSensitive': '区分大小写',
|
|
197
|
+
'search.regex': '使用正则表达式',
|
|
198
|
+
'search.clear': '清空搜索',
|
|
199
|
+
'search.searching': '搜索中…',
|
|
200
|
+
'search.idle': '输入关键字搜索整个项目',
|
|
201
|
+
'search.noResult': '没有找到匹配结果',
|
|
202
|
+
'search.summary': '{count} 个结果 · {files} 个文件',
|
|
203
|
+
'search.truncated': '结果过多已截断,请缩小范围',
|
|
204
|
+
'search.error': '搜索失败',
|
|
205
|
+
'search.replaceToggle': '显示/隐藏替换',
|
|
206
|
+
'search.replacePlaceholder': '替换为…',
|
|
207
|
+
'search.replaceAll': '全部替换',
|
|
208
|
+
'search.replaceThisFile': '替换此文件',
|
|
209
|
+
'search.replacing': '替换中…',
|
|
210
|
+
'search.replaced': '已替换 {count} 处({files} 个文件)',
|
|
211
|
+
'search.confirmReplace': '确定替换 {count} 处({files} 个文件)?直接写文件,编辑器撤销无效。',
|
|
212
|
+
'search.confirmYes': '确定替换',
|
|
213
|
+
'search.confirmNo': '取消',
|
|
214
|
+
'search.replaceError': '替换失败',
|
|
193
215
|
'explorer.empty': '目录为空',
|
|
194
216
|
'explorer.newFile': '新建文件',
|
|
195
217
|
'explorer.newFolder': '新建文件夹',
|
|
@@ -349,6 +371,7 @@ const DICT_EN = {
|
|
|
349
371
|
'shortcuts.toggleSidebar': 'Toggle sidebar',
|
|
350
372
|
'shortcuts.closeTab': 'Close current tab',
|
|
351
373
|
'shortcuts.explorer': 'Focus explorer',
|
|
374
|
+
'shortcuts.search': 'Focus search',
|
|
352
375
|
'shortcuts.git': 'Focus source control',
|
|
353
376
|
'shortcuts.ssh': 'Focus SSH hosts',
|
|
354
377
|
'shortcuts.newTerminal': 'New terminal',
|
|
@@ -404,12 +427,33 @@ const DICT_EN = {
|
|
|
404
427
|
'app.manualPath': 'Or type a path',
|
|
405
428
|
'app.pathPlaceholder': 'e.g. /Users/me/project',
|
|
406
429
|
'activity.explorer': 'Explorer',
|
|
430
|
+
'activity.search': 'Search',
|
|
407
431
|
'activity.git': 'Source control',
|
|
408
432
|
'activity.ssh': 'SSH',
|
|
409
433
|
'activity.terminal': 'Terminal',
|
|
410
434
|
'activity.chat': 'Gufa AI',
|
|
411
435
|
'activity.collapseChat': 'Collapse AI panel',
|
|
412
436
|
'activity.expandChat': 'Expand AI panel',
|
|
437
|
+
'search.placeholder': 'Search text across the project (Enter to run)',
|
|
438
|
+
'search.caseSensitive': 'Match case',
|
|
439
|
+
'search.regex': 'Use regular expression',
|
|
440
|
+
'search.clear': 'Clear search',
|
|
441
|
+
'search.searching': 'Searching…',
|
|
442
|
+
'search.idle': 'Type a keyword to search the whole project',
|
|
443
|
+
'search.noResult': 'No matches found',
|
|
444
|
+
'search.summary': '{count} results · {files} files',
|
|
445
|
+
'search.truncated': 'Too many results, truncated — narrow the query',
|
|
446
|
+
'search.error': 'Search failed',
|
|
447
|
+
'search.replaceToggle': 'Show / hide replace',
|
|
448
|
+
'search.replacePlaceholder': 'Replace with…',
|
|
449
|
+
'search.replaceAll': 'Replace all',
|
|
450
|
+
'search.replaceThisFile': 'Replace in this file',
|
|
451
|
+
'search.replacing': 'Replacing…',
|
|
452
|
+
'search.replaced': 'Replaced {count} occurrences ({files} files)',
|
|
453
|
+
'search.confirmReplace': 'Replace {count} occurrences in {files} files? This writes files directly; editor undo will not work.',
|
|
454
|
+
'search.confirmYes': 'Replace',
|
|
455
|
+
'search.confirmNo': 'Cancel',
|
|
456
|
+
'search.replaceError': 'Replace failed',
|
|
413
457
|
'explorer.empty': 'Folder is empty',
|
|
414
458
|
'explorer.newFile': 'New file',
|
|
415
459
|
'explorer.newFolder': 'New folder',
|
|
@@ -1659,6 +1703,41 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
|
|
|
1659
1703
|
.gufa-explorer-notice{margin:4px 10px 0;padding:3px 8px;border-radius:6px;font-size:11px;line-height:1.5;color:var(--gufa-text);
|
|
1660
1704
|
background:color-mix(in srgb, var(--gufa-accent) 14%, transparent);border:0.5px solid color-mix(in srgb, var(--gufa-accent) 40%, transparent);
|
|
1661
1705
|
overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1706
|
+
/* ── 搜索面板(全局文本搜索) ───────────────────────────────────────── */
|
|
1707
|
+
.gufa-search-bar{display:flex;flex-direction:column;gap:6px;padding:6px 8px;border-bottom:1px solid var(--gufa-border);flex:0 0 auto}
|
|
1708
|
+
.gufa-search-input-wrap{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;border:1px solid var(--gufa-border);background:var(--gufa-layer2);color:var(--gufa-text-dim)}
|
|
1709
|
+
.gufa-search-input-wrap:focus-within{border-color:var(--gufa-accent)}
|
|
1710
|
+
.gufa-search-input{flex:1 1 auto;min-width:0;height:100%;border:0;background:transparent;color:var(--gufa-text);font-size:12px;outline:none}
|
|
1711
|
+
.gufa-search-input::placeholder{color:var(--gufa-text-dim)}
|
|
1712
|
+
.gufa-search-toggles{display:flex;align-items:center;gap:5px;min-height:22px}
|
|
1713
|
+
.gufa-search-toggle{height:22px;min-width:25px;padding:0 5px;border-radius:5px;border:1px solid var(--gufa-border);background:transparent;color:var(--gufa-text-dim);font:600 11px ui-monospace,Menlo,Consolas,monospace;cursor:pointer}
|
|
1714
|
+
.gufa-search-toggle:hover{color:var(--gufa-text);background:var(--gufa-hover)}
|
|
1715
|
+
.gufa-search-toggle[data-active]{background:var(--gufa-accent);border-color:var(--gufa-accent);color:#fff}
|
|
1716
|
+
.gufa-search-summary{margin-left:auto;font-size:11px;color:var(--gufa-text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1717
|
+
.gufa-search-file{margin:0 6px}
|
|
1718
|
+
.gufa-search-file-head{display:flex;align-items:center;gap:5px;width:100%;height:24px;padding:0 6px;border:0;background:transparent;color:var(--gufa-text);border-radius:5px;cursor:pointer;text-align:left}
|
|
1719
|
+
.gufa-search-file-head:hover{background:var(--gufa-hover)}
|
|
1720
|
+
.gufa-search-file-name{flex:0 0 auto;max-width:55%;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1721
|
+
.gufa-search-file-dir{flex:1 1 auto;min-width:0;font-size:10.5px;color:var(--gufa-text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1722
|
+
.gufa-search-file-count{flex:0 0 auto;font-size:10.5px;color:var(--gufa-text-dim);border:1px solid var(--gufa-border);border-radius:999px;padding:0 6px;line-height:15px}
|
|
1723
|
+
.gufa-search-match{display:flex;align-items:baseline;gap:8px;width:100%;padding:2px 6px 2px 24px;border:0;background:transparent;color:var(--gufa-text-dim);cursor:pointer;border-radius:5px;text-align:left}
|
|
1724
|
+
.gufa-search-match:hover{background:var(--gufa-hover);color:var(--gufa-text)}
|
|
1725
|
+
.gufa-search-line{flex:0 0 auto;min-width:24px;text-align:right;font:11px ui-monospace,Menlo,Consolas,monospace;opacity:.65}
|
|
1726
|
+
.gufa-search-text{flex:1 1 auto;min-width:0;font:11.5px ui-monospace,Menlo,Consolas,monospace;white-space:pre;overflow:hidden;text-overflow:ellipsis}
|
|
1727
|
+
.gufa-search-hit{background:rgba(192,57,43,.38);color:var(--gufa-text);border-radius:2px;padding:0 1px}
|
|
1728
|
+
.gufa-search-replace-row{margin-top:0}
|
|
1729
|
+
.gufa-search-actions{display:flex;align-items:center;gap:6px;margin-top:6px}
|
|
1730
|
+
.gufa-search-action{height:24px;padding:0 9px;border-radius:6px;border:1px solid var(--gufa-border);background:var(--gufa-layer2);color:var(--gufa-text);font-size:11.5px;cursor:pointer}
|
|
1731
|
+
.gufa-search-action:hover:not(:disabled){border-color:var(--gufa-accent)}
|
|
1732
|
+
.gufa-search-action:disabled{opacity:.5;cursor:default}
|
|
1733
|
+
.gufa-search-action[data-primary]{background:var(--gufa-accent);border-color:var(--gufa-accent);color:#fff}
|
|
1734
|
+
.gufa-search-confirm{margin:6px 8px 0;padding:7px 9px;border-radius:7px;border:1px solid var(--gufa-accent);background:color-mix(in srgb, var(--gufa-accent) 12%, transparent);font-size:11.5px;line-height:1.55;color:var(--gufa-text)}
|
|
1735
|
+
.gufa-search-confirm-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:6px}
|
|
1736
|
+
.gufa-search-notice{margin:6px 8px 0;padding:5px 9px;border-radius:7px;font-size:11.5px;color:var(--dsw-alias-state-success-primary);border:1px solid color-mix(in srgb, var(--dsw-alias-state-success-primary) 45%, transparent)}
|
|
1737
|
+
.gufa-search-error{margin:6px 8px 0;padding:5px 9px;border-radius:7px;font-size:11.5px;color:var(--dsw-alias-state-error-primary);border:1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary) 45%, transparent)}
|
|
1738
|
+
.gufa-search-file-replace{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-left:2px;border-radius:4px;color:var(--gufa-text-dim);cursor:pointer}
|
|
1739
|
+
.gufa-search-file-replace:hover{background:var(--gufa-active);color:var(--gufa-text)}
|
|
1740
|
+
|
|
1662
1741
|
.gufa-tree-chevron{width:14px;flex:0 0 auto;opacity:.7;display:flex;align-items:center;justify-content:center}
|
|
1663
1742
|
.gufa-tree-icon{width:15px;flex:0 0 auto;opacity:.85;display:flex;align-items:center;justify-content:center}
|
|
1664
1743
|
.gufa-tree-badge{font-size:10px;color:var(--gufa-accent);flex:0 0 auto;font-weight:600}
|
|
@@ -2774,6 +2853,7 @@ G.FooterAction = function FooterAction(props) {
|
|
|
2774
2853
|
const propsRef = useRef(props)
|
|
2775
2854
|
const activePathRef = useRef(activePath)
|
|
2776
2855
|
const statusRef = useRef('loading')
|
|
2856
|
+
const pendingRevealRef = useRef(null)
|
|
2777
2857
|
|
|
2778
2858
|
/** idle → loading → ready / error */
|
|
2779
2859
|
const [status, setStatus] = useState('loading')
|
|
@@ -3211,6 +3291,17 @@ G.FooterAction = function FooterAction(props) {
|
|
|
3211
3291
|
}
|
|
3212
3292
|
}
|
|
3213
3293
|
reportCursor()
|
|
3294
|
+
const pending = pendingRevealRef.current
|
|
3295
|
+
if (pending !== null && pending !== undefined && pending.path === targetTab.path) {
|
|
3296
|
+
pendingRevealRef.current = null
|
|
3297
|
+
try {
|
|
3298
|
+
editor.setPosition({ lineNumber: pending.line, column: pending.column })
|
|
3299
|
+
editor.revealLineInCenter(pending.line)
|
|
3300
|
+
editor.focus()
|
|
3301
|
+
} catch {
|
|
3302
|
+
/* ignore */
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3214
3305
|
/* 打开/切换文件不抢焦点:只有用户点击编辑区时才进入键盘编辑 */
|
|
3215
3306
|
}
|
|
3216
3307
|
} else if (targetTab !== null) {
|
|
@@ -3218,6 +3309,31 @@ G.FooterAction = function FooterAction(props) {
|
|
|
3218
3309
|
}
|
|
3219
3310
|
}, [status, tabs, activePath, root, reportCursor, disposeAllModels, disposeModelAt])
|
|
3220
3311
|
|
|
3312
|
+
/* 搜索面板点击结果 → 打开文件并跳到对应行列(由 App 通过 bus 发来) */
|
|
3313
|
+
useEffect(() => {
|
|
3314
|
+
if (G.bus === null || G.bus === undefined || typeof G.bus.on !== 'function') return undefined
|
|
3315
|
+
return G.bus.on('editor:reveal', (detail) => {
|
|
3316
|
+
const editor = editorRef.current
|
|
3317
|
+
if (editor === null || editor === undefined) return
|
|
3318
|
+
const rawLine = Number(detail?.line)
|
|
3319
|
+
const rawColumn = Number(detail?.column)
|
|
3320
|
+
const line = Number.isFinite(rawLine) ? Math.max(1, Math.trunc(rawLine)) : 1
|
|
3321
|
+
const column = Number.isFinite(rawColumn) ? Math.max(1, Math.trunc(rawColumn)) : 1
|
|
3322
|
+
const path = typeof detail?.path === 'string' && detail.path !== '' ? detail.path : null
|
|
3323
|
+
if (path !== null && modelPathRef.current !== path) {
|
|
3324
|
+
pendingRevealRef.current = { path, line, column }
|
|
3325
|
+
return
|
|
3326
|
+
}
|
|
3327
|
+
try {
|
|
3328
|
+
editor.setPosition({ lineNumber: line, column })
|
|
3329
|
+
editor.revealLineInCenter(line)
|
|
3330
|
+
editor.focus()
|
|
3331
|
+
} catch (error) {
|
|
3332
|
+
/* ignore */
|
|
3333
|
+
}
|
|
3334
|
+
})
|
|
3335
|
+
}, [])
|
|
3336
|
+
|
|
3221
3337
|
/* ── Git diff 视图:Monaco DiffEditor(未暂存的一侧可编辑并保存) ── */
|
|
3222
3338
|
useEffect(() => {
|
|
3223
3339
|
const disposeDiff = () => {
|
|
@@ -7201,6 +7317,331 @@ G.MenuItem = function MenuItem(props) {
|
|
|
7201
7317
|
)
|
|
7202
7318
|
}
|
|
7203
7319
|
|
|
7320
|
+
/* ── 全局搜索(左侧「搜索」面板) ──────────────────────────────────────── */
|
|
7321
|
+
G.SearchPanel = function SearchPanel(props) {
|
|
7322
|
+
const t = G.useT()
|
|
7323
|
+
const root = props.root
|
|
7324
|
+
const [query, setQuery] = useState('')
|
|
7325
|
+
const [caseSensitive, setCaseSensitive] = useState(false)
|
|
7326
|
+
const [regex, setRegex] = useState(false)
|
|
7327
|
+
const [status, setStatus] = useState('idle')
|
|
7328
|
+
const [result, setResult] = useState(null)
|
|
7329
|
+
const [error, setError] = useState('')
|
|
7330
|
+
const [collapsed, setCollapsed] = useState({})
|
|
7331
|
+
const [replaceOpen, setReplaceOpen] = useState(false)
|
|
7332
|
+
const [replacement, setReplacement] = useState('')
|
|
7333
|
+
const [replacing, setReplacing] = useState(false)
|
|
7334
|
+
const [confirming, setConfirming] = useState(null)
|
|
7335
|
+
const [replaceError, setReplaceError] = useState('')
|
|
7336
|
+
const [notice, setNotice] = useState('')
|
|
7337
|
+
const inputRef = useRef(null)
|
|
7338
|
+
const requestRef = useRef(0)
|
|
7339
|
+
|
|
7340
|
+
const focusInput = useCallback(() => {
|
|
7341
|
+
const node = inputRef.current
|
|
7342
|
+
if (node === null || node === undefined) return
|
|
7343
|
+
try {
|
|
7344
|
+
node.focus()
|
|
7345
|
+
if (typeof node.select === 'function') node.select()
|
|
7346
|
+
} catch {
|
|
7347
|
+
/* ignore */
|
|
7348
|
+
}
|
|
7349
|
+
}, [])
|
|
7350
|
+
|
|
7351
|
+
const runSearch = useCallback(async (value) => {
|
|
7352
|
+
const text = String(value ?? '').trim()
|
|
7353
|
+
if (text === '' || typeof root !== 'string' || root === '') {
|
|
7354
|
+
requestRef.current += 1
|
|
7355
|
+
setResult(null)
|
|
7356
|
+
setStatus('idle')
|
|
7357
|
+
setError('')
|
|
7358
|
+
return
|
|
7359
|
+
}
|
|
7360
|
+
const seq = requestRef.current + 1
|
|
7361
|
+
requestRef.current = seq
|
|
7362
|
+
setStatus('loading')
|
|
7363
|
+
setError('')
|
|
7364
|
+
try {
|
|
7365
|
+
const value = await G.api('fs.search', {
|
|
7366
|
+
root,
|
|
7367
|
+
query: text,
|
|
7368
|
+
options: { caseSensitive, regex, maxFiles: 200, maxMatches: 500 },
|
|
7369
|
+
})
|
|
7370
|
+
if (seq !== requestRef.current) return
|
|
7371
|
+
setResult(value)
|
|
7372
|
+
setStatus('ready')
|
|
7373
|
+
} catch (err) {
|
|
7374
|
+
if (seq !== requestRef.current) return
|
|
7375
|
+
setResult(null)
|
|
7376
|
+
setError(G.errorText(err))
|
|
7377
|
+
setStatus('error')
|
|
7378
|
+
}
|
|
7379
|
+
}, [root, caseSensitive, regex])
|
|
7380
|
+
|
|
7381
|
+
const requestReplace = useCallback((paths, count, files) => {
|
|
7382
|
+
if (typeof root !== 'string' || root === '' || query.trim() === '' || replacing) return
|
|
7383
|
+
setReplaceError('')
|
|
7384
|
+
setNotice('')
|
|
7385
|
+
setConfirming({ paths: Array.isArray(paths) ? paths : null, count: Number(count) || 0, files: Number(files) || 0 })
|
|
7386
|
+
}, [root, query, replacing])
|
|
7387
|
+
|
|
7388
|
+
const doReplace = useCallback(async () => {
|
|
7389
|
+
const pending = confirming
|
|
7390
|
+
if (pending === null || replacing) return
|
|
7391
|
+
setConfirming(null)
|
|
7392
|
+
setReplacing(true)
|
|
7393
|
+
setReplaceError('')
|
|
7394
|
+
setNotice('')
|
|
7395
|
+
try {
|
|
7396
|
+
await props.onBeforeReplace?.()
|
|
7397
|
+
const value = await G.api('fs.replace', {
|
|
7398
|
+
root,
|
|
7399
|
+
query: query.trim(),
|
|
7400
|
+
replacement,
|
|
7401
|
+
options: { caseSensitive, regex },
|
|
7402
|
+
paths: Array.isArray(pending.paths) ? pending.paths : undefined,
|
|
7403
|
+
})
|
|
7404
|
+
const count = Number(value?.replacedCount) || 0
|
|
7405
|
+
const replacedFiles = Array.isArray(value?.replacedFiles) ? value.replacedFiles : []
|
|
7406
|
+
setNotice(t('search.replaced', { count, files: replacedFiles.length }))
|
|
7407
|
+
await props.onFilesChanged?.(replacedFiles)
|
|
7408
|
+
await runSearch(query)
|
|
7409
|
+
} catch (error) {
|
|
7410
|
+
setReplaceError(G.errorText(error))
|
|
7411
|
+
} finally {
|
|
7412
|
+
setReplacing(false)
|
|
7413
|
+
}
|
|
7414
|
+
}, [confirming, replacing, props.onBeforeReplace, props.onFilesChanged, root, query, replacement, caseSensitive, regex, runSearch, t])
|
|
7415
|
+
|
|
7416
|
+
/* 输入防抖搜索(回车立即搜索) */
|
|
7417
|
+
useEffect(() => {
|
|
7418
|
+
if (typeof root !== 'string' || root === '') return undefined
|
|
7419
|
+
const text = query.trim()
|
|
7420
|
+
if (text === '') {
|
|
7421
|
+
setResult(null)
|
|
7422
|
+
setStatus('idle')
|
|
7423
|
+
setError('')
|
|
7424
|
+
return undefined
|
|
7425
|
+
}
|
|
7426
|
+
const timer = window.setTimeout(() => { void runSearch(text) }, 320)
|
|
7427
|
+
return () => window.clearTimeout(timer)
|
|
7428
|
+
}, [query, runSearch, root])
|
|
7429
|
+
|
|
7430
|
+
/* 快捷键/按钮打开搜索面板时聚焦输入框 */
|
|
7431
|
+
useEffect(() => {
|
|
7432
|
+
if (G.bus === null || G.bus === undefined || typeof G.bus.on !== 'function') return undefined
|
|
7433
|
+
return G.bus.on('search:focus', focusInput)
|
|
7434
|
+
}, [focusInput])
|
|
7435
|
+
|
|
7436
|
+
useEffect(() => {
|
|
7437
|
+
if (props.active === true) focusInput()
|
|
7438
|
+
}, [props.active, focusInput])
|
|
7439
|
+
|
|
7440
|
+
const summary = (() => {
|
|
7441
|
+
if (status === 'loading') return t('search.searching')
|
|
7442
|
+
if (status === 'error' || result === null) return ''
|
|
7443
|
+
if (result.total === 0) return result.truncated === true ? t('search.truncated') : t('search.noResult')
|
|
7444
|
+
const base = t('search.summary', { count: result.total, files: result.files.length })
|
|
7445
|
+
return result.truncated === true ? `${base} · ${t('search.truncated')}` : base
|
|
7446
|
+
})()
|
|
7447
|
+
|
|
7448
|
+
const highlight = (match) => {
|
|
7449
|
+
const text = typeof match.text === 'string' ? match.text : ''
|
|
7450
|
+
const start = Number.isFinite(match.start) ? match.start : -1
|
|
7451
|
+
const end = Number.isFinite(match.end) ? match.end : -1
|
|
7452
|
+
if (start < 0 || end <= start || start >= text.length) return [text]
|
|
7453
|
+
const safeEnd = Math.min(end, text.length)
|
|
7454
|
+
return [
|
|
7455
|
+
text.slice(0, start),
|
|
7456
|
+
h('mark', { key: 'hit', className: 'gufa-search-hit' }, text.slice(start, safeEnd)),
|
|
7457
|
+
text.slice(safeEnd),
|
|
7458
|
+
]
|
|
7459
|
+
}
|
|
7460
|
+
|
|
7461
|
+
const body = (() => {
|
|
7462
|
+
if (typeof root !== 'string' || root === '') {
|
|
7463
|
+
return h('div', { className: 'gufa-hint', style: { padding: '10px 12px' } }, t('explorer.openProjectFirst'))
|
|
7464
|
+
}
|
|
7465
|
+
if (error !== '') {
|
|
7466
|
+
return h('div', { className: 'gufa-error-banner', style: { margin: '8px' } }, h(G.Icon, { name: 'warn', size: 12 }), h('span', null, `${t('search.error')}:${error}`))
|
|
7467
|
+
}
|
|
7468
|
+
if (status === 'idle') return h('div', { className: 'gufa-hint', style: { padding: '10px 12px' } }, t('search.idle'))
|
|
7469
|
+
if (status === 'loading') return h('div', { className: 'gufa-hint', style: { padding: '10px 12px', display: 'flex', gap: 8, alignItems: 'center' } }, h(G.Spinner), t('search.searching'))
|
|
7470
|
+
if (result === null || result.total === 0) {
|
|
7471
|
+
const emptyText = result !== null && result.truncated === true ? t('search.truncated') : t('search.noResult')
|
|
7472
|
+
return h('div', { className: 'gufa-hint', style: { padding: '10px 12px' } }, emptyText)
|
|
7473
|
+
}
|
|
7474
|
+
return h(
|
|
7475
|
+
'div',
|
|
7476
|
+
{ className: 'gufa-search-results' },
|
|
7477
|
+
...result.files.map((file) => {
|
|
7478
|
+
const isCollapsed = collapsed[file.path] === true
|
|
7479
|
+
return h(
|
|
7480
|
+
'div',
|
|
7481
|
+
{ key: file.path, className: 'gufa-search-file' },
|
|
7482
|
+
h(
|
|
7483
|
+
'button',
|
|
7484
|
+
{
|
|
7485
|
+
type: 'button',
|
|
7486
|
+
className: 'gufa-search-file-head',
|
|
7487
|
+
title: file.path,
|
|
7488
|
+
onClick: () => setCollapsed((current) => ({ ...current, [file.path]: !isCollapsed })),
|
|
7489
|
+
},
|
|
7490
|
+
h(G.Icon, { name: isCollapsed ? 'chevron-right' : 'chevron-down', size: 11 }),
|
|
7491
|
+
h('span', { className: 'gufa-search-file-name' }, G.basename(file.path)),
|
|
7492
|
+
h('span', { className: 'gufa-search-file-dir' }, G.dirname(file.path)),
|
|
7493
|
+
h('span', { className: 'gufa-search-file-count' }, String(file.matches.length)),
|
|
7494
|
+
replaceOpen
|
|
7495
|
+
? h(
|
|
7496
|
+
'span',
|
|
7497
|
+
{
|
|
7498
|
+
className: 'gufa-search-file-replace',
|
|
7499
|
+
title: t('search.replaceThisFile'),
|
|
7500
|
+
role: 'button',
|
|
7501
|
+
onClick: (event) => {
|
|
7502
|
+
event.stopPropagation()
|
|
7503
|
+
event.preventDefault()
|
|
7504
|
+
requestReplace([file.path], file.matches.length, 1)
|
|
7505
|
+
},
|
|
7506
|
+
},
|
|
7507
|
+
h(G.Icon, { name: 'pencil', size: 11 }),
|
|
7508
|
+
)
|
|
7509
|
+
: null,
|
|
7510
|
+
),
|
|
7511
|
+
isCollapsed
|
|
7512
|
+
? null
|
|
7513
|
+
: file.matches.map((match, index) =>
|
|
7514
|
+
h(
|
|
7515
|
+
'button',
|
|
7516
|
+
{
|
|
7517
|
+
key: `${file.path}:${match.line}:${match.column}:${index}`,
|
|
7518
|
+
type: 'button',
|
|
7519
|
+
className: 'gufa-search-match',
|
|
7520
|
+
title: `${file.path}:${match.line}:${match.column}`,
|
|
7521
|
+
onClick: () => props.onOpenFile?.(file.path, match.line, match.column),
|
|
7522
|
+
},
|
|
7523
|
+
h('span', { className: 'gufa-search-line' }, String(match.line)),
|
|
7524
|
+
h('span', { className: 'gufa-search-text' }, ...highlight(match)),
|
|
7525
|
+
),
|
|
7526
|
+
),
|
|
7527
|
+
)
|
|
7528
|
+
}),
|
|
7529
|
+
)
|
|
7530
|
+
})()
|
|
7531
|
+
|
|
7532
|
+
return h(
|
|
7533
|
+
'div',
|
|
7534
|
+
{ className: 'gufa-search-panel', style: { display: 'flex', flexDirection: 'column', flex: '1 1 auto', minHeight: 0 } },
|
|
7535
|
+
h('div', { className: 'gufa-panel-head' }, h('span', { className: 'gufa-panel-head-title' }, t('activity.search'))),
|
|
7536
|
+
h(
|
|
7537
|
+
'div',
|
|
7538
|
+
{ className: 'gufa-search-bar' },
|
|
7539
|
+
h(
|
|
7540
|
+
'div',
|
|
7541
|
+
{ className: 'gufa-search-input-wrap' },
|
|
7542
|
+
h(G.Icon, { name: 'search', size: 13 }),
|
|
7543
|
+
h('input', {
|
|
7544
|
+
ref: inputRef,
|
|
7545
|
+
className: 'gufa-search-input',
|
|
7546
|
+
type: 'text',
|
|
7547
|
+
value: query,
|
|
7548
|
+
placeholder: t('search.placeholder'),
|
|
7549
|
+
spellCheck: false,
|
|
7550
|
+
onChange: (event) => setQuery(event.target.value),
|
|
7551
|
+
onKeyDown: (event) => {
|
|
7552
|
+
if (event.key === 'Enter') {
|
|
7553
|
+
event.preventDefault()
|
|
7554
|
+
void runSearch(query)
|
|
7555
|
+
} else if (event.key === 'Escape') {
|
|
7556
|
+
event.preventDefault()
|
|
7557
|
+
setQuery('')
|
|
7558
|
+
inputRef.current?.blur?.()
|
|
7559
|
+
}
|
|
7560
|
+
},
|
|
7561
|
+
}),
|
|
7562
|
+
query === ''
|
|
7563
|
+
? null
|
|
7564
|
+
: h(G.IconButton, { title: t('search.clear'), onClick: () => { setQuery(''); focusInput() } }, h(G.Icon, { name: 'close', size: 11 })),
|
|
7565
|
+
h(G.IconButton, { title: t('search.replaceToggle'), onClick: () => setReplaceOpen((value) => !value) }, h(G.Icon, { name: replaceOpen ? 'chevron-up' : 'chevron-down', size: 12 })),
|
|
7566
|
+
),
|
|
7567
|
+
h(
|
|
7568
|
+
'div',
|
|
7569
|
+
{ className: 'gufa-search-toggles' },
|
|
7570
|
+
h('button', {
|
|
7571
|
+
type: 'button',
|
|
7572
|
+
className: 'gufa-search-toggle',
|
|
7573
|
+
'data-active': caseSensitive ? '' : undefined,
|
|
7574
|
+
title: t('search.caseSensitive'),
|
|
7575
|
+
onClick: () => setCaseSensitive((value) => !value),
|
|
7576
|
+
}, 'Aa'),
|
|
7577
|
+
h('button', {
|
|
7578
|
+
type: 'button',
|
|
7579
|
+
className: 'gufa-search-toggle',
|
|
7580
|
+
'data-active': regex ? '' : undefined,
|
|
7581
|
+
title: t('search.regex'),
|
|
7582
|
+
onClick: () => setRegex((value) => !value),
|
|
7583
|
+
}, '.*'),
|
|
7584
|
+
h('span', { className: 'gufa-search-summary', title: summary }, summary),
|
|
7585
|
+
),
|
|
7586
|
+
replaceOpen
|
|
7587
|
+
? h(
|
|
7588
|
+
React.Fragment,
|
|
7589
|
+
null,
|
|
7590
|
+
h(
|
|
7591
|
+
'div',
|
|
7592
|
+
{ className: 'gufa-search-input-wrap gufa-search-replace-row' },
|
|
7593
|
+
h(G.Icon, { name: 'pencil', size: 12 }),
|
|
7594
|
+
h('input', {
|
|
7595
|
+
className: 'gufa-search-input',
|
|
7596
|
+
type: 'text',
|
|
7597
|
+
value: replacement,
|
|
7598
|
+
placeholder: t('search.replacePlaceholder'),
|
|
7599
|
+
spellCheck: false,
|
|
7600
|
+
onChange: (event) => setReplacement(event.target.value),
|
|
7601
|
+
onKeyDown: (event) => {
|
|
7602
|
+
if (event.key !== 'Enter') return
|
|
7603
|
+
event.preventDefault()
|
|
7604
|
+
requestReplace(null, result?.total ?? 0, result?.files?.length ?? 0)
|
|
7605
|
+
},
|
|
7606
|
+
}),
|
|
7607
|
+
),
|
|
7608
|
+
h(
|
|
7609
|
+
'div',
|
|
7610
|
+
{ className: 'gufa-search-actions' },
|
|
7611
|
+
h(
|
|
7612
|
+
'button',
|
|
7613
|
+
{
|
|
7614
|
+
type: 'button',
|
|
7615
|
+
className: 'gufa-search-action',
|
|
7616
|
+
'data-primary': '',
|
|
7617
|
+
disabled: replacing || result === null || result.total === 0,
|
|
7618
|
+
onClick: () => requestReplace(null, result?.total ?? 0, result?.files?.length ?? 0),
|
|
7619
|
+
},
|
|
7620
|
+
replacing ? t('search.replacing') : t('search.replaceAll'),
|
|
7621
|
+
),
|
|
7622
|
+
),
|
|
7623
|
+
)
|
|
7624
|
+
: null,
|
|
7625
|
+
confirming !== null
|
|
7626
|
+
? h(
|
|
7627
|
+
'div',
|
|
7628
|
+
{ className: 'gufa-search-confirm' },
|
|
7629
|
+
h('div', null, t('search.confirmReplace', { count: confirming.count, files: confirming.files })),
|
|
7630
|
+
h(
|
|
7631
|
+
'div',
|
|
7632
|
+
{ className: 'gufa-search-confirm-actions' },
|
|
7633
|
+
h('button', { type: 'button', className: 'gufa-search-action', onClick: () => setConfirming(null) }, t('search.confirmNo')),
|
|
7634
|
+
h('button', { type: 'button', className: 'gufa-search-action', 'data-primary': '', onClick: () => void doReplace() }, t('search.confirmYes')),
|
|
7635
|
+
),
|
|
7636
|
+
)
|
|
7637
|
+
: null,
|
|
7638
|
+
notice !== '' ? h('div', { className: 'gufa-search-notice' }, notice) : null,
|
|
7639
|
+
replaceError !== '' ? h('div', { className: 'gufa-search-error' }, `${t('search.replaceError')}:${replaceError}`) : null,
|
|
7640
|
+
),
|
|
7641
|
+
h('div', { className: 'gufa-panel-body gufa-scroll' }, body),
|
|
7642
|
+
)
|
|
7643
|
+
}
|
|
7644
|
+
|
|
7204
7645
|
/* ── 源代码管理(Git) ─────────────────────────────────────────────────── */
|
|
7205
7646
|
G.GitPanel = function GitPanel(props) {
|
|
7206
7647
|
const t = G.useT()
|
|
@@ -9222,6 +9663,7 @@ G.shortcutAction = function shortcutAction(event) {
|
|
|
9222
9663
|
}
|
|
9223
9664
|
if (event.shiftKey === true) {
|
|
9224
9665
|
if (key === 'e') return 'panelExplorer'
|
|
9666
|
+
if (key === 'f') return 'panelSearch'
|
|
9225
9667
|
if (key === 'g') return 'panelGit'
|
|
9226
9668
|
if (key === 'h' || key === 'u') return 'panelSsh'
|
|
9227
9669
|
if (key === 'b') return 'toggleSidebar'
|
|
@@ -9336,6 +9778,7 @@ const GUFA_SHORTCUT_COMMANDS = [
|
|
|
9336
9778
|
{ action: 'toggleSidebar', id: 'gufa.ide.toggleSidebar', labelKey: 'shortcuts.toggleSidebar', code: 'KeyB', modifiers: ['primary', 'shift'], regions: ['page', 'editable'] },
|
|
9337
9779
|
{ action: 'closeTab', id: 'gufa.ide.closeTab', labelKey: 'shortcuts.closeTab', code: 'KeyW', modifiers: ['primary', 'shift'], regions: ['page', 'editable'] },
|
|
9338
9780
|
{ action: 'panelExplorer', id: 'gufa.ide.panelExplorer', labelKey: 'shortcuts.explorer', code: 'KeyE', modifiers: ['primary', 'shift'], regions: ['page', 'editable'] },
|
|
9781
|
+
{ action: 'panelSearch', id: 'gufa.ide.panelSearch', labelKey: 'shortcuts.search', code: 'KeyF', modifiers: ['primary', 'shift'], regions: ['page', 'editable'] },
|
|
9339
9782
|
{ action: 'panelGit', id: 'gufa.ide.panelGit', labelKey: 'shortcuts.git', code: 'KeyG', modifiers: ['primary', 'shift'], regions: ['page', 'editable'] },
|
|
9340
9783
|
{ action: 'panelSsh', id: 'gufa.ide.panelSsh', labelKey: 'shortcuts.ssh', code: 'KeyU', modifiers: ['primary', 'shift'], regions: ['page', 'editable'] },
|
|
9341
9784
|
{ action: 'newTerminal', id: 'gufa.ide.newTerminal', labelKey: 'shortcuts.newTerminal', code: 'Backquote', modifiers: ['control', 'shift'], regions: ['page', 'editable', 'terminal'] },
|
|
@@ -9656,6 +10099,7 @@ G.SHORTCUTS = [
|
|
|
9656
10099
|
{ action: 'toggleSidebar', labelKey: 'shortcuts.toggleSidebar', keys: ['B'], shift: false },
|
|
9657
10100
|
{ action: 'closeTab', labelKey: 'shortcuts.closeTab', keys: ['W'], shift: false },
|
|
9658
10101
|
{ action: 'panelExplorer', labelKey: 'shortcuts.explorer', keys: ['E'], shift: true },
|
|
10102
|
+
{ action: 'panelSearch', labelKey: 'shortcuts.search', keys: ['F'], shift: true },
|
|
9659
10103
|
{ action: 'panelGit', labelKey: 'shortcuts.git', keys: ['G'], shift: true },
|
|
9660
10104
|
{ action: 'panelSsh', labelKey: 'shortcuts.ssh', keys: ['U'], shift: true },
|
|
9661
10105
|
{ action: 'newTerminal', labelKey: 'shortcuts.newTerminal', keys: ['`'], shift: true, macText: '⌃⇧`', otherText: 'Ctrl+Shift+`' },
|
|
@@ -10178,6 +10622,21 @@ G.GufaApp = function GufaApp(props) {
|
|
|
10178
10622
|
}
|
|
10179
10623
|
}, [project, tabs])
|
|
10180
10624
|
|
|
10625
|
+
/* 从搜索/定位结果打开文件并跳到指定行列(等 tab 切换完成后再触发编辑器 reveal) */
|
|
10626
|
+
const openFileAt = useCallback(async (path, line, column) => {
|
|
10627
|
+
if (typeof path !== 'string' || path === '') return
|
|
10628
|
+
await openFile(path)
|
|
10629
|
+
const targetLine = Number.isFinite(Number(line)) ? Math.max(1, Math.trunc(Number(line))) : 1
|
|
10630
|
+
const targetColumn = Number.isFinite(Number(column)) ? Math.max(1, Math.trunc(Number(column))) : 1
|
|
10631
|
+
window.setTimeout(() => {
|
|
10632
|
+
try {
|
|
10633
|
+
G.bus.emit('editor:reveal', { path, line: targetLine, column: targetColumn })
|
|
10634
|
+
} catch {
|
|
10635
|
+
/* ignore */
|
|
10636
|
+
}
|
|
10637
|
+
}, 120)
|
|
10638
|
+
}, [openFile])
|
|
10639
|
+
|
|
10181
10640
|
/* 原子恢复标签集合:按快照顺序、去重、最后激活指定文件(避免 openFile 并发产生重复标签) */
|
|
10182
10641
|
const applyTabs = useCallback(async (paths, active) => {
|
|
10183
10642
|
if (project === null || !Array.isArray(paths)) return
|
|
@@ -10294,6 +10753,49 @@ G.GufaApp = function GufaApp(props) {
|
|
|
10294
10753
|
}
|
|
10295
10754
|
}, [project, patchTab, refreshGit, t])
|
|
10296
10755
|
|
|
10756
|
+
/* 搜索面板批量替换前:先把所有未落盘的编辑器缓冲保存掉,避免磁盘旧内容覆盖用户输入 */
|
|
10757
|
+
const beforeSearchReplace = useCallback(async () => {
|
|
10758
|
+
flushBuffersRef.current?.()
|
|
10759
|
+
const pending = new Set(editorBuffersRef.current.keys())
|
|
10760
|
+
for (const tab of tabsRef.current ?? []) {
|
|
10761
|
+
if (tab !== null && tab !== undefined && tab.dirty === true) pending.add(tab.path)
|
|
10762
|
+
}
|
|
10763
|
+
for (const path of pending) {
|
|
10764
|
+
try {
|
|
10765
|
+
await saveFile(path)
|
|
10766
|
+
} catch {
|
|
10767
|
+
/* 单个保存失败不阻断替换 */
|
|
10768
|
+
}
|
|
10769
|
+
}
|
|
10770
|
+
}, [saveFile])
|
|
10771
|
+
|
|
10772
|
+
/* 搜索面板替换完成后:刷新目录/Git,并把已打开标签同步成磁盘最新内容 */
|
|
10773
|
+
const onSearchFilesChanged = useCallback(async (paths) => {
|
|
10774
|
+
if (project !== null && Array.isArray(paths) && paths.length > 0) {
|
|
10775
|
+
for (const path of paths.slice(0, 30)) {
|
|
10776
|
+
const tab = (tabsRef.current ?? []).find((item) => item !== null && item !== undefined && item.path === path)
|
|
10777
|
+
if (tab === undefined) continue
|
|
10778
|
+
try {
|
|
10779
|
+
const doc = await G.api('fs.read', { root: project.root, path })
|
|
10780
|
+
editorBuffersRef.current.delete(path)
|
|
10781
|
+
patchTab(path, {
|
|
10782
|
+
content: doc.content,
|
|
10783
|
+
revision: doc.revision,
|
|
10784
|
+
savedRevision: doc.revision,
|
|
10785
|
+
savedContent: doc.content,
|
|
10786
|
+
dirty: false,
|
|
10787
|
+
size: doc.size,
|
|
10788
|
+
})
|
|
10789
|
+
} catch {
|
|
10790
|
+
/* 文件已被删除:忽略 */
|
|
10791
|
+
}
|
|
10792
|
+
}
|
|
10793
|
+
}
|
|
10794
|
+
setRefreshToken((token) => token + 1)
|
|
10795
|
+
setGitRefreshToken((token) => token + 1)
|
|
10796
|
+
void refreshGit()
|
|
10797
|
+
}, [project, patchTab, refreshGit])
|
|
10798
|
+
|
|
10297
10799
|
/** 顶栏提示:错误常驻红色;成功用绿色 toast,1.2 秒后自动消失。 */
|
|
10298
10800
|
const successTimerRef = useRef(null)
|
|
10299
10801
|
const showBanner = useCallback((text, tone) => {
|
|
@@ -11678,6 +12180,10 @@ G.GufaApp = function GufaApp(props) {
|
|
|
11678
12180
|
if (activePath !== null) closeTabWithConfirm(activePath)
|
|
11679
12181
|
},
|
|
11680
12182
|
panelExplorer: () => patchUi({ view: 'explorer', sidebarOpen: true }),
|
|
12183
|
+
panelSearch: () => {
|
|
12184
|
+
patchUi({ view: 'search', sidebarOpen: true })
|
|
12185
|
+
window.setTimeout(() => { G.bus.emit('search:focus') }, 0)
|
|
12186
|
+
},
|
|
11681
12187
|
panelGit: () => {
|
|
11682
12188
|
patchUi({ view: 'git', sidebarOpen: true })
|
|
11683
12189
|
setGitRefreshToken((token) => token + 1)
|
|
@@ -11785,6 +12291,7 @@ G.GufaApp = function GufaApp(props) {
|
|
|
11785
12291
|
/* ── 渲染 ─────────────────────────────────────────────────────────── */
|
|
11786
12292
|
const activityItems = [
|
|
11787
12293
|
{ id: 'explorer', icon: 'files', label: t('activity.explorer'), onClick: () => patchUi({ view: 'explorer', sidebarOpen: true }) },
|
|
12294
|
+
{ id: 'search', icon: 'search', label: t('activity.search'), onClick: () => { patchUi({ view: 'search', sidebarOpen: true }); G.bus.emit('search:focus') } },
|
|
11788
12295
|
{ id: 'git', icon: 'git', label: t('activity.git'), badge: gitStatus?.changes?.length ?? 0, onClick: () => { patchUi({ view: 'git', sidebarOpen: true }); setGitRefreshToken((token) => token + 1) } },
|
|
11789
12296
|
{ id: 'ssh', icon: 'server', label: t('activity.ssh'), onClick: () => { patchUi({ view: 'ssh', sidebarOpen: true }); setSshRefreshToken((token) => token + 1) } },
|
|
11790
12297
|
{ id: 'terminal', icon: 'terminal', label: t('activity.terminal'), active: ui.terminalOpen, onClick: () => patchUi({ terminalOpen: !ui.terminalOpen }) },
|
|
@@ -11811,6 +12318,14 @@ G.GufaApp = function GufaApp(props) {
|
|
|
11811
12318
|
onRename: (path) => setModal({ type: 'rename', path }),
|
|
11812
12319
|
onDelete: (path) => void deleteEntry(path),
|
|
11813
12320
|
})),
|
|
12321
|
+
h('div', { key: 'search', style: { display: ui.view === 'search' ? 'flex' : 'none', flex: '1 1 auto', minHeight: 0, flexDirection: 'column' } },
|
|
12322
|
+
h(G.SearchPanel, {
|
|
12323
|
+
root: project?.root ?? null,
|
|
12324
|
+
active: ui.view === 'search',
|
|
12325
|
+
onOpenFile: (path, line, column) => void openFileAt(path, line, column),
|
|
12326
|
+
onBeforeReplace: beforeSearchReplace,
|
|
12327
|
+
onFilesChanged: onSearchFilesChanged,
|
|
12328
|
+
})),
|
|
11814
12329
|
h('div', { key: 'git', style: { display: ui.view === 'git' ? 'flex' : 'none', flex: '1 1 auto', minHeight: 0, flexDirection: 'column' } },
|
|
11815
12330
|
h(G.GitPanel, {
|
|
11816
12331
|
root: project?.root ?? null,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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.
|
|
11
|
-
<key>CFBundleVersion</key><string>1.3.
|
|
10
|
+
<key>CFBundleShortVersionString</key><string>1.3.63</string>
|
|
11
|
+
<key>CFBundleVersion</key><string>1.3.63</string>
|
|
12
12
|
<key>LSUIElement</key><true/>
|
|
13
13
|
<key>NSHighResolutionCapable</key><true/>
|
|
14
14
|
<key>NSPrincipalClass</key><string>NSApplication</string>
|