Skip to content

Add matrix rain mode, panel width fix, and matrix-only subliminal snippets#9

Merged
bschellenberger2600 merged 4 commits into
mainfrom
cursor/matrix-rain-mode-f41d
Apr 19, 2026
Merged

Add matrix rain mode, panel width fix, and matrix-only subliminal snippets#9
bschellenberger2600 merged 4 commits into
mainfrom
cursor/matrix-rain-mode-f41d

Conversation

@bschellenberger2600
Copy link
Copy Markdown
Member

@bschellenberger2600 bschellenberger2600 commented Apr 17, 2026

Summary

  • Adds a third TUI rain animation mode, matrix, selectable in Settings alongside basic and advanced. 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.
  • Fixes rounded-border stretching when a row is wider than the inner panel width (common with emoji in the title): renderMainPanelBox now applies lipgloss Width per logical line instead of to the whole block, so each row is exactly the intended cell count before the border is drawn.
  • Matrix-only: faint ASCII “subliminal” fragments from short marquee phrases (confidence / anti-hero-ish / silly dev jokes) appear in the wave strip, a rare center-column letter crawl, occasional falling glyphs, and a faint mid-field horizontal crawl — all single-cell safe so layout stays stable.

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-race
  • make lint
Open in Web Open in Cursor 

Summary by CodeRabbit

Release Notes

  • New Features

    • Added new "Matrix" rain animation mode with falling code characters, subliminal marquee text effects, and dynamic background waves.
  • Bug Fixes

    • Fixed panel layout rendering inconsistencies when handling emoji and wide glyphs.
  • Documentation

    • Updated configuration documentation to reflect the new "Matrix" animation mode option.
  • Tests

    • Added tests validating rain animation rendering and panel layout normalization with wide character support.

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Warning

Rate limit exceeded

@bschellenberger2600 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 4 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d67bfc6-fe0d-49da-b8a3-3f11fc45ddca

📥 Commits

Reviewing files that changed from the base of the PR and between e68d8cb and cbbf296.

📒 Files selected for processing (7)
  • internal/config/defaults.go
  • internal/config/loader.go
  • internal/config/types.go
  • internal/ui/config_view.go
  • internal/ui/rain_bg.go
  • internal/ui/rain_bg_test.go
  • internal/ui/repo_selector.go
📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Configuration Updates
internal/config/defaults.go, internal/config/types.go, internal/ui/config_view.go
Added UIRainAnimationMatrix constant and updated configuration documentation to include the new "matrix" animation mode option (falling code characters). Updated config view to display the new enum option in the rain animation mode selector.
Matrix Animation Implementation
internal/ui/matrix_subliminal.go, internal/ui/rain_bg.go
Introduced new matrix-specific subliminal phrase utilities including character stream building, marquee rendering with offset phases, and probabilistic character substitution. Updated rain background renderer to use matrix glyphs, apply matrix color palettes, render subliminal background content, and use mode-specific wave rendering when matrix mode is active.
Rendering and Layout Fixes
internal/ui/panel_layout.go
Added normalizePanelInnerLines() helper to normalize per-line width using lipgloss columns instead of block-wide width, improving rendering consistency for wide characters (e.g., emoji).
Testing
internal/ui/panel_layout_test.go, internal/ui/rain_bg_test.go
Added test coverage for panel line normalization with emoji and comprehensive validation of rain background rendering width invariants, glyph selection, and subliminal character functions across different animation modes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A matrix dream we weave today,
With falling glyphs that twist and sway,
Subliminal phrases dance on screen,
The widest emoji now fits clean—
Green code, wide hearts, all in a line! 💚✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the three main changes: adding matrix rain mode, fixing panel width, and introducing matrix-only subliminal snippets, all of which are present in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/matrix-rain-mode-f41d

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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>
@cursor cursor Bot changed the title Add matrix rain mode and per-line panel width normalization Add matrix rain mode, panel width fix, and matrix-only subliminal snippets Apr 18, 2026
@bschellenberger2600 bschellenberger2600 marked this pull request as ready for review April 18, 2026 06:15
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
internal/ui/rain_bg.go (1)

45-52: Update the Mode field 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

📥 Commits

Reviewing files that changed from the base of the PR and between 265e6e7 and e68d8cb.

📒 Files selected for processing (8)
  • internal/config/defaults.go
  • internal/config/types.go
  • internal/ui/config_view.go
  • internal/ui/matrix_subliminal.go
  • internal/ui/panel_layout.go
  • internal/ui/panel_layout_test.go
  • internal/ui/rain_bg.go
  • internal/ui/rain_bg_test.go

@bschellenberger2600
Copy link
Copy Markdown
Member Author

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.
@bschellenberger2600 bschellenberger2600 merged commit a5bac1b into main Apr 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants