Skip to content

feat(prism): implement tweak gradient model extension (#653)#654

Merged
plastikfan merged 1 commit into
mainfrom
feat/tweak-gradient-model-extension
Jul 2, 2026
Merged

feat(prism): implement tweak gradient model extension (#653)#654
plastikfan merged 1 commit into
mainfrom
feat/tweak-gradient-model-extension

Conversation

@plastikfan

@plastikfan plastikfan commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added configurable gradient curve and easing options for banners, views, and animated effects.
    • Added support for new navigation and view modes with consistent text handling across the app.
  • Bug Fixes

    • Improved gradient rendering so styling and interpolation stay consistent in banner, highway, linear, and periscope displays.
    • Enhanced fallback handling for unexpected configuration values and out-of-range enum values.

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

coderabbitai Bot commented Jul 2, 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: df6542a1-b96d-4637-bb31-b46d83e5ce89

📥 Commits

Reviewing files that changed from the base of the PR and between f6b5474 and 2ea0870.

📒 Files selected for processing (32)
  • src/agenor/enums/curve-kind-en-auto.go
  • src/agenor/enums/curve-kind-en.go
  • src/agenor/enums/easing-kind-en-auto.go
  • src/agenor/enums/easing-kind-en.go
  • src/agenor/enums/navigation-kind-en-auto.go
  • src/agenor/enums/navigation-kind-en.go
  • src/agenor/enums/view-kind-en-auto.go
  • src/agenor/enums/view-kind-en.go
  • src/app/bedrock/types.go
  • src/app/ui/highway.go
  • src/app/ui/linear.go
  • src/app/ui/linear_test.go
  • src/app/ui/porthole.go
  • src/app/ui/registry.go
  • src/prism/contract/easing-internal_test.go
  • src/prism/contract/gradients.go
  • src/prism/contract/navigation.go
  • src/prism/contract/overture.go
  • src/prism/contract/palette.go
  • src/prism/contract/summary.go
  • src/prism/contract/theme.go
  • src/prism/contract/view.go
  • src/prism/effects/gradient-state.go
  • src/prism/effects/gradient-state_test.go
  • src/prism/views/highway/banner_test.go
  • src/prism/views/linear/linear-renderer.go
  • src/prism/views/linear/linear-renderer_test.go
  • src/prism/views/porthole/model.go
  • src/prism/widgets/activity/activity.go
  • src/prism/widgets/banner/banner.go
  • src/prism/widgets/banner/model_test.go
  • src/prism/widgets/periscope/periscope.go

📝 Walkthrough

Walkthrough

This PR adds CurveKind and EasingKind enums for gradient shaping, migrates NavigationKind/ViewKind from the contract package into a shared enums package, extends gradient interpolation functions to accept curve/easing parameters, adds banner-level curve/easing overrides, and updates all gradient rendering call sites accordingly.

Changes

NavigationKind/ViewKind Enum Migration

Layer / File(s) Summary
NavigationKind and ViewKind enum definitions
src/agenor/enums/navigation-kind-en*.go, src/agenor/enums/view-kind-en*.go
New enums package files add NavigationKind and ViewKind types with String() (generated) and UnmarshalText implementations.
Contract field type migration
src/prism/contract/overture.go, src/prism/contract/summary.go
Overture.Kind and Summary.Kind now use enums.NavigationKind instead of the removed local type.
Linear presenter/renderer navigation wiring
src/app/ui/linear.go, src/app/ui/linear_test.go, src/prism/views/linear/linear-renderer.go, src/prism/views/linear/linear-renderer_test.go
Linear presenter, renderer resume-detection logic, and tests switch from contract navigation constants to enums.NavigationKindPrime/NavigationKindResume.

Curve/Easing Gradient Shaping

Layer / File(s) Summary
CurveKind and EasingKind enum definitions
src/agenor/enums/curve-kind-en*.go, src/agenor/enums/easing-kind-en*.go
New enums define curve shapes (linear, sine, quadratic, cubic) and easing modes (uniform, ease-in/out/in-out) with String() and UnmarshalText.
Gradient interpolation contract and theme caching
src/prism/contract/gradients.go, src/prism/contract/palette.go, src/prism/contract/theme.go, src/prism/contract/easing-internal_test.go
InterpolateBetween/InterpolateBetweenRGBA accept curve/easing, return []Color, and use new easedT/applyCurve/applyEasing helpers; GradientDef/ResolvedGradient gain Curve/Easing; Theme.GradientCaches updates to []Color.
Gradient effects rendering path
src/prism/effects/gradient-state.go, src/prism/effects/gradient-state_test.go
ApplyGradient/ApplyGradientStatic accept contract.ResolvedGradient; styled rendering switches to lipgloss; local InterpolateBetweenRGBA removed.
Banner curve/easing override configuration
src/app/bedrock/types.go, src/app/ui/registry.go
BannerSubConfig/BannerConfig gain Curve/Easing/Animate override fields, wired via resolveBannerConfig.
Banner buildBannerInfo curve/easing resolution
src/app/ui/highway.go, src/app/ui/linear.go, src/app/ui/porthole.go
buildBannerInfo derives curve/easing from theme gradients with per-banner override support, populating ResolvedGradient.Curve/Easing.
Widget and view gradient call-site updates
src/prism/views/highway/banner_test.go, src/prism/views/porthole/model.go, src/prism/widgets/banner/*, src/prism/widgets/activity/activity.go, src/prism/widgets/periscope/periscope.go
Call sites switch to contract.InterpolateBetweenRGBA with curve/easing, or pass the full ResolvedGradient to ApplyGradient/ApplyGradientStatic.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BuildBannerInfo
  participant BannerConfig
  participant Theme
  participant ContractGradients
  participant EffectsApplyGradient

  BuildBannerInfo->>Theme: read gradient definition (Hi, Lo, Curve, Easing)
  BuildBannerInfo->>BannerConfig: check CurveOverride, EasingOverride
  BuildBannerInfo->>BuildBannerInfo: build ResolvedGradient{Steps, Hi, Lo, Curve, Easing}
  BuildBannerInfo->>ContractGradients: InterpolateBetweenRGBA(hi, lo, steps, curve, easing)
  ContractGradients-->>BuildBannerInfo: []Color steps
  BuildBannerInfo->>EffectsApplyGradient: ApplyGradient(ResolvedGradient, content, state)
  EffectsApplyGradient-->>BuildBannerInfo: []RunWithColor
Loading

Possibly related issues

Possibly related PRs

  • snivilised/jaywalk#560: Both modify the InterpolateBetween/InterpolateBetweenRGBA API in prism/contract, this PR extending it with curve/easing parameters.
  • snivilised/jaywalk#581: Both touch src/prism/effects/gradient-state.go, with this PR changing ApplyGradient* to accept contract.ResolvedGradient and apply Curve/Easing.
  • snivilised/jaywalk#588: Both modify src/prism/contract/gradients.go and downstream widget/effects usage, with this PR adding curve/easing awareness.

Suggested labels: refactor

✨ 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-model-extension

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 e783d28 into main Jul 2, 2026
4 of 5 checks passed
@plastikfan
plastikfan deleted the feat/tweak-gradient-model-extension branch July 2, 2026 15:41
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.

tweak gradient model extension

1 participant