Skip to content

Conversation

@pearmini
Copy link
Collaborator

@pearmini pearmini commented Oct 9, 2025

@jackbdu Optimize the error message. This PR only optimizes its visual output, making it more obvious!

image

Now the prefix is different between normal output and error output. It can help users to quickly tell the difference, which is also easier to implement.

@pearmini pearmini marked this pull request as draft October 9, 2025 12:54
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2025

Deploying recho with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0761ea6
Status: ✅  Deploy successful!
Preview URL: https://f571aa28.recho.pages.dev
Branch Preview URL: https://style-error.recho.pages.dev

View logs

@pearmini pearmini requested a review from Copilot October 11, 2025 15:49
@pearmini pearmini marked this pull request as ready for review October 11, 2025 15:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes error message display by introducing visual differentiation between normal output and error output using distinct prefixes and styling.

  • Introduces a new error mark symbol (✗) to distinguish errors from regular output (➜)
  • Updates the formatting system to use different prefixes for errors vs normal output
  • Adds CSS styling to visually highlight error lines with red coloring and background patterns

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runtime/constant.js Adds ERROR_MARK constant for the new error symbol
runtime/index.js Implements separate formatting functions for errors vs output and updates error handling
editor/outputLines.js Updates line detection to handle both output and error marks with type classification
editor/decoration.js Adds error-specific line decoration styling
editor/index.css Defines CSS styles for error lines with red background pattern and text color
test/output/syntaxError2.js Updates test expectation to use new error prefix
test/output/syntaxError.js Updates test expectation with new error prefix and additional context
test/output/runtimeError.js Updates test expectation showing both error and success output with different prefixes
test/js/syntax-error.js Expands test case with more comprehensive code example
test/js/runtime-error.js Expands test case to include both error and success scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pearmini pearmini changed the title Style error Optimize the style of error message Oct 11, 2025
@pearmini pearmini merged commit bfad641 into main Oct 11, 2025
2 checks passed
@pearmini pearmini deleted the style-error branch October 11, 2025 15:52
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.

2 participants