Skip to content

fix(ui): render ANSI color codes in editor panel inline error widget#10418

Merged
sheremet-va merged 8 commits into
mainfrom
copilot/fix-ansi-color-message-formatting
May 22, 2026
Merged

fix(ui): render ANSI color codes in editor panel inline error widget#10418
sheremet-va merged 8 commits into
mainfrom
copilot/fix-ansi-color-message-formatting

Conversation

Copilot AI commented May 21, 2026

Copy link
Copy Markdown
Contributor

@netlify

netlify Bot commented May 21, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit cfe3ab9
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a0fa5ee8aa9df000871219a
😎 Deploy Preview https://deploy-preview-10418--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Fix badly formatted ANSI color error message in UI fix(ui): render ANSI color codes in editor panel inline error widget May 21, 2026
Copilot AI requested a review from hi-ogawa May 21, 2026 08:53
@hi-ogawa

Copy link
Copy Markdown
Collaborator

@copilot add test in test/ui

Copilot AI commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add test in test/ui

Added in commit 6e71e2c.

New fixture test/ui/fixtures/editor-ansi/basic.test.ts throws an error with ANSI-colored message. The Playwright test (editor ansi > ansi error message is rendered as html in editor) opens the failing test's Code tab and snapshot-asserts the span[style] children of the CodeMirror line widget's pre:

  • green span (color:#0A0) contains "Expected value"
  • red span (color:#A00) contains "actual value"

This verifies ANSI codes are converted to HTML color spans rather than leaked as raw escape sequences.

Comment thread test/ui/test/editor.spec.ts Outdated
Copilot AI requested a review from hi-ogawa May 21, 2026 09:25
@hi-ogawa
hi-ogawa marked this pull request as ready for review May 22, 2026 01:48
],
use: {
trace: process.env.CI ? 'on-first-retry' : 'on',
trace: process.env.CI ? 'on-first-retry' : undefined,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure why trace had always on locally. On my machine, trace is somehow causing all playwright test to hang including playwright test --ui too. Anyways, we shouldn't need always on so removing to also unblock my own local dev.

@hi-ogawa hi-ogawa removed their assignment May 22, 2026
@sheremet-va
sheremet-va merged commit 766b8d2 into main May 22, 2026
18 checks passed
@sheremet-va
sheremet-va deleted the copilot/fix-ansi-color-message-formatting branch May 22, 2026 06:55
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.

The error message with ansi color is badly formatted on UI editor panel

3 participants