Skip to content

feat: CRT phosphor shader engine and retro themes#281

Merged
chernistry merged 4 commits into
mainfrom
agent/crt-shader-engine
Apr 6, 2026
Merged

feat: CRT phosphor shader engine and retro themes#281
chernistry merged 4 commits into
mainfrom
agent/crt-shader-engine

Conversation

@chernistry

Copy link
Copy Markdown
Collaborator

Summary

  • Adds CRTShader class in src/bernstein/tui/crt_shader.py that transforms Rich Text to simulate a 1987 CRT monitor with scanline dimming, phosphor bloom, chromatic aberration, and monochrome palette mapping (amber/green/cool white)
  • Adds three retro CRT themes (RETRO_AMBER, RETRO_GREEN, RETRO_COOL) to the theme system in themes.py and integrates them into the theme cycle
  • Includes 23 unit tests covering all shader effects, mode cycling, edge cases, and precomputed LUT correctness

Test plan

  • All 23 new CRT shader tests pass (uv run pytest tests/unit/test_crt_shader.py -x -q)
  • All existing theme tests pass with updated cycle order (uv run pytest tests/unit/test_tui_themes.py -x -q)
  • Ruff lint clean
  • Pyright strict mode clean
  • Visual verification deferred to post-integration (library module, no UI hookup yet)

🤖 Generated with Claude Code

chernistry and others added 3 commits April 7, 2026 00:21
Implements CRTShader class that transforms Rich Text output to simulate
a 1987 CRT monitor with scanline dimming, phosphor bloom, chromatic
aberration at screen edges, and monochrome palette mapping (amber, green,
cool white). Adds three retro CRT themes to the theme system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unused noqa directives and simplify if-else to ternary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use get_style_at_offset() public API instead of accessing private _spans.
Add Console import for style resolution. Suppress reportUnusedFunction
for _to_monochrome which is part of the public helper API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

AI Review (GitHub Models)

Summary

The pull request introduces a CRT phosphor shader engine and retro themes for the Bernstein CLI orchestrator. This addition enhances user experience by providing visual customization options, appealing to users interested in retro aesthetics.

Risk Assessment

Medium - While the changes focus on non-core functionality (visual themes), inefficient implementations or security vulnerabilities within the shader engine could impact performance or user security.

Actionable Recommendations

  • Code Review: Conduct a thorough review of the shader implementation for performance issues, especially on lower-spec machines.
  • Security Audit: Verify that the shader code does not unintentionally expose vulnerabilities, particularly with input handling.
  • Documentation Update: Ensure that documentation includes information about the new features and how to utilize them effectively.
  • Testing: Add unit and integration tests covering the new functionality to ensure stability.
  • Deprecation Planning: Consider the impact on existing themes and document any deprecations or breaking changes introduced.

@github-actions github-actions Bot added the size/l label Apr 6, 2026
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

CI Summary

Check Result
Repo hygiene ✅ success
Lint ✅ success
Type check ✅ success
Tests ❌ failure
Spelling ✅ success
Dead code ✅ success
Workflow lint ✅ success
Dist size ✅ success
SonarCloud ⏭️ skipped

Coverage and detailed reports are available via Codecov and the Checks tab.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Apr 6, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@chernistry chernistry merged commit 5ae4697 into main Apr 6, 2026
9 of 10 checks passed
chernistry added a commit that referenced this pull request Apr 6, 2026
Removes CRT shader, plasma canvas, tracker view, oscilloscope,
BBS boot sequence, retro themes, and their integration into
app.py and dashboard.py.

Reverts PRs #277, #278, #279, #281, #284, #290, #291.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chernistry chernistry deleted the agent/crt-shader-engine branch April 8, 2026 09:47
chernistry added a commit that referenced this pull request Apr 30, 2026
* feat: add CRT phosphor shader engine and retro themes

Implements CRTShader class that transforms Rich Text output to simulate
a 1987 CRT monitor with scanline dimming, phosphor bloom, chromatic
aberration at screen edges, and monochrome palette mapping (amber, green,
cool white). Adds three retro CRT themes to the theme system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix ruff lint warnings in crt_shader.py

Remove unused noqa directives and simplify if-else to ternary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve pyright strict-mode errors in crt_shader.py

Use get_style_at_offset() public API instead of accessing private _spans.
Add Console import for style resolution. Suppress reportUnusedFunction
for _to_monochrome which is part of the public helper API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: ruff format crt_shader.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chernistry added a commit that referenced this pull request Apr 30, 2026
Removes CRT shader, plasma canvas, tracker view, oscilloscope,
BBS boot sequence, retro themes, and their integration into
app.py and dashboard.py.

Reverts PRs #277, #278, #279, #281, #284, #290, #291.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant