Skip to content

ref(ui): replace ansi-to-react with shared AnsiText component - #126237

Open
JoshuaKGoldberg wants to merge 5 commits into
masterfrom
joshgoldberg/de-1651-remove-ansi-to-react-in-favor-of-ansi-sequence-parser
Open

JoshuaKGoldberg wants to merge 5 commits into
masterfrom
joshgoldberg/de-1651-remove-ansi-to-react-in-favor-of-ansi-sequence-parser

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Moves the ansi-sequence-parser rendering added for log messages in #126206 into a shared AnsiText component. This is then used in the .log attachment preview instead of ansi-to-react. 🔪

This also fixes long-standing design issues in that preview by aligning them to #126206's designs: bright colors were nearly invisible, black or white text vanished depending on theme, and bold, underline, dim, 256-color, and truecolor codes were ignored.

Before After
Light Before, light theme After, light theme
Dark Before, dark theme After, dark theme

Closes DE-1651.

Moves the ansi-sequence-parser rendering from logs into a shared component so .log attachment previews use it too, and drops the ansi-to-react dependency.

Fixes DE-1651
@linear-code

linear-code Bot commented Oct 1, 2026

Copy link
Copy Markdown

DE-1651

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 1, 2026
@JoshuaKGoldberg

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ce3ac45. Configure here.

Comment thread static/app/components/ansiText.tsx
@JoshuaKGoldberg JoshuaKGoldberg changed the title ref(ui): Replace ansi-to-react with shared AnsiText component ref(ui): replace ansi-to-react with shared AnsiText component Oct 1, 2026
ansi-to-react collapsed carriage-return overwrites before rendering, so progress-style lines showed only their final write. Restore that in LogFileViewer.

Refs DE-1651

@scttcper scttcper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good cleanup, that package was actually very unsafe

Only log messages want ANSI output's whitespace preserved. Other callers render it in single-line, truncated containers where preserved newlines would break the layout.

Refs DE-1651
The dark green ANSI color had noticeably more chroma than the other ANSI hues, so move green and bright green one step lighter.

Refs DE-1651

This branch was successfully deployed

1 active deployment
Preview — fda6aa72 Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants