dsh-gufa-code 1.3.114 → 1.3.115

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.114'
19
+ G.BUILD = '1.3.115'
20
20
  G.PANEL_ID = 'gufa-code'
21
21
  /** 从哪个工作区点进来的(工作区菜单/节点按钮写入,App 启动时消费)。 */
22
22
  G.pendingEntryWorkspace = null
@@ -8796,11 +8796,17 @@ G.GitPanel = function GitPanel(props) {
8796
8796
  }
8797
8797
 
8798
8798
  const commitRef = useRef(null)
8799
+ const messageRef = useRef(null)
8799
8800
  const commit = () => {
8800
8801
  if (root === null || pending) return
8801
8802
  const text = typeof message === 'string' ? message.trim() : ''
8802
8803
  if (text === '') {
8803
8804
  setError(t('git.commitNeedsMessage'))
8805
+ try {
8806
+ messageRef.current?.focus()
8807
+ } catch {
8808
+ /* ignore */
8809
+ }
8804
8810
  return
8805
8811
  }
8806
8812
  if (changes.length === 0) {
@@ -8984,6 +8990,7 @@ G.GitPanel = function GitPanel(props) {
8984
8990
  ? h(
8985
8991
  'textarea',
8986
8992
  {
8993
+ ref: messageRef,
8987
8994
  className: 'gufa-textarea',
8988
8995
  placeholder: t('git.commitPlaceholder'),
8989
8996
  value: message,
@@ -9006,7 +9013,7 @@ G.GitPanel = function GitPanel(props) {
9006
9013
  'div',
9007
9014
  { className: 'gufa-row', style: { justifyContent: 'flex-end', alignItems: 'center', gap: 8 } },
9008
9015
  staged.length > 0 ? h('span', { className: 'gufa-hint' }, `${t('git.staged')} (${staged.length})`) : null,
9009
- h(G.Button, { disabled: pending || message.trim() === '' || changes.length === 0, primary: true, onClick: commit }, pending ? h(G.Spinner) : null, t('git.commit')),
9016
+ h(G.Button, { disabled: pending || changes.length === 0, primary: true, onClick: commit }, pending ? h(G.Spinner) : null, t('git.commit')),
9010
9017
  )
9011
9018
  : null,
9012
9019
  staged.length > 0 ? h('div', { className: 'gufa-hint' }, `${t('git.staged')} (${staged.length})`) : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gufa-code",
3
- "version": "1.3.114",
3
+ "version": "1.3.115",
4
4
  "description": "古法编程 · AI 辅助:一键把 DSH 主面板变成 VS Code 风格 IDE(Monaco 编辑器、文件树、Git、SSH、真实终端 + 右侧官方会话);主张亲手写、每个改动心中有数,AI 是助理、你是第一责任人",
5
5
  "icon": "icon.svg",
6
6
  "keywords": [
@@ -1140,11 +1140,17 @@ G.GitPanel = function GitPanel(props) {
1140
1140
  }
1141
1141
 
1142
1142
  const commitRef = useRef(null)
1143
+ const messageRef = useRef(null)
1143
1144
  const commit = () => {
1144
1145
  if (root === null || pending) return
1145
1146
  const text = typeof message === 'string' ? message.trim() : ''
1146
1147
  if (text === '') {
1147
1148
  setError(t('git.commitNeedsMessage'))
1149
+ try {
1150
+ messageRef.current?.focus()
1151
+ } catch {
1152
+ /* ignore */
1153
+ }
1148
1154
  return
1149
1155
  }
1150
1156
  if (changes.length === 0) {
@@ -1328,6 +1334,7 @@ G.GitPanel = function GitPanel(props) {
1328
1334
  ? h(
1329
1335
  'textarea',
1330
1336
  {
1337
+ ref: messageRef,
1331
1338
  className: 'gufa-textarea',
1332
1339
  placeholder: t('git.commitPlaceholder'),
1333
1340
  value: message,
@@ -1350,7 +1357,7 @@ G.GitPanel = function GitPanel(props) {
1350
1357
  'div',
1351
1358
  { className: 'gufa-row', style: { justifyContent: 'flex-end', alignItems: 'center', gap: 8 } },
1352
1359
  staged.length > 0 ? h('span', { className: 'gufa-hint' }, `${t('git.staged')} (${staged.length})`) : null,
1353
- h(G.Button, { disabled: pending || message.trim() === '' || changes.length === 0, primary: true, onClick: commit }, pending ? h(G.Spinner) : null, t('git.commit')),
1360
+ h(G.Button, { disabled: pending || changes.length === 0, primary: true, onClick: commit }, pending ? h(G.Spinner) : null, t('git.commit')),
1354
1361
  )
1355
1362
  : null,
1356
1363
  staged.length > 0 ? h('div', { className: 'gufa-hint' }, `${t('git.staged')} (${staged.length})`) : null,