fix: 修正 jsc-statusbar 改名後狀態寫入被拒,額度與 ctx 全顯示破折號 #24

Merged
jiantw83 merged 1 commits from fix/statusbar-atom-owner into main 2026-10-13 14:07:24 +00:00
4 changed files with 9 additions and 9 deletions
Showing only changes of commit 369c6ab7e4 - Show all commits
@@ -1,6 +1,6 @@
{
"name": "jsc-statusbar",
"version": "0.0.2",
"version": "0.0.3",
"description": "輸入框上方的單行狀態列:模型、目錄、分支、5h/7d 額度與重置、context、CPU/記憶體/磁碟",
"license": "MIT",
"types": "./types/index.d.ts",
+1 -1
View File
@@ -103,7 +103,7 @@ describe('band', () => {
view: {},
}
for (const surface of ['terminal', 'desktop'] as const) {
const ui = await $.ui.mount({ plugin: 'statusbar', surface, component: 'AbovePrompt', props })
const ui = await $.ui.mount({ plugin: 'jsc-statusbar', surface, component: 'AbovePrompt', props })
expect(await ui.find({ type: 'Text', text: /◆ Opus 5\.5/ })).toBeDefined()
expect(await ui.find({ type: 'Text', text: /5h —/ })).toBeDefined()
await ui.unmount()
+6 -6
View File
@@ -5,12 +5,12 @@ import type { Mode, Sys, Usage } from '../types'
import { fit, cpuPercent, parseCpu, parseDf, parseGit, parseMem, parseOffset } from './format'
import type { CpuSample } from './format'
const usageAtom = atom({ plugin: 'statusbar', key: 'usage' } as const, {})
const gitAtom = atom({ plugin: 'statusbar', key: 'git' } as const, null)
const sysAtom = atom({ plugin: 'statusbar', key: 'sys' } as const, {})
const modeAtom = atom({ plugin: 'statusbar', key: 'mode' } as const, 'auto')
const alertedAtom = atom({ plugin: 'statusbar', key: 'alerted' } as const, [])
const effortAtom = atom({ plugin: 'statusbar', key: 'effort' } as const, null)
const usageAtom = atom({ plugin: 'jsc-statusbar', key: 'usage' } as const, {})
const gitAtom = atom({ plugin: 'jsc-statusbar', key: 'git' } as const, null)
const sysAtom = atom({ plugin: 'jsc-statusbar', key: 'sys' } as const, {})
const modeAtom = atom({ plugin: 'jsc-statusbar', key: 'mode' } as const, 'auto')
const alertedAtom = atom({ plugin: 'jsc-statusbar', key: 'alerted' } as const, [])
const effortAtom = atom({ plugin: 'jsc-statusbar', key: 'effort' } as const, null)
const SYS_MS = 3000
const GIT_MS = 15_000
+1 -1
View File
@@ -16,7 +16,7 @@ export type Mode = 'auto' | 'compact' | 'off'
declare module 'claude-code' {
interface PluginState {
statusbar: {
'jsc-statusbar': {
usage: Usage
git: Git | null
sys: Sys