@mzzsfy/dsh-shell-select 0.3.0 → 0.3.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mzzsfy/dsh-shell-select",
3
3
  "description": "Windows shell 接管:替换默认 pwsh 工具为可配置多客户端的 shell 工具(git bash/WSL/cmd/pwsh,自定义路径,默认客户端,模型按名选择)",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "type": "module",
6
6
  "main": "src/executor.mjs",
7
7
  "exports": {
package/src/client.js CHANGED
@@ -659,7 +659,7 @@ window.__ModuleLoader__.load({
659
659
  function statusTextOf(status, en) {
660
660
  switch (status) {
661
661
  case 'running': return en ? 'Running' : '运行中'
662
- case 'background': return en ? 'Background' : '后台运行'
662
+ case 'background': return en ? 'Background' : '后台'
663
663
  case 'failed': case 'signaled': return en ? 'Failed' : '失败'
664
664
  default: return null
665
665
  }
@@ -668,9 +668,10 @@ window.__ModuleLoader__.load({
668
668
  function headMetaOf(model, en) {
669
669
  switch (model.status) {
670
670
  case 'running': return { dot: 'ongoing', label: en ? 'Running' : '运行中', pill: undefined }
671
+ // ack 块静态不反映 job 生命周期,状态点用中性工具图标,文案不带"运行中"
671
672
  case 'background': return {
672
- dot: 'ongoing',
673
- label: en ? 'Background' : '后台运行',
673
+ dot: 'none',
674
+ label: en ? 'Background' : '后台',
674
675
  pill: model.jobId !== undefined ? (en ? `bg ${model.jobId}` : `后台 ${model.jobId}`) : undefined,
675
676
  pillTone: 'bg',
676
677
  }
@@ -782,9 +783,7 @@ window.__ModuleLoader__.load({
782
783
  function ShellToolRow(props) {
783
784
  const { block, cwd, inspect } = props
784
785
  const en = detectEnglish()
785
- const model = shellCardModel(block, cwd)
786
- // 后台 ack 卡默认展开:内容即命令全文,收起只剩一行摘要失去可读性
787
- const [open, setOpen] = useState(model.kind === 'background')
786
+ const [open, setOpen] = useState(false)
788
787
  const [, setCatalogReady] = useState(false)
789
788
  useEffect(() => {
790
789
  let disposed = false
@@ -819,6 +818,9 @@ window.__ModuleLoader__.load({
819
818
  h('span', { className: 'sls-tv__title' }, 'Shell'),
820
819
  h('span', { className: 'sls-tv__sep', 'aria-hidden': true }),
821
820
  h('span', { className: 'sls-tv__sum' + (failed ? ' sls-tv__sum--err' : '') }, summary),
821
+ model.status === 'background' && model.jobId !== undefined
822
+ ? h('span', { className: 'sls-tv__badge', title: en ? 'Background job' : '后台任务' }, en ? `bg ${model.jobId}` : `后台 ${model.jobId}`)
823
+ : null,
822
824
  ),
823
825
  open ? h(ShellCard, { model, inspect, en }) : null,
824
826
  )
@@ -130,9 +130,18 @@ test('S17b 后台 ack 异常文本:仍 background,jobId 缺省不冒充', () =>
130
130
  assert.equal(model.jobId, undefined)
131
131
  })
132
132
 
133
- test('S17c 后台卡渲染面:状态文案与中性任务号徽标(渲染守卫)', () => {
133
+ test('S17c 后台行默认收起,收起行携带任务号徽标(渲染守卫)', () => {
134
+ // BDD:Given 后台 ack 卡,When 行渲染,Then 默认收起与其余行一致,收起态可见 job id 徽标
134
135
  assert.match(source, /case 'background':/)
135
136
  assert.match(source, /sls-tv__pill--bg/)
137
+ assert.doesNotMatch(source, /useState\(model\.kind === 'background'\)/)
138
+ assert.match(source, /model\.status === 'background' && model\.jobId !== undefined/)
139
+ })
140
+
141
+ test('S17d 后台状态中性:不断言运行中,点为中性图标(渲染守卫)', () => {
142
+ // BDD:Given ack 块静态且不反映 job 生命周期,When 渲染后台状态,Then 文案与点均不断言 ongoing
143
+ assert.doesNotMatch(source, /case 'background':\s*\r?\n\s*dot: 'ongoing'/)
144
+ assert.doesNotMatch(source, /case 'background': return en \? 'Background' : '后台运行'/)
136
145
  })
137
146
 
138
147
  test('S12c isError 与空结果仍走 generic(回归)', () => {