usage 0.28.4
修正 2 項
Windows 系統匣不再鬧雙胞或留白,面板卡片排序全同步
現在 Windows 的面板與系統匣(system tray,常駐在螢幕右下角的圖示選單)畫面變得更順眼了。當你拖曳額度卡(quota card)改變排列順序並重載主題時,系統會先重新讀取共用的已儲存排序(shared saved order),所以不管你打開哪個支援拖曳排序的面板,上面的 Claude、Codex 與 Antigravity 卡片順序都會是一致的。另外,以前系統匣在啟動時,會過早對還沒準備好的視窗定位,硬是把一個空白的白色或深色長方形拉到畫面上;如果重複啟動兩次,第二個實例還會與第一個爭奪共用的 WebView2(讓桌面程式內嵌顯示網頁畫面的元件)用來存放使用者資料的目錄而初始化失敗,留下一塊純白長方形殘留在螢幕上。現在系統改為顯示前一刻才定位視窗,而且面板顯示後如果又切換面板,視窗定位還是會照舊重新套用一次;系統匣會持有一個具名 mutex(named mutex,用來確保同時間只有一個程式運行的鎖定機制),點第二次只會顯示「已在執行中」的在地化提示然後關閉。就像一間店面,以前店員還沒把假人模特兒穿好衣服就把鐵捲門拉開,或者兩位店長在同一個地址搶著掛招牌;現在他們會在開門前把商品陳列整齊,而且知道這地址有人營業就會客氣地離開,不再鬧雙胞。
官方原文
**Windows panel card order now follows across themes**: reloading a theme after dragging a quota card now rereads the shared saved order before state injection, so every draggable panel opens with the same Claude, Codex, and Antigravity card order.
**The tray panel no longer appears as an empty white/dark rectangle at launch**: pywebview's resize() and move() call SetWindowPos with SWP_SHOWWINDOW, and the tray placed its still-hidden window as soon as the panel document loaded — dragging the unrendered panel onto the screen on every start. The window is now placed right before it is shown; after a visible panel switch the placement is re-applied as before.
**Launching the Windows tray twice no longer leaves a blank white window**: a second instance fought the first over the shared WebView2 user-data directory, so its panel failed to initialize and lingered on screen as a bare white rectangle. The tray now holds a named mutex for its lifetime; a second launch shows an "already running" notice (localized) and exits instead.
狀態列額度同步更安全,Windows 不掉額度資料、macOS 不閃退
當你同時開好幾個 Claude Code 視窗時,你的額度資料(rate_limits)不再莫名其妙遺失,這波修復也順手解決了 macOS 使用者一開程式就閃退的災難。以前在 Windows 上,如果有兩個實例同時刷新狀態列,用來保護檔案不被同時修改的檔案鎖(file lock)是採用非阻塞式(non-blocking,搶不到鎖就直接放棄並拋出錯誤),而這個搶鎖失敗拋出的 OSError 錯誤又被系統吞掉,導致讀取並寫入 rate_limits(額度資料)的過程完全沒有同步保護,把資料給弄丟了。現在 Windows 會不斷輪詢(polling,定期重複嘗試)直到取得鎖,最多等 10 秒;若該檔案系統真的不支援鎖定,就會退回單靠原子寫入(atomic write)。實測 200 組並行(concurrent)運作,資料遺失次數從 21 次降為完美的 0 次。而這次在修復 Windows 鎖定問題時,不小心用了一個 macOS 上不存在的 errno.EDEADLOCK 常數,導致所有 macOS 使用者一載入程式就直接崩潰;現在已經補上防護,當找不到該屬性時會自動退回使用 errno.EDEADLK。就像多個記帳員同時要寫同一本帳冊,以前在 Windows 上大家不排隊硬搶,搶不到筆就漏記而弄丟了原本的紀錄,而在 macOS 上則是記帳員看到新版的排隊規定看不懂就直接罷工;現在大家不僅學會耐心排隊等筆,看不懂新規定時也懂得變通,用自己熟悉的方式繼續工作。
官方原文
**The status line no longer drops quota data when two Claude Code instances refresh at once on Windows**: the hook's file lock was blocking on POSIX (fcntl.flock(LOCK_EX)) but non-blocking on Windows (msvcrt.locking(LK_NBLCK)), and a contended lock raised OSError that was swallowed — leaving the rate_limits carry-forward read-modify-write in save() completely unsynchronized. Windows now polls the lock until it is acquired (10s deadline), matching POSIX semantics; genuinely unsupported locking still falls back to the atomic write alone. Measured over 200 concurrent hook pairs: rate_limits were lost 21 times before, 0 times after.
**The Claude Code hook no longer crashes on macOS**: a constant introduced by the Windows lock fix above referenced errno.EDEADLOCK, which doesn't exist on macOS — importing usage_statusline.py failed immediately for every macOS user. Now falls back to errno.EDEADLK when EDEADLOCK isn't defined.