Skip to content

feat(prism): add tweak gradiant visualisors (#655)#657

Merged
plastikfan merged 1 commit into
mainfrom
feat/tweak-gradient-visualisors
Jul 4, 2026
Merged

feat(prism): add tweak gradiant visualisors (#655)#657
plastikfan merged 1 commit into
mainfrom
feat/tweak-gradient-visualisors

Conversation

@plastikfan

@plastikfan plastikfan commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added several new terminal visualizations: waveform, sweep, bloom, and bands.
    • Introduced a visualizer registry so available renderers can be listed and registered consistently.
  • Bug Fixes

    • Rendering now safely returns an empty result when there is no color data or the display width is invalid.
  • Tests

    • Added coverage for visualizer output, naming, registry behavior, and empty-input cases.

@plastikfan plastikfan self-assigned this Jul 4, 2026
@plastikfan plastikfan added the feature New feature or request label Jul 4, 2026
@plastikfan plastikfan linked an issue Jul 4, 2026 that may be closed by this pull request
10 tasks
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b3caabb-8ea1-4418-bb1a-8950527b3e0c

📥 Commits

Reviewing files that changed from the base of the PR and between e7f2dff and 13eed9f.

📒 Files selected for processing (12)
  • src/prism/workshop/bands.go
  • src/prism/workshop/bands_test.go
  • src/prism/workshop/bloom.go
  • src/prism/workshop/bloom_test.go
  • src/prism/workshop/helpers_test.go
  • src/prism/workshop/sweep.go
  • src/prism/workshop/sweep_test.go
  • src/prism/workshop/visualiser.go
  • src/prism/workshop/visualiser_test.go
  • src/prism/workshop/waveform.go
  • src/prism/workshop/waveform_test.go
  • src/prism/workshop/workshop-suite_test.go

📝 Walkthrough

Walkthrough

Adds a new workshop package implementing a GradientVisualiser interface with a package-level registry (Register, Visualisers, Reset, RegisterVisualisers). Four concrete visualisers—Waveform, Sweep, Bloom, Bands—render gradient-colored terminal output using curve/easing transforms, each with accompanying Ginkgo/Gomega tests and shared test helpers.

Changes

Prism Workshop Visualisers

Layer / File(s) Summary
Visualiser interface and registry
src/prism/workshop/visualiser.go, visualiser_test.go
Defines GradientVisualiser interface (Render, Name), a package-level registry with Register, Visualisers, Reset, and RegisterVisualisers that registers the four concrete visualisers; tested with a spy renderer and registry lifecycle assertions.
Waveform visualiser
waveform.go, waveform_test.go
WaveformVisualiser renders a sine-wave height row and a gradient sweep bar row, using stepForPosition, animationSpeed, and writeColouredChar; validated via table-driven tests.
Sweep visualiser
sweep.go, sweep_test.go
SweepVisualiser renders a scrolling block bar cycling colors via (col + animFrame) % len(steps); validated via table-driven tests.
Bloom visualiser
bloom.go, bloom_test.go
BloomVisualiser renders a pulsing diamond of rings using maxRings, ringAt, charForRing, and pulseFactor; validated via table-driven tests.
Bands visualiser
bands.go, bands_test.go
BandsVisualiser renders a braille curve row and a gradient bar row using brailleForHeight, easedCurve, applyCurve, applyEasing; validated via table-driven tests.
Shared test helpers and suite entrypoint
helpers_test.go, workshop-suite_test.go
Adds makeSteps, stepsEntry, containsAny helpers and TestWorkshop Ginkgo suite entrypoint used across visualiser tests.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Bootstrap
  participant Registry
  participant Visualiser
  participant Renderer

  Bootstrap->>Registry: RegisterVisualisers()
  Registry->>Visualiser: Register(instances)
  Bootstrap->>Registry: Visualisers()
  Registry-->>Bootstrap: []GradientVisualiser
  loop for each visualiser
    Bootstrap->>Visualiser: Render(steps, curve, easing, animFrame)
    Visualiser->>Renderer: applyCurve/applyEasing/pulseFactor transforms
    Renderer-->>Visualiser: styled colored string
    Visualiser-->>Bootstrap: rendered output
  end
Loading

Possibly related issues

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tweak-gradient-visualisors

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.

@plastikfan
plastikfan merged commit 1a36879 into main Jul 4, 2026
4 of 5 checks passed
@plastikfan
plastikfan deleted the feat/tweak-gradient-visualisors branch July 4, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create tweak GradientVisualiser

1 participant