Unverified Commit c2062dc6 authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

fix(devtools): render nested error messages with HotlinkedText (#93620)

### What?

The primary error description renders its message through
`HotlinkedText`, so `Learn more: https://...` URLs become real links.
The nested overlay surfaces — `Caused by` (`error-cause.tsx`) and
aggregate-error rows (`error-aggregate-errors.tsx`) — still rendered the
trimmed message as plain `<p>` text, leaving those URLs unclickable.

### How?

Wrap `{trimmedMessage}` in `<HotlinkedText>` on both surfaces. Default
browser link color (blue) is left intact so the URLs stand out against
the red message text.

Before:
<img width="1332" height="1234" alt="CleanShot 2026-05-08 at 00 15
42@2x"
src="https://github.com/user-attachments/assets/88cf519d-3b7e-47a8-a963-429d480b3229"
/>

After:
<img width="1100" height="1098" alt="CleanShot 2026-05-08 at 00 15
14@2x"
src="https://github.com/user-attachments/assets/91bcb1fd-a446-4969-b3f1-77df9659613d"
/>

---------
Co-authored-by: 's avatarCursor <cursoragent@cursor.com>
parent 191fd742
...@@ -3,6 +3,7 @@ import React from 'react' ...@@ -3,6 +3,7 @@ import React from 'react'
import { CodeFrame } from '../../components/code-frame/code-frame' import { CodeFrame } from '../../components/code-frame/code-frame'
import { ErrorOverlayCallStack } from '../../components/errors/error-overlay-call-stack/error-overlay-call-stack' import { ErrorOverlayCallStack } from '../../components/errors/error-overlay-call-stack/error-overlay-call-stack'
import { ErrorCause } from './error-cause' import { ErrorCause } from './error-cause'
import { HotlinkedText } from '../../components/hot-linked-text'
import type { ReadyErrorCause } from '../../utils/get-error-by-type' import type { ReadyErrorCause } from '../../utils/get-error-by-type'
interface ErrorAggregateErrorsProps { interface ErrorAggregateErrorsProps {
...@@ -64,7 +65,9 @@ function ErrorAggregateEntry({ ...@@ -64,7 +65,9 @@ function ErrorAggregateEntry({
</span> </span>
</div> </div>
{trimmedMessage ? ( {trimmedMessage ? (
<p className="error-aggregate-error-message">{trimmedMessage}</p> <p className="error-aggregate-error-message">
<HotlinkedText text={trimmedMessage} />
</p>
) : null} ) : null}
{firstFrame && ( {firstFrame && (
......
...@@ -3,6 +3,7 @@ import React from 'react' ...@@ -3,6 +3,7 @@ import React from 'react'
import { CodeFrame } from '../../components/code-frame/code-frame' import { CodeFrame } from '../../components/code-frame/code-frame'
import { ErrorOverlayCallStack } from '../../components/errors/error-overlay-call-stack/error-overlay-call-stack' import { ErrorOverlayCallStack } from '../../components/errors/error-overlay-call-stack/error-overlay-call-stack'
import { ErrorAggregateErrors } from './error-aggregate-errors' import { ErrorAggregateErrors } from './error-aggregate-errors'
import { HotlinkedText } from '../../components/hot-linked-text'
import type { ReadyErrorCause } from '../../utils/get-error-by-type' import type { ReadyErrorCause } from '../../utils/get-error-by-type'
type ErrorCauseProps = { type ErrorCauseProps = {
...@@ -32,7 +33,9 @@ export function ErrorCause({ cause, dialogResizerRef }: ErrorCauseProps) { ...@@ -32,7 +33,9 @@ export function ErrorCause({ cause, dialogResizerRef }: ErrorCauseProps) {
</span> </span>
</div> </div>
{trimmedMessage ? ( {trimmedMessage ? (
<p className="error-cause-message">{trimmedMessage}</p> <p className="error-cause-message">
<HotlinkedText text={trimmedMessage} />
</p>
) : null} ) : null}
{firstFrame && ( {firstFrame && (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment