Skip to content

Conversation

@claytonrcarter
Copy link
Collaborator

@claytonrcarter claytonrcarter commented Feb 2, 2026

I didn't review the AI generated changes in ed946a9 and f6a7008 carefully enough. In particular, the AI slapped a bandaid over the Effect/EffectStatus API change in cursive 0.4 that compiled and passed tests, but which was nevertheless incorrect because the rendered ANSI codes were all wrong. As I understand it, the API change passes all effects but each effect has a corresponding status to indicate if it should be applied or not. So the previous version of this code was just applying all effects, all the time. This change reproduces our previous behavior by resolving the effects+statuses against a base "empty" effect, which is what we want: we don't do any style compositing (that I know of) and only apply styles to unstyled text.

Top is current master, bottom is with this change.
Screenshot 2026-02-02 at 3 16 19 PM

The API change in cursive-core 0.4.0 included the addition of EffectStatus,
which was intended to allow composite or additive effects, as well as exclusive
effects. The recent update to misapplied this new API and ignored the status,
effectively applying all styles, all the time. This change instead resolves the
incoming styles against an "empty" style, yielding only the styles that should
be applied. As far as I am aware, we don't do any compositing with cursive
styles, so this should yield same results as we had with cursive 0.3.

Moreover, because we're once again only iterating on the actual effects we need
to apply, we can also restore the `bail!()` that was unnecessarily removed
durint the upgrade.

Closes arxanas#1642

Ref: ed946a9
Ref: f6a7008
Ref: gyscos/cursive@ea2e0be
@claytonrcarter claytonrcarter changed the title fix: consider effect status for terminal output fix(render): only apply real effects Feb 3, 2026
@claytonrcarter claytonrcarter merged commit 2ac991e into arxanas:master Feb 3, 2026
13 checks passed
@claytonrcarter claytonrcarter deleted the fix-1642 branch February 3, 2026 00:49
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.

1 participant