Skip to content

Commit ac42ce2

Browse files
fix: 解决 node 下 loading 按钮计算错误问题
1 parent c659912 commit ac42ce2

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: bun test --coverage --coverage-reporter=lcov
2828

2929
- name: Upload coverage to Codecov
30-
uses: codecov/codecov-action@v3
30+
uses: codecov/codecov-action@v5
3131
with:
3232
file: ./coverage/lcov.info
3333
token: ${{ secrets.CODECOV_TOKEN }}

packages/remote-control-server/web/render.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ function renderSystemMessage(text) {
597597
const LOADING_ID = "loading-indicator";
598598

599599
// TUI star spinner frames (same as Claude Code CLI)
600-
const SPINNER_FRAMES = ["·", "✢", "", "✶", "✻", "✽"];
600+
const SPINNER_FRAMES = ["·", "✢", "", "✶", "✻", "✽"];
601601
const SPINNER_CYCLE = [...SPINNER_FRAMES, ...SPINNER_FRAMES.slice().reverse()];
602602

603603
// 204 verbs from TUI src/constants/spinnerVerbs.ts

src/components/Spinner/utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import type { RGBColor as RGBColorType } from './types.js'
33

44
export function getDefaultCharacters(): string[] {
55
if (process.env.TERM === 'xterm-ghostty') {
6-
return ['·', '✢', '', '✶', '✻', '*'] // Use * instead of ✽ for Ghostty because the latter renders in a way that's slightly offset
6+
return ['·', '✢', '', '✶', '✻', '*'] // ✱ replaces ✳ (emoji, renders offset in Ghostty); * replaces ✽ (same)
77
}
8+
// ✳ (U+2733) is matched by emoji-regex in Node.js → stringWidth returns 2 instead of 1,
9+
// causing layout jitter when the spinner cycles frames. ✱ (U+2731) is visually similar but not emoji.
810
return process.platform === 'darwin'
9-
? ['·', '✢', '', '✶', '✻', '✽']
10-
: ['·', '✢', '*', '✶', '✻', '✽']
11+
? ['·', '✢', '', '✶', '✻', '✽']
12+
: ['·', '✢', '', '✶', '✻', '✽']
1113
}
1214

1315
// Interpolate between two RGB colors

0 commit comments

Comments
 (0)