Skip to content

Commit 3303188

Browse files
committed
Make the bar move right, not left, to show progress
1 parent c98b3ea commit 3303188

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/cli-kit/src/private/node/ui/components/Tasks.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('Tasks', () => {
6565

6666
// Then
6767
expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`
68-
"▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁▁
68+
"▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁
6969
task 1 ..."
7070
`)
7171
expect(firstTaskFunction).toHaveBeenCalled()
@@ -95,7 +95,7 @@ describe('Tasks', () => {
9595

9696
// Then
9797
expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`
98-
"▂▃▄▅▆▇█▇▆▅▄▃▂▁▁
98+
"▁▁▂▃▄▅▆▇█▇▆▅▄▃▂
9999
task 1 ..."
100100
`)
101101
expect(firstTaskFunction).toHaveBeenCalled()

packages/cli-kit/src/private/node/ui/components/TextAnimation.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@ function rainbow(text: string, frame: number) {
1515
}
1616

1717
function rotated(text: string, steps: number) {
18-
const textLength = text.length
19-
return text
20-
.split('')
21-
.map((_, index) => {
22-
return text[(index + steps) % textLength]
23-
})
24-
.join('')
18+
const normalizedSteps = steps % text.length
19+
const start = text.slice(-normalizedSteps)
20+
const end = text.slice(0, -normalizedSteps)
21+
return start + end
2522
}
2623

2724
/**

0 commit comments

Comments
 (0)