Conversation
📝 WalkthroughWalkthroughAdds a colored success marker (checkmark glyph) to output rendering: new styling utilities in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can enable review details to help with troubleshooting, context usage and more.Enable the |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
internal/output/plain_format.go (1)
45-47: Consider keepingFormatEventLineANSI-free for plain output.Using
SuccessMarkerText()here (and applying color in TTY/UI renderers) avoids escape-sequence noise in redirected logs and script-consumed output.♻️ Possible adjustment
- return fmt.Sprintf("%s LocalStack ready (%s)", SuccessMarker(), e.Detail), true + return fmt.Sprintf("%s LocalStack ready (%s)", SuccessMarkerText(), e.Detail), true ... - return SuccessMarker() + " LocalStack ready", true + return SuccessMarkerText() + " LocalStack ready", true ... - return SuccessMarker() + " " + e.Text + return SuccessMarkerText() + " " + e.TextAlso applies to: 115-115
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/output/plain_format.go` around lines 45 - 47, FormatEventLine is emitting ANSI-colored markers via SuccessMarker(), which pollutes non-TTY/plain outputs; change those calls to SuccessMarkerText() so the function returns ANSI-free marker text (replace SuccessMarker() with SuccessMarkerText() in FormatEventLine and the other occurrence around the second branch), and ensure any TTY/UI renderers apply coloring themselves rather than relying on FormatEventLine to produce colored output.internal/output/plain_sink_test.go (1)
62-62: Consider avoiding raw ANSI literals in expected values.Building these expectations from
SuccessMarker()will reduce drift risk if marker styling changes.♻️ Suggested assertion cleanup
- expected: "\x1b[38;2;183;201;92m✔︎\x1b[0m LocalStack ready (abc123)\n", + expected: SuccessMarker() + " LocalStack ready (abc123)\n", ... - expected: "\x1b[38;2;183;201;92m✔︎\x1b[0m LocalStack ready\n", + expected: SuccessMarker() + " LocalStack ready\n",Also applies to: 67-67
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/output/plain_sink_test.go` at line 62, The test uses hard-coded ANSI escape sequences for the success marker; replace the raw literal (e.g. "\x1b[38;2;183;201;92m✔︎\x1b[0m") with a call to SuccessMarker() when building the expected string (for example: fmt.Sprintf("%s LocalStack ready (abc123)\n", SuccessMarker())) so the test follows marker styling changes; update the other occurrence on the same test (line ~67) similarly.internal/ui/app_test.go (1)
177-177: Prefer shared marker helper in assertion.Using
output.SuccessMarkerText()here avoids brittle literal coupling if the glyph changes later.♻️ Suggested test tweak
- if !strings.Contains(app.lines[0].text, "✔︎") || !strings.Contains(app.lines[0].text, "Done") { + if !strings.Contains(app.lines[0].text, output.SuccessMarkerText()) || !strings.Contains(app.lines[0].text, "Done") { t.Fatalf("expected rendered success message, got: %q", app.lines[0].text) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/ui/app_test.go` at line 177, Replace the hard-coded success glyph in the test assertion with the shared helper to avoid brittle coupling: instead of checking for the literal "✔︎" use output.SuccessMarkerText() in the assertion that inspects app.lines[0].text (the same check that also looks for "Done"); update the condition to assert that app.lines[0].text contains output.SuccessMarkerText() and "Done".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/output/plain_format.go`:
- Around line 45-47: FormatEventLine is emitting ANSI-colored markers via
SuccessMarker(), which pollutes non-TTY/plain outputs; change those calls to
SuccessMarkerText() so the function returns ANSI-free marker text (replace
SuccessMarker() with SuccessMarkerText() in FormatEventLine and the other
occurrence around the second branch), and ensure any TTY/UI renderers apply
coloring themselves rather than relying on FormatEventLine to produce colored
output.
In `@internal/output/plain_sink_test.go`:
- Line 62: The test uses hard-coded ANSI escape sequences for the success
marker; replace the raw literal (e.g. "\x1b[38;2;183;201;92m✔︎\x1b[0m") with a
call to SuccessMarker() when building the expected string (for example:
fmt.Sprintf("%s LocalStack ready (abc123)\n", SuccessMarker())) so the test
follows marker styling changes; update the other occurrence on the same test
(line ~67) similarly.
In `@internal/ui/app_test.go`:
- Line 177: Replace the hard-coded success glyph in the test assertion with the
shared helper to avoid brittle coupling: instead of checking for the literal
"✔︎" use output.SuccessMarkerText() in the assertion that inspects
app.lines[0].text (the same check that also looks for "Done"); update the
condition to assert that app.lines[0].text contains output.SuccessMarkerText()
and "Done".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 2219f247-e368-4826-bf7b-d9b2288e81ce
📒 Files selected for processing (7)
internal/output/plain_format.gointernal/output/plain_format_test.gointernal/output/plain_sink_test.gointernal/output/style.gointernal/ui/app_test.gointernal/ui/components/message.gointernal/ui/styles/styles.go
fc18360 to
11eab6b
Compare
This will changes success messages rendering from text to a shared checkmark marker. ✔️
This makes success output more compact and visually consistent across renderers. 💄