Skip to content

Commit afec83c

Browse files
authored
fix: use neutral symbols for cache hit/miss indicators (#268)
Replace misleading error-like symbols with neutral ones: - Cache hit: ✓ → ◉ (filled circle) - Cache miss: ✗ → 〇 (empty circle) - Cache miss color: purple/magenta → bright_black ![image.png](https://app.graphite.com/user-attachments/assets/232940f7-bbc0-44f7-89de-6690e48ab619.png) ![image.png](https://app.graphite.com/user-attachments/assets/14822616-5486-400c-a852-2042d9bac23d.png) Fixes #264
1 parent 7b6cc79 commit afec83c

File tree

65 files changed

+90
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+90
-90
lines changed

crates/vite_task/src/session/cache/display.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub fn format_cache_status_inline(cache_status: &CacheStatus) -> Option<Str> {
145145
match cache_status {
146146
CacheStatus::Hit { .. } => {
147147
// Show "cache hit" indicator when replaying from cache
148-
Some(Str::from(" cache hit, replaying"))
148+
Some(Str::from(" cache hit, replaying"))
149149
}
150150
CacheStatus::Miss(CacheMiss::NotFound) => {
151151
// No inline message for "not found" case - just show command
@@ -176,10 +176,10 @@ pub fn format_cache_status_inline(cache_status: &CacheStatus) -> Option<Str> {
176176
FingerprintMismatch::InputConfig => "input configuration changed",
177177
FingerprintMismatch::InputChanged { kind, path } => {
178178
let desc = format_input_change_str(*kind, path.as_str());
179-
return Some(vite_str::format!(" cache miss: {desc}, executing"));
179+
return Some(vite_str::format!(" cache miss: {desc}, executing"));
180180
}
181181
};
182-
Some(vite_str::format!(" cache miss: {reason}, executing"))
182+
Some(vite_str::format!(" cache miss: {reason}, executing"))
183183
}
184184
CacheStatus::Disabled(_) => Some(Str::from("⊘ cache disabled")),
185185
}

crates/vite_task/src/session/reporter/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<T: owo_colors::OwoColorize> ColorizeExt for T {
195195
}
196196

197197
const COMMAND_STYLE: Style = Style::new().blue();
198-
const CACHE_MISS_STYLE: Style = Style::new().purple();
198+
const CACHE_MISS_STYLE: Style = Style::new().bright_black();
199199

200200
/// Format the display's cwd as a string relative to the workspace root.
201201
/// Returns an empty string if the cwd equals the workspace root.
@@ -261,7 +261,7 @@ fn format_error_message(message: &str) -> Str {
261261

262262
/// Format the "cache hit, logs replayed" message for synthetic executions without display info.
263263
fn format_cache_hit_message() -> Str {
264-
vite_str::format!("{}\n", " cache hit, logs replayed".style(Style::new().green().dimmed()))
264+
vite_str::format!("{}\n", " cache hit, logs replayed".style(Style::new().green().dimmed()))
265265
}
266266

267267
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ expression: e2e_outputs
66
$ print hello
77
hello
88
> vt run script2 # cache hit, same command as script1
9-
$ print hello cache hit, replaying
9+
$ print hello cache hit, replaying
1010
hello
1111

1212
---
1313
vt run: cache hit, <duration> saved.
1414
> json-edit package.json '_.scripts.script2 = "print world"' # change script2
1515

1616
> vt run script2 # cache miss
17-
$ print world cache miss: args changed, executing
17+
$ print world cache miss: args changed, executing
1818
world

crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $ vt lint
2222
Found 2 warnings and 0 errors.
2323
Finished in <duration> on 2 files with 93 rules using <n> threads.
2424
> cd folder2 && vt run lint # cache miss in folder2
25-
$ vt lint cache hit, replaying
25+
$ vt lint cache hit, replaying
2626

2727
! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
2828
,-[folder1/a.js:1:1]
@@ -46,7 +46,7 @@ vt run: cache hit, <duration> saved.
4646
> echo 'console.log(1);' > folder2/a.js # modify folder2
4747

4848
> cd folder1 && vt run lint # cache hit
49-
$ vt lint cache miss: 'folder2/a.js' modified, executing
49+
$ vt lint cache miss: 'folder2/a.js' modified, executing
5050

5151
! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
5252
,-[folder1/a.js:1:1]
@@ -58,7 +58,7 @@ $ vt lint ✗ cache miss: 'folder2/a.js' modified, executing
5858
Found 1 warning and 0 errors.
5959
Finished in <duration> on 2 files with 93 rules using <n> threads.
6060
> cd folder2 && vt run lint # cache miss
61-
$ vt lint cache hit, replaying
61+
$ vt lint cache hit, replaying
6262

6363
! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
6464
,-[folder1/a.js:1:1]

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ expression: e2e_outputs
66
$ print-file test.txt
77
test content
88
> vt run cached-task # cache hit
9-
$ print-file test.txt cache hit, replaying
9+
$ print-file test.txt cache hit, replaying
1010
test content
1111

1212
---

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
1414
> json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask
1515

1616
> vt run task # first: cache miss, second: cache hit
17-
$ print baz cache miss: args changed, executing
17+
$ print baz cache miss: args changed, executing
1818
baz
1919

20-
$ print bar cache hit, replaying
20+
$ print bar cache hit, replaying
2121
bar
2222

2323
---
2424
vt run: 1/2 cache hit (50%), <duration> saved. (Run `vt run --last-details` for full details)
2525
> json-edit package.json '_.scripts.task = "print bar"' # remove first subtask
2626

2727
> vt run task # cache hit
28-
$ print bar cache hit, replaying
28+
$ print bar cache hit, replaying
2929
bar
3030

3131
---

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ initial content
1212
> json-edit vite-task.json "_.tasks.test.cwd = 'subfolder'" # change cwd
1313

1414
> vt run test # cache miss: cwd changed
15-
~/subfolder$ print-file test.txt cache miss: working directory changed, executing
15+
~/subfolder$ print-file test.txt cache miss: working directory changed, executing
1616
initial content

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ expression: e2e_outputs
66
$ print-file test.txt
77
initial content
88
> cross-env MY_ENV=1 vt run test # cache miss: env added
9-
$ print-file test.txt cache miss: envs changed, executing
9+
$ print-file test.txt cache miss: envs changed, executing
1010
initial content

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ expression: e2e_outputs
66
$ print-file test.txt
77
initial content
88
> vt run test # cache miss: env removed
9-
$ print-file test.txt cache miss: envs changed, executing
9+
$ print-file test.txt cache miss: envs changed, executing
1010
initial content

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ expression: e2e_outputs
66
$ print-file test.txt
77
initial content
88
> cross-env MY_ENV=2 vt run test # cache miss: env value changed
9-
$ print-file test.txt cache miss: envs changed, executing
9+
$ print-file test.txt cache miss: envs changed, executing
1010
initial content

0 commit comments

Comments
 (0)