Add matrix rain mode, panel width fix, and matrix-only subliminal snippets#9
Conversation
Introduce ui.rain_animation_mode "matrix" with falling half-width glyphs and a green gradient, matching the existing column/drift pattern. Settings TUI lists the new option. Normalize each inner panel line with lipgloss Width so rows with wide emoji cannot exceed the inner cell count and skew rounded borders. Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 32 minutes and 4 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR adds a new "matrix" rain animation mode to the UI system. Changes include adding a new configuration constant, updating config documentation, implementing matrix-specific character and subliminal phrase rendering utilities, modifying the rain background renderer to support the new mode, improving panel layout width handling for wide characters, and adding comprehensive tests. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Add ASCII-only marquee phrases (confidence, anti-hero tone, silly dev jokes) shown only in matrix animation: sparse wave glyphs, a rare center-column letter crawl, occasional drop swaps, and a faint mid-field marquee row. Tests assert marquee output stays one terminal cell wide. Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
internal/ui/rain_bg.go (1)
45-52: Update theModefield comment to include Matrix mode.Line 51 still documents only
"basic"and"advanced", but this PR now supports"matrix"too.📝 Proposed comment update
- Mode string // "basic" or "advanced" + Mode string // "basic", "advanced", or "matrix"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/ui/rain_bg.go` around lines 45 - 52, Update the comment for the RainBackground.Mode field to reflect the new "matrix" option: change the existing comment that lists only "basic" and "advanced" so it documents the available modes as "basic", "advanced", and "matrix" (referencing the RainBackground struct and its Mode field) to keep the struct documentation accurate.internal/ui/panel_layout_test.go (1)
65-74: Also assert that normalization preserves the logical line count.The width assertion is good; adding a line-count check would protect the height invariant used by panel capacity measurement callers.
🧪 Proposed test hardening
func TestNormalizePanelInnerLinesWideEmojiRow(t *testing.T) { cells := panelInnerLipglossWidth(40) inner := "ok\n🌧️ GIT RAIN — SETTINGS\nok" norm := normalizePanelInnerLines(inner, cells) - for i, line := range strings.Split(norm, "\n") { + inputLines := strings.Split(inner, "\n") + normLines := strings.Split(norm, "\n") + if len(normLines) != len(inputLines) { + t.Fatalf("normalized line count = %d, want %d\n%q", len(normLines), len(inputLines), norm) + } + for i, line := range normLines { if got := lipgloss.Width(line); got != cells { t.Fatalf("line %d: width %d, want %d\n%q", i, got, cells, line) } } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/ui/panel_layout_test.go` around lines 65 - 74, The test TestNormalizePanelInnerLinesWideEmojiRow currently only asserts each normalized line's lipgloss.Width but doesn't verify the logical line count is preserved; update the test to capture the original line count (e.g., len(strings.Split(inner, "\n"))) and assert that len(strings.Split(norm, "\n")) equals that original count after calling normalizePanelInnerLines (use the existing variables inner and norm and functions panelInnerLipglossWidth/normalizePanelInnerLines), failing the test with a clear message if counts differ.
🤖 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/ui/panel_layout_test.go`:
- Around line 65-74: The test TestNormalizePanelInnerLinesWideEmojiRow currently
only asserts each normalized line's lipgloss.Width but doesn't verify the
logical line count is preserved; update the test to capture the original line
count (e.g., len(strings.Split(inner, "\n"))) and assert that
len(strings.Split(norm, "\n")) equals that original count after calling
normalizePanelInnerLines (use the existing variables inner and norm and
functions panelInnerLipglossWidth/normalizePanelInnerLines), failing the test
with a clear message if counts differ.
In `@internal/ui/rain_bg.go`:
- Around line 45-52: Update the comment for the RainBackground.Mode field to
reflect the new "matrix" option: change the existing comment that lists only
"basic" and "advanced" so it documents the available modes as "basic",
"advanced", and "matrix" (referencing the RainBackground struct and its Mode
field) to keep the struct documentation accurate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6f481a22-48ea-4cf1-b5a7-71c910089efd
📒 Files selected for processing (8)
internal/config/defaults.gointernal/config/types.gointernal/ui/config_view.gointernal/ui/matrix_subliminal.gointernal/ui/panel_layout.gointernal/ui/panel_layout_test.gointernal/ui/rain_bg.gointernal/ui/rain_bg_test.go
|
bugbot review |
Add rain_animation_mode garden (advanced-style field) with optional garden_bloom_preset and garden_moisture_cap in config. Show garden settings in the TUI only when mode is garden, directly under rain mode. Wire RainBackground from config, apply bloom thresholds and moisture cap (with cap clamped so full bloom is reachable). Boost fast preset with extra moisture per hit and tighter thresholds. Fix rain simulation only advancing when rainVisible (short terminals froze growth): advance whenever showRain and rainBg are set. Improve flower readability: per-stage colors, garden glyphs, soil tiles for empty columns, safe color gradient denominator. Tests cover moisture accumulation, tight cap full bloom, and fast preset.
This reverts commit cbbf296.
Summary
matrix, selectable in Settings alongsidebasicandadvanced. It reuses the same column layout, speeds, and drift as the existing rain; drops are random half-width glyphs (katakana/digits/symbols) with a green dark-to-bright gradient and a matching matrix-style wave strip.renderMainPanelBoxnow applies lipglossWidthper logical line instead of to the whole block, so each row is exactly the intended cell count before the border is drawn.Config
Set
rain_animation_mode = "matrix"under[ui]in~/.config/git-rain/config.toml, or cycle the option in the TUI Settings screen.Testing
make test-racemake lintSummary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation
Tests