dsh-gufa-code 1.3.64 → 1.3.65

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.64'
19
+ G.BUILD = '1.3.65'
20
20
  G.PANEL_ID = 'gufa-code'
21
21
  /** 从哪个工作区点进来的(工作区菜单/节点按钮写入,App 启动时消费)。 */
22
22
  G.pendingEntryWorkspace = null
@@ -216,7 +216,6 @@ const DICT_ZH = {
216
216
  'search.replaceAll': '全部替换',
217
217
  'search.replaceThisFile': '替换此文件',
218
218
  'search.replacing': '替换中…',
219
- 'search.replaced': '已替换 {count} 处({files} 个文件)',
220
219
  'search.confirmReplace': '确定替换 {count} 处({files} 个文件)?直接写文件,编辑器撤销无效。',
221
220
  'search.confirmYes': '确定替换',
222
221
  'search.confirmNo': '取消',
@@ -257,11 +256,9 @@ const DICT_ZH = {
257
256
  'git.behindCount': '待拉取',
258
257
  'git.pull': '拉取',
259
258
  'git.noUpstreamHint': '当前分支还没有上游:点标题栏 ↑ 推送一次即可自动创建上游(git push -u)',
260
- 'git.pushDone': '已推送(如需首次建立上游会自动 -u)',
261
259
  'git.discardFile': '还原该文件的改动',
262
260
  'git.autoStageHint': '提交时会自动暂存所有未暂存改动(也可以先手动选择要暂存的文件)',
263
261
  'git.commitNeedsMessage': '请先填写提交信息,再按 ⌘⇧↵ 提交',
264
- 'git.commitDone': '提交成功',
265
262
  'git.more': '更多操作',
266
263
  'git.viewDiff': '查看改动对比',
267
264
  'git.copyPath': '复制文件路径',
@@ -289,8 +286,6 @@ const DICT_ZH = {
289
286
  'diff.stageFile': '暂存文件',
290
287
  'git.discardAll': '撤销所有未暂存改动',
291
288
  'git.discardConfirm': '再点一次确认撤销(未跟踪文件不会被删除)',
292
- 'git.discardDone': '已撤销所有改动(未跟踪文件保留)',
293
- 'git.pullDone': '拉取完成',
294
289
  'git.committed': '已提交',
295
290
  'git.refresh': '刷新',
296
291
  'git.staged': '已暂存',
@@ -467,7 +462,6 @@ const DICT_EN = {
467
462
  'search.replaceAll': 'Replace all',
468
463
  'search.replaceThisFile': 'Replace in this file',
469
464
  'search.replacing': 'Replacing…',
470
- 'search.replaced': 'Replaced {count} occurrences ({files} files)',
471
465
  'search.confirmReplace': 'Replace {count} occurrences in {files} files? This writes files directly; editor undo will not work.',
472
466
  'search.confirmYes': 'Replace',
473
467
  'search.confirmNo': 'Cancel',
@@ -508,11 +502,9 @@ const DICT_EN = {
508
502
  'git.behindCount': 'to pull',
509
503
  'git.pull': 'Pull',
510
504
  'git.noUpstreamHint': 'No upstream for this branch yet: click ↑ in the header to push once (auto git push -u)',
511
- 'git.pushDone': 'Pushed',
512
505
  'git.discardFile': 'Revert this file',
513
506
  'git.autoStageHint': 'Committing auto-stages all unstaged changes',
514
507
  'git.commitNeedsMessage': 'Write a commit message first, then press ⌘⇧↵',
515
- 'git.commitDone': 'Committed',
516
508
  'git.more': 'More actions',
517
509
  'git.viewDiff': 'View diff',
518
510
  'git.copyPath': 'Copy file path',
@@ -540,8 +532,6 @@ const DICT_EN = {
540
532
  'diff.stageFile': 'Stage file',
541
533
  'git.discardAll': 'Discard all unstaged changes',
542
534
  'git.discardConfirm': 'Click again to confirm (untracked files are kept)',
543
- 'git.discardDone': 'All changes discarded (untracked files kept)',
544
- 'git.pullDone': 'Pull complete',
545
535
  'git.committed': 'Committed',
546
536
  'git.refresh': 'Refresh',
547
537
  'git.staged': 'Staged',
@@ -1751,7 +1741,6 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
1751
1741
  .gufa-search-action[data-primary]{background:var(--gufa-accent);border-color:var(--gufa-accent);color:#fff}
1752
1742
  .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)}
1753
1743
  .gufa-search-confirm-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:6px}
1754
- .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)}
1755
1744
  .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)}
1756
1745
  .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}
1757
1746
  .gufa-search-file-replace:hover{background:var(--gufa-active);color:var(--gufa-text)}
@@ -1889,15 +1878,6 @@ html[data-gufa-ide] .liang-skin-backdrop{display:none!important}
1889
1878
  .gufa-git-sync[data-active]{color:var(--gufa-accent)}
1890
1879
  .gufa-git-sync-count{font-size:10.5px;font-variant-numeric:tabular-nums;min-width:8px;text-align:center}
1891
1880
  .gufa-git-sync[data-active] .gufa-git-sync-count{font-weight:700}
1892
- .gufa-info-banner{display:flex;align-items:center;gap:6px;margin:8px 10px 0;padding:4px 8px;border-radius:6px;font-size:11.5px;
1893
- color:var(--dsw-alias-state-success-primary, #3fa66f);border:1px solid color-mix(in srgb, currentColor 35%, transparent);
1894
- background:color-mix(in srgb, currentColor 10%, transparent)}
1895
- .gufa-toast-success{position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:2147483300;
1896
- display:flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;font-size:12px;pointer-events:none;
1897
- color:var(--dsw-alias-state-success-primary, #3fb950);
1898
- background:color-mix(in srgb, #3fb950 16%, var(--gufa-solid-overlay-bg, #1c1c1c));
1899
- border:1px solid color-mix(in srgb, #3fb950 50%, transparent);
1900
- box-shadow:0 8px 24px rgba(0,0,0,.35);backdrop-filter:blur(8px)}
1901
1881
  /* 资源管理器:Git 改动状态颜色(M/A/D/R/??) */
1902
1882
  .gufa-tree-row[data-git-status="M"] .gufa-tree-name{color:#e5c07b}
1903
1883
  .gufa-tree-row[data-git-status="A"] .gufa-tree-name{color:#3fb950}
@@ -7041,7 +7021,6 @@ G.Explorer = function Explorer(props) {
7041
7021
  await loadDir(targetDir)
7042
7022
  await loadDir('')
7043
7023
  props.onChanged?.()
7044
- showNotice(`已粘贴 ${written.length} 个文件到 ${targetDir === '' ? '项目根目录' : targetDir}`)
7045
7024
  } catch (error) {
7046
7025
  showNotice(`粘贴失败:${G.errorText(error)}`)
7047
7026
  }
@@ -7372,7 +7351,6 @@ G.SearchPanel = function SearchPanel(props) {
7372
7351
  const [confirming, setConfirming] = useState(null)
7373
7352
  const [replacing, setReplacing] = useState(false)
7374
7353
  const [replaceError, setReplaceError] = useState('')
7375
- const [notice, setNotice] = useState('')
7376
7354
  const inputRef = useRef(null)
7377
7355
  const requestRef = useRef(0)
7378
7356
 
@@ -7494,7 +7472,6 @@ G.SearchPanel = function SearchPanel(props) {
7494
7472
  if (typeof root !== 'string' || root === '' || replacing) return
7495
7473
  setReplacing(true)
7496
7474
  setReplaceError('')
7497
- setNotice('')
7498
7475
  try {
7499
7476
  await props.onBeforeReplace?.()
7500
7477
  const value = await G.api('fs.replace', payload)
@@ -7504,9 +7481,7 @@ G.SearchPanel = function SearchPanel(props) {
7504
7481
  await runSearch(query)
7505
7482
  return
7506
7483
  }
7507
- const count = Number(value?.replacedCount) || 0
7508
7484
  const files = Array.isArray(value?.replacedFiles) ? value.replacedFiles : []
7509
- setNotice(t('search.replaced', { count, files: files.length }))
7510
7485
  await props.onFilesChanged?.(files)
7511
7486
  setIgnored(new Set())
7512
7487
  await runSearch(query)
@@ -7520,7 +7495,6 @@ G.SearchPanel = function SearchPanel(props) {
7520
7495
  const requestReplaceAll = () => {
7521
7496
  if (view === null || view.total === 0 || replacing) return
7522
7497
  setReplaceError('')
7523
- setNotice('')
7524
7498
  setConfirming({ count: view.total, files: view.files.length })
7525
7499
  }
7526
7500
  const doReplaceAll = () => {
@@ -7832,7 +7806,6 @@ G.SearchPanel = function SearchPanel(props) {
7832
7806
  ),
7833
7807
  )
7834
7808
  : null,
7835
- notice !== '' ? h('div', { className: 'gufa-search-notice' }, notice) : null,
7836
7809
  replaceError !== '' ? h('div', { className: 'gufa-search-error' }, `${t('search.replaceError')}:${replaceError}`) : null,
7837
7810
  ),
7838
7811
  h('div', { className: 'gufa-panel-body gufa-scroll' }, body),
@@ -7847,14 +7820,6 @@ G.GitPanel = function GitPanel(props) {
7847
7820
  const [error, setError] = useState('')
7848
7821
  const [pending, setPending] = useState(false)
7849
7822
  const [message, setMessage] = useState('')
7850
- const [info, setInfo] = useState('')
7851
-
7852
- /* 操作结果提示(已推送 / 拉取完成 等)自动消失 */
7853
- useEffect(() => {
7854
- if (info === '') return undefined
7855
- const timer = window.setTimeout(() => setInfo(''), 1500)
7856
- return () => window.clearTimeout(timer)
7857
- }, [info])
7858
7823
  const [discardArmed, setDiscardArmed] = useState(false)
7859
7824
  const [headMenu, setHeadMenu] = useState(null)
7860
7825
  const [rowMenu, setRowMenu] = useState(null)
@@ -7903,7 +7868,6 @@ G.GitPanel = function GitPanel(props) {
7903
7868
  const act = async (fn) => {
7904
7869
  setPending(true)
7905
7870
  setError('')
7906
- setInfo('')
7907
7871
  try {
7908
7872
  await fn()
7909
7873
  await refresh()
@@ -7918,21 +7882,17 @@ G.GitPanel = function GitPanel(props) {
7918
7882
  /* 推送 / 拉取:点 ↑/↓ 直接执行 */
7919
7883
  const push = () => void act(async () => {
7920
7884
  await G.api('git.push', { root })
7921
- setInfo(t('git.pushDone'))
7922
7885
  })
7923
7886
  const pull = () => void act(async () => {
7924
7887
  await G.api('git.pull', { root })
7925
- setInfo(t('git.pullDone'))
7926
7888
  })
7927
7889
 
7928
7890
  /* 推送 / 拉取(新建分支还没有上游时也能直接发布:Host 会自动 -u <remote> <branch>) */
7929
7891
  const pushBranch = () => void act(async () => {
7930
7892
  await G.api('git.push', { root })
7931
- setInfo(t('git.pushDone'))
7932
7893
  })
7933
7894
  const pullBranch = () => void act(async () => {
7934
7895
  await G.api('git.pull', { root })
7935
- setInfo(t('git.pullDone'))
7936
7896
  })
7937
7897
 
7938
7898
  /* 一键撤销所有未暂存改动:第一次点击进入「再点确认」,3 秒后自动取消 */
@@ -7945,7 +7905,6 @@ G.GitPanel = function GitPanel(props) {
7945
7905
  setDiscardArmed(false)
7946
7906
  void act(async () => {
7947
7907
  await G.api('git.discardAll', { root })
7948
- setInfo(t('git.discardDone'))
7949
7908
  })
7950
7909
  }
7951
7910
 
@@ -7954,7 +7913,7 @@ G.GitPanel = function GitPanel(props) {
7954
7913
  if (root === null || pending) return
7955
7914
  const text = typeof message === 'string' ? message.trim() : ''
7956
7915
  if (text === '') {
7957
- setInfo(t('git.commitNeedsMessage'))
7916
+ setError(t('git.commitNeedsMessage'))
7958
7917
  return
7959
7918
  }
7960
7919
  void act(async () => {
@@ -7963,7 +7922,6 @@ G.GitPanel = function GitPanel(props) {
7963
7922
  if (toStage.length > 0) await G.api('git.stage', { root, paths: toStage })
7964
7923
  await G.api('git.commit', { root, message: text })
7965
7924
  setMessage('')
7966
- setInfo(t('git.commitDone'))
7967
7925
  })
7968
7926
  }
7969
7927
  commitRef.current = commit
@@ -8085,7 +8043,6 @@ G.GitPanel = function GitPanel(props) {
8085
8043
  'div',
8086
8044
  { className: 'gufa-panel-body gufa-scroll', style: { display: 'flex', flexDirection: 'column' } },
8087
8045
  error !== '' ? h('div', { className: 'gufa-error-banner' }, G.Icon ? h(G.Icon, { name: 'warn', size: 13 }) : null, error) : null,
8088
- info !== '' ? h('div', { className: 'gufa-info-banner' }, info) : null,
8089
8046
  !root
8090
8047
  ? h(G.Empty, { icon: 'git', title: t('explorer.openProjectFirst') })
8091
8048
  : status === null
@@ -10610,7 +10567,6 @@ G.GufaApp = function GufaApp(props) {
10610
10567
  const [modal, setModal] = useState(null)
10611
10568
  const [shortcutsOpen, setShortcutsOpen] = useState(false)
10612
10569
  const [trashUndo, setTrashUndo] = useState([])
10613
- const [bannerTone, setBannerTone] = useState('error')
10614
10570
  const [branchMenu, setBranchMenu] = useState(null)
10615
10571
  const [workspaceDialog, setWorkspaceDialog] = useState(null)
10616
10572
  const [workspaceSessions, setWorkspaceSessions] = useState({ status: 'idle', sessions: [], groups: [], sessionIds: [], archivedSessionIds: [] })
@@ -10993,28 +10949,11 @@ G.GufaApp = function GufaApp(props) {
10993
10949
  void refreshGit()
10994
10950
  }, [project, patchTab, refreshGit])
10995
10951
 
10996
- /** 顶栏提示:错误常驻红色;成功用绿色 toast,1.2 秒后自动消失。 */
10997
- const successTimerRef = useRef(null)
10952
+ /** 顶栏提示:只显示错误/需要用户处理的提示;成功类操作直接看界面结果,不再弹 toast。 */
10998
10953
  const showBanner = useCallback((text, tone) => {
10999
- if (successTimerRef.current !== null) {
11000
- window.clearTimeout(successTimerRef.current)
11001
- successTimerRef.current = null
11002
- }
11003
- if (tone === 'success') {
11004
- setBannerTone('success')
11005
- setBanner(text)
11006
- successTimerRef.current = window.setTimeout(() => {
11007
- successTimerRef.current = null
11008
- setBanner('')
11009
- }, 1200)
11010
- return
11011
- }
11012
- setBannerTone('error')
10954
+ if (tone === 'success') return
11013
10955
  setBanner(text)
11014
10956
  }, [])
11015
- useEffect(() => () => {
11016
- if (successTimerRef.current !== null) window.clearTimeout(successTimerRef.current)
11017
- }, [])
11018
10957
 
11019
10958
  const closeTab = useCallback((path) => {
11020
10959
  editorBuffersRef.current.delete(path)
@@ -11142,7 +11081,6 @@ G.GufaApp = function GufaApp(props) {
11142
11081
  try {
11143
11082
  await G.api('git.checkout', { root: project.root, branch: name })
11144
11083
  closeBranchMenu()
11145
- showBanner(`已切换到分支 ${name}`, 'success')
11146
11084
  setGitRefreshToken((token) => token + 1)
11147
11085
  setRefreshToken((token) => token + 1)
11148
11086
  void refreshGit()
@@ -11158,7 +11096,6 @@ G.GufaApp = function GufaApp(props) {
11158
11096
  try {
11159
11097
  await G.api('git.createBranch', { root: project.root, name })
11160
11098
  closeBranchMenu()
11161
- showBanner(`已创建并切换到分支 ${name}`, 'success')
11162
11099
  setGitRefreshToken((token) => token + 1)
11163
11100
  setRefreshToken((token) => token + 1)
11164
11101
  void refreshGit()
@@ -11322,7 +11259,6 @@ G.GufaApp = function GufaApp(props) {
11322
11259
  if (project === null) return
11323
11260
  try {
11324
11261
  await G.api('git.discard', { root: project.root, paths: [path] })
11325
- showBanner('已还原该文件的改动', 'success')
11326
11262
  // 改动已还原:关掉该 diff 标签(内容已与暂存区一致)
11327
11263
  setTabs((current) => current.filter((tab) => tab.path !== path))
11328
11264
  setActivePath((current) => (current === path ? null : current))
@@ -11338,7 +11274,6 @@ G.GufaApp = function GufaApp(props) {
11338
11274
  if (project === null) return
11339
11275
  try {
11340
11276
  await G.api('git.stage', { root: project.root, paths: [path] })
11341
- showBanner('已暂存该文件', 'success')
11342
11277
  setGitRefreshToken((token) => token + 1)
11343
11278
  void refreshGit()
11344
11279
  } catch (error) {
@@ -11823,7 +11758,6 @@ G.GufaApp = function GufaApp(props) {
11823
11758
  const missingSet = new Set(missing)
11824
11759
  setTabs((current) => current.filter((tab) => tab !== null && !missingSet.has(tab.path)))
11825
11760
  setActivePath((current) => (current !== null && missingSet.has(current) ? null : current))
11826
- showBanner(`已关闭 ${missing.length} 个已删除文件的标签`, 'success')
11827
11761
  }, [project, tabs, showBanner])
11828
11762
  const pruneMissingTabsRef = useRef(null)
11829
11763
  pruneMissingTabsRef.current = pruneMissingTabs
@@ -11993,7 +11927,6 @@ G.GufaApp = function GufaApp(props) {
11993
11927
  await openProjectPath(workspace.path)
11994
11928
  }
11995
11929
  closeWorkspaceDialog()
11996
- showBanner(`已切换到工作区 ${workspace.title || workspace.path || ''}`, 'success')
11997
11930
  } catch (error) {
11998
11931
  setWorkspaceDialog((current) => (current === null ? current : { ...current, error: G.errorText(error) }))
11999
11932
  }
@@ -12024,7 +11957,6 @@ G.GufaApp = function GufaApp(props) {
12024
11957
  }
12025
11958
  await openProjectPath(directory)
12026
11959
  closeWorkspaceDialog()
12027
- showBanner('已创建工作区', 'success')
12028
11960
  } catch (error) {
12029
11961
  setBanner(G.errorText(error))
12030
11962
  } finally {
@@ -12801,10 +12733,7 @@ G.GufaApp = function GufaApp(props) {
12801
12733
  h(
12802
12734
  'div',
12803
12735
  { className: 'gufa-editor-area' },
12804
- banner !== '' && bannerTone === 'success'
12805
- ? h('div', { className: 'gufa-toast-success' }, h(G.Icon, { name: 'check', size: 13 }), h('span', null, banner))
12806
- : null,
12807
- banner !== '' && bannerTone !== 'success'
12736
+ banner !== ''
12808
12737
  ? h(
12809
12738
  'div',
12810
12739
  { className: 'gufa-error-banner' },
@@ -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.64</string>
11
- <key>CFBundleVersion</key><string>1.3.64</string>
10
+ <key>CFBundleShortVersionString</key><string>1.3.65</string>
11
+ <key>CFBundleVersion</key><string>1.3.65</string>
12
12
  <key>LSUIElement</key><true/>
13
13
  <key>NSHighResolutionCapable</key><true/>
14
14
  <key>NSPrincipalClass</key><string>NSApplication</string>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gufa-code",
3
- "version": "1.3.64",
3
+ "version": "1.3.65",
4
4
  "description": "古法编程 · AI 辅助:一键把 DSH 主面板变成 VS Code 风格 IDE(Monaco 编辑器、文件树、Git、SSH、真实终端 + 右侧官方会话);主张亲手写、每个改动心中有数,AI 是助理、你是第一责任人",
5
5
  "icon": "icon.svg",
6
6
  "keywords": [
@@ -208,7 +208,6 @@ const DICT_ZH = {
208
208
  'search.replaceAll': '全部替换',
209
209
  'search.replaceThisFile': '替换此文件',
210
210
  'search.replacing': '替换中…',
211
- 'search.replaced': '已替换 {count} 处({files} 个文件)',
212
211
  'search.confirmReplace': '确定替换 {count} 处({files} 个文件)?直接写文件,编辑器撤销无效。',
213
212
  'search.confirmYes': '确定替换',
214
213
  'search.confirmNo': '取消',
@@ -249,11 +248,9 @@ const DICT_ZH = {
249
248
  'git.behindCount': '待拉取',
250
249
  'git.pull': '拉取',
251
250
  'git.noUpstreamHint': '当前分支还没有上游:点标题栏 ↑ 推送一次即可自动创建上游(git push -u)',
252
- 'git.pushDone': '已推送(如需首次建立上游会自动 -u)',
253
251
  'git.discardFile': '还原该文件的改动',
254
252
  'git.autoStageHint': '提交时会自动暂存所有未暂存改动(也可以先手动选择要暂存的文件)',
255
253
  'git.commitNeedsMessage': '请先填写提交信息,再按 ⌘⇧↵ 提交',
256
- 'git.commitDone': '提交成功',
257
254
  'git.more': '更多操作',
258
255
  'git.viewDiff': '查看改动对比',
259
256
  'git.copyPath': '复制文件路径',
@@ -281,8 +278,6 @@ const DICT_ZH = {
281
278
  'diff.stageFile': '暂存文件',
282
279
  'git.discardAll': '撤销所有未暂存改动',
283
280
  'git.discardConfirm': '再点一次确认撤销(未跟踪文件不会被删除)',
284
- 'git.discardDone': '已撤销所有改动(未跟踪文件保留)',
285
- 'git.pullDone': '拉取完成',
286
281
  'git.committed': '已提交',
287
282
  'git.refresh': '刷新',
288
283
  'git.staged': '已暂存',
@@ -459,7 +454,6 @@ const DICT_EN = {
459
454
  'search.replaceAll': 'Replace all',
460
455
  'search.replaceThisFile': 'Replace in this file',
461
456
  'search.replacing': 'Replacing…',
462
- 'search.replaced': 'Replaced {count} occurrences ({files} files)',
463
457
  'search.confirmReplace': 'Replace {count} occurrences in {files} files? This writes files directly; editor undo will not work.',
464
458
  'search.confirmYes': 'Replace',
465
459
  'search.confirmNo': 'Cancel',
@@ -500,11 +494,9 @@ const DICT_EN = {
500
494
  'git.behindCount': 'to pull',
501
495
  'git.pull': 'Pull',
502
496
  'git.noUpstreamHint': 'No upstream for this branch yet: click ↑ in the header to push once (auto git push -u)',
503
- 'git.pushDone': 'Pushed',
504
497
  'git.discardFile': 'Revert this file',
505
498
  'git.autoStageHint': 'Committing auto-stages all unstaged changes',
506
499
  'git.commitNeedsMessage': 'Write a commit message first, then press ⌘⇧↵',
507
- 'git.commitDone': 'Committed',
508
500
  'git.more': 'More actions',
509
501
  'git.viewDiff': 'View diff',
510
502
  'git.copyPath': 'Copy file path',
@@ -532,8 +524,6 @@ const DICT_EN = {
532
524
  'diff.stageFile': 'Stage file',
533
525
  'git.discardAll': 'Discard all unstaged changes',
534
526
  'git.discardConfirm': 'Click again to confirm (untracked files are kept)',
535
- 'git.discardDone': 'All changes discarded (untracked files kept)',
536
- 'git.pullDone': 'Pull complete',
537
527
  'git.committed': 'Committed',
538
528
  'git.refresh': 'Refresh',
539
529
  'git.staged': 'Staged',
@@ -1743,7 +1733,6 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
1743
1733
  .gufa-search-action[data-primary]{background:var(--gufa-accent);border-color:var(--gufa-accent);color:#fff}
1744
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)}
1745
1735
  .gufa-search-confirm-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:6px}
1746
- .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)}
1747
1736
  .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)}
1748
1737
  .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}
1749
1738
  .gufa-search-file-replace:hover{background:var(--gufa-active);color:var(--gufa-text)}
@@ -1881,15 +1870,6 @@ html[data-gufa-ide] .liang-skin-backdrop{display:none!important}
1881
1870
  .gufa-git-sync[data-active]{color:var(--gufa-accent)}
1882
1871
  .gufa-git-sync-count{font-size:10.5px;font-variant-numeric:tabular-nums;min-width:8px;text-align:center}
1883
1872
  .gufa-git-sync[data-active] .gufa-git-sync-count{font-weight:700}
1884
- .gufa-info-banner{display:flex;align-items:center;gap:6px;margin:8px 10px 0;padding:4px 8px;border-radius:6px;font-size:11.5px;
1885
- color:var(--dsw-alias-state-success-primary, #3fa66f);border:1px solid color-mix(in srgb, currentColor 35%, transparent);
1886
- background:color-mix(in srgb, currentColor 10%, transparent)}
1887
- .gufa-toast-success{position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:2147483300;
1888
- display:flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;font-size:12px;pointer-events:none;
1889
- color:var(--dsw-alias-state-success-primary, #3fb950);
1890
- background:color-mix(in srgb, #3fb950 16%, var(--gufa-solid-overlay-bg, #1c1c1c));
1891
- border:1px solid color-mix(in srgb, #3fb950 50%, transparent);
1892
- box-shadow:0 8px 24px rgba(0,0,0,.35);backdrop-filter:blur(8px)}
1893
1873
  /* 资源管理器:Git 改动状态颜色(M/A/D/R/??) */
1894
1874
  .gufa-tree-row[data-git-status="M"] .gufa-tree-name{color:#e5c07b}
1895
1875
  .gufa-tree-row[data-git-status="A"] .gufa-tree-name{color:#3fb950}
@@ -199,7 +199,6 @@ G.Explorer = function Explorer(props) {
199
199
  await loadDir(targetDir)
200
200
  await loadDir('')
201
201
  props.onChanged?.()
202
- showNotice(`已粘贴 ${written.length} 个文件到 ${targetDir === '' ? '项目根目录' : targetDir}`)
203
202
  } catch (error) {
204
203
  showNotice(`粘贴失败:${G.errorText(error)}`)
205
204
  }
@@ -530,7 +529,6 @@ G.SearchPanel = function SearchPanel(props) {
530
529
  const [confirming, setConfirming] = useState(null)
531
530
  const [replacing, setReplacing] = useState(false)
532
531
  const [replaceError, setReplaceError] = useState('')
533
- const [notice, setNotice] = useState('')
534
532
  const inputRef = useRef(null)
535
533
  const requestRef = useRef(0)
536
534
 
@@ -652,7 +650,6 @@ G.SearchPanel = function SearchPanel(props) {
652
650
  if (typeof root !== 'string' || root === '' || replacing) return
653
651
  setReplacing(true)
654
652
  setReplaceError('')
655
- setNotice('')
656
653
  try {
657
654
  await props.onBeforeReplace?.()
658
655
  const value = await G.api('fs.replace', payload)
@@ -662,9 +659,7 @@ G.SearchPanel = function SearchPanel(props) {
662
659
  await runSearch(query)
663
660
  return
664
661
  }
665
- const count = Number(value?.replacedCount) || 0
666
662
  const files = Array.isArray(value?.replacedFiles) ? value.replacedFiles : []
667
- setNotice(t('search.replaced', { count, files: files.length }))
668
663
  await props.onFilesChanged?.(files)
669
664
  setIgnored(new Set())
670
665
  await runSearch(query)
@@ -678,7 +673,6 @@ G.SearchPanel = function SearchPanel(props) {
678
673
  const requestReplaceAll = () => {
679
674
  if (view === null || view.total === 0 || replacing) return
680
675
  setReplaceError('')
681
- setNotice('')
682
676
  setConfirming({ count: view.total, files: view.files.length })
683
677
  }
684
678
  const doReplaceAll = () => {
@@ -990,7 +984,6 @@ G.SearchPanel = function SearchPanel(props) {
990
984
  ),
991
985
  )
992
986
  : null,
993
- notice !== '' ? h('div', { className: 'gufa-search-notice' }, notice) : null,
994
987
  replaceError !== '' ? h('div', { className: 'gufa-search-error' }, `${t('search.replaceError')}:${replaceError}`) : null,
995
988
  ),
996
989
  h('div', { className: 'gufa-panel-body gufa-scroll' }, body),
@@ -1005,14 +998,6 @@ G.GitPanel = function GitPanel(props) {
1005
998
  const [error, setError] = useState('')
1006
999
  const [pending, setPending] = useState(false)
1007
1000
  const [message, setMessage] = useState('')
1008
- const [info, setInfo] = useState('')
1009
-
1010
- /* 操作结果提示(已推送 / 拉取完成 等)自动消失 */
1011
- useEffect(() => {
1012
- if (info === '') return undefined
1013
- const timer = window.setTimeout(() => setInfo(''), 1500)
1014
- return () => window.clearTimeout(timer)
1015
- }, [info])
1016
1001
  const [discardArmed, setDiscardArmed] = useState(false)
1017
1002
  const [headMenu, setHeadMenu] = useState(null)
1018
1003
  const [rowMenu, setRowMenu] = useState(null)
@@ -1061,7 +1046,6 @@ G.GitPanel = function GitPanel(props) {
1061
1046
  const act = async (fn) => {
1062
1047
  setPending(true)
1063
1048
  setError('')
1064
- setInfo('')
1065
1049
  try {
1066
1050
  await fn()
1067
1051
  await refresh()
@@ -1076,21 +1060,17 @@ G.GitPanel = function GitPanel(props) {
1076
1060
  /* 推送 / 拉取:点 ↑/↓ 直接执行 */
1077
1061
  const push = () => void act(async () => {
1078
1062
  await G.api('git.push', { root })
1079
- setInfo(t('git.pushDone'))
1080
1063
  })
1081
1064
  const pull = () => void act(async () => {
1082
1065
  await G.api('git.pull', { root })
1083
- setInfo(t('git.pullDone'))
1084
1066
  })
1085
1067
 
1086
1068
  /* 推送 / 拉取(新建分支还没有上游时也能直接发布:Host 会自动 -u <remote> <branch>) */
1087
1069
  const pushBranch = () => void act(async () => {
1088
1070
  await G.api('git.push', { root })
1089
- setInfo(t('git.pushDone'))
1090
1071
  })
1091
1072
  const pullBranch = () => void act(async () => {
1092
1073
  await G.api('git.pull', { root })
1093
- setInfo(t('git.pullDone'))
1094
1074
  })
1095
1075
 
1096
1076
  /* 一键撤销所有未暂存改动:第一次点击进入「再点确认」,3 秒后自动取消 */
@@ -1103,7 +1083,6 @@ G.GitPanel = function GitPanel(props) {
1103
1083
  setDiscardArmed(false)
1104
1084
  void act(async () => {
1105
1085
  await G.api('git.discardAll', { root })
1106
- setInfo(t('git.discardDone'))
1107
1086
  })
1108
1087
  }
1109
1088
 
@@ -1112,7 +1091,7 @@ G.GitPanel = function GitPanel(props) {
1112
1091
  if (root === null || pending) return
1113
1092
  const text = typeof message === 'string' ? message.trim() : ''
1114
1093
  if (text === '') {
1115
- setInfo(t('git.commitNeedsMessage'))
1094
+ setError(t('git.commitNeedsMessage'))
1116
1095
  return
1117
1096
  }
1118
1097
  void act(async () => {
@@ -1121,7 +1100,6 @@ G.GitPanel = function GitPanel(props) {
1121
1100
  if (toStage.length > 0) await G.api('git.stage', { root, paths: toStage })
1122
1101
  await G.api('git.commit', { root, message: text })
1123
1102
  setMessage('')
1124
- setInfo(t('git.commitDone'))
1125
1103
  })
1126
1104
  }
1127
1105
  commitRef.current = commit
@@ -1243,7 +1221,6 @@ G.GitPanel = function GitPanel(props) {
1243
1221
  'div',
1244
1222
  { className: 'gufa-panel-body gufa-scroll', style: { display: 'flex', flexDirection: 'column' } },
1245
1223
  error !== '' ? h('div', { className: 'gufa-error-banner' }, G.Icon ? h(G.Icon, { name: 'warn', size: 13 }) : null, error) : null,
1246
- info !== '' ? h('div', { className: 'gufa-info-banner' }, info) : null,
1247
1224
  !root
1248
1225
  ? h(G.Empty, { icon: 'git', title: t('explorer.openProjectFirst') })
1249
1226
  : status === null
@@ -268,7 +268,6 @@ G.GufaApp = function GufaApp(props) {
268
268
  const [modal, setModal] = useState(null)
269
269
  const [shortcutsOpen, setShortcutsOpen] = useState(false)
270
270
  const [trashUndo, setTrashUndo] = useState([])
271
- const [bannerTone, setBannerTone] = useState('error')
272
271
  const [branchMenu, setBranchMenu] = useState(null)
273
272
  const [workspaceDialog, setWorkspaceDialog] = useState(null)
274
273
  const [workspaceSessions, setWorkspaceSessions] = useState({ status: 'idle', sessions: [], groups: [], sessionIds: [], archivedSessionIds: [] })
@@ -651,28 +650,11 @@ G.GufaApp = function GufaApp(props) {
651
650
  void refreshGit()
652
651
  }, [project, patchTab, refreshGit])
653
652
 
654
- /** 顶栏提示:错误常驻红色;成功用绿色 toast,1.2 秒后自动消失。 */
655
- const successTimerRef = useRef(null)
653
+ /** 顶栏提示:只显示错误/需要用户处理的提示;成功类操作直接看界面结果,不再弹 toast。 */
656
654
  const showBanner = useCallback((text, tone) => {
657
- if (successTimerRef.current !== null) {
658
- window.clearTimeout(successTimerRef.current)
659
- successTimerRef.current = null
660
- }
661
- if (tone === 'success') {
662
- setBannerTone('success')
663
- setBanner(text)
664
- successTimerRef.current = window.setTimeout(() => {
665
- successTimerRef.current = null
666
- setBanner('')
667
- }, 1200)
668
- return
669
- }
670
- setBannerTone('error')
655
+ if (tone === 'success') return
671
656
  setBanner(text)
672
657
  }, [])
673
- useEffect(() => () => {
674
- if (successTimerRef.current !== null) window.clearTimeout(successTimerRef.current)
675
- }, [])
676
658
 
677
659
  const closeTab = useCallback((path) => {
678
660
  editorBuffersRef.current.delete(path)
@@ -800,7 +782,6 @@ G.GufaApp = function GufaApp(props) {
800
782
  try {
801
783
  await G.api('git.checkout', { root: project.root, branch: name })
802
784
  closeBranchMenu()
803
- showBanner(`已切换到分支 ${name}`, 'success')
804
785
  setGitRefreshToken((token) => token + 1)
805
786
  setRefreshToken((token) => token + 1)
806
787
  void refreshGit()
@@ -816,7 +797,6 @@ G.GufaApp = function GufaApp(props) {
816
797
  try {
817
798
  await G.api('git.createBranch', { root: project.root, name })
818
799
  closeBranchMenu()
819
- showBanner(`已创建并切换到分支 ${name}`, 'success')
820
800
  setGitRefreshToken((token) => token + 1)
821
801
  setRefreshToken((token) => token + 1)
822
802
  void refreshGit()
@@ -980,7 +960,6 @@ G.GufaApp = function GufaApp(props) {
980
960
  if (project === null) return
981
961
  try {
982
962
  await G.api('git.discard', { root: project.root, paths: [path] })
983
- showBanner('已还原该文件的改动', 'success')
984
963
  // 改动已还原:关掉该 diff 标签(内容已与暂存区一致)
985
964
  setTabs((current) => current.filter((tab) => tab.path !== path))
986
965
  setActivePath((current) => (current === path ? null : current))
@@ -996,7 +975,6 @@ G.GufaApp = function GufaApp(props) {
996
975
  if (project === null) return
997
976
  try {
998
977
  await G.api('git.stage', { root: project.root, paths: [path] })
999
- showBanner('已暂存该文件', 'success')
1000
978
  setGitRefreshToken((token) => token + 1)
1001
979
  void refreshGit()
1002
980
  } catch (error) {
@@ -1481,7 +1459,6 @@ G.GufaApp = function GufaApp(props) {
1481
1459
  const missingSet = new Set(missing)
1482
1460
  setTabs((current) => current.filter((tab) => tab !== null && !missingSet.has(tab.path)))
1483
1461
  setActivePath((current) => (current !== null && missingSet.has(current) ? null : current))
1484
- showBanner(`已关闭 ${missing.length} 个已删除文件的标签`, 'success')
1485
1462
  }, [project, tabs, showBanner])
1486
1463
  const pruneMissingTabsRef = useRef(null)
1487
1464
  pruneMissingTabsRef.current = pruneMissingTabs
@@ -1651,7 +1628,6 @@ G.GufaApp = function GufaApp(props) {
1651
1628
  await openProjectPath(workspace.path)
1652
1629
  }
1653
1630
  closeWorkspaceDialog()
1654
- showBanner(`已切换到工作区 ${workspace.title || workspace.path || ''}`, 'success')
1655
1631
  } catch (error) {
1656
1632
  setWorkspaceDialog((current) => (current === null ? current : { ...current, error: G.errorText(error) }))
1657
1633
  }
@@ -1682,7 +1658,6 @@ G.GufaApp = function GufaApp(props) {
1682
1658
  }
1683
1659
  await openProjectPath(directory)
1684
1660
  closeWorkspaceDialog()
1685
- showBanner('已创建工作区', 'success')
1686
1661
  } catch (error) {
1687
1662
  setBanner(G.errorText(error))
1688
1663
  } finally {
@@ -2459,10 +2434,7 @@ G.GufaApp = function GufaApp(props) {
2459
2434
  h(
2460
2435
  'div',
2461
2436
  { className: 'gufa-editor-area' },
2462
- banner !== '' && bannerTone === 'success'
2463
- ? h('div', { className: 'gufa-toast-success' }, h(G.Icon, { name: 'check', size: 13 }), h('span', null, banner))
2464
- : null,
2465
- banner !== '' && bannerTone !== 'success'
2437
+ banner !== ''
2466
2438
  ? h(
2467
2439
  'div',
2468
2440
  { className: 'gufa-error-banner' },