# Debug a Front-End Bug in a React App Together

An agent sets up a React app, asks your team for the exact reproduction and tries it in a browser; on excalidraw issue #9708 the bug did not reproduce.

[Run this on Rush](https://cloud.getrush.ai/run/debug-together-in-browser/react/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent installs with `yarn install --frozen-lockfile` (the root `package.json` pins `yarn@1.22.22`), runs the four checks on the untouched clone, and ends its first turn with six questions, from starting scene and viewport to the exact pointer sequence. A follow-up answered with excalidraw issue #9708: a Mermaid flowchart whose labels use `<br>`, pasted into More tools > Mermaid to Excalidraw, reported to show a literal `<br>`.

It ran `yarn start`, pasted the diagram in the sandbox Chromium, clicked Insert, and read the inserted text elements from `localStorage`. It also read `packages/excalidraw/components/TTDDialog/common.ts`, which passes the definition to `@excalidraw/mermaid-to-excalidraw` and has no `<br>` handling of its own.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Prepare this React application in its sandbox using the declared workspace/package-manager setup. A teammate will show the bug; finish the initial turn asking for the starting scene, route, browser/viewport, tool, zoom and exact pointer/keyboard sequence, then wait for their follow-up. Reproduce it yourself before editing. Identify whether the app shell or editor package owns the failure, add a regression test that fails on the original behavior, and make the smallest fix without unrelated component rewrites. Respect ownerDocument/ownerWindow conventions for browser APIs. Run the focused non-watch test, typecheck and repository-required checks, explaining snapshot changes. Repeat the original interaction in the browser with synthetic content and capture before/after evidence. Open a PR on the connected repository and list any verification that remains blocked.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

Tried on excalidraw/excalidraw at 8bcdca45: no code change, because the bug did not reproduce. Every label rendered on two lines; the stored text was `"User Registration\nProcess"` with no literal `<br>`. The issue's fuller example was clean too, so the run wrote no test and opened no pull request. On the untouched clone `yarn test:typecheck`, `yarn test:code` and `yarn test:other` exited 0, and `yarn test:app --watch=false` ended `Tests  2638 passed | 47 skipped | 1 todo (2686)`.

For the reviewer: close #9708 as fixed on master, or ask the teammate for the build or paste path that still shows it and its Mermaid package version. Not done: the viewport was 1431x779, not the 1280x800 the follow-up named; Firefox and WebKit were not tried; pasting onto the canvas (`App.clipboard.ts`) was not tested.

## Run it on every browser bug a teammate brings

A teammate starts this run from the console. When its first turn ends with questions, the starter or an org admin sends the reproduction as a follow-up, as this trial's follow-up sent #9708's diagram.

## Why run it on Rush?

The run tried the reproduction before editing, found the labels already split, and said it would not invent a failing test for behaviour that works. Its explanation is an inference from the git log, which it did not test: master moved to `@excalidraw/mermaid-to-excalidraw` 3.1.0 and its v3 Pele layout in #12480 and #12481, and the issue was probably filed against the v2 layout.

## Frequently asked questions

### Why is there no pull request?

The run could not reproduce #9708 on `8bcdca45` with the reported input or the issue's full example, so it had no diff and no regression test. Its evidence is two screenshots and the text elements read from `localStorage`.

### Which package owns the Mermaid conversion?

The run could not tell without a failure. `TTDDialog/common.ts` only hands the definition to `@excalidraw/mermaid-to-excalidraw`; a deployed app or older release on its v2 layout could still show it.

## More React jobs

- [Find Dead Code in a React Project](https://getrush.ai/run/find-dead-code/react/)
- [Fix "Support for defaultProps Will Be Removed from Function Components" After a React 18.3 Upgrade](https://getrush.ai/run/fix-defaultprops-will-be-removed-from-function-components-warning/react/)
- [Fix Flaky Tests in a React App](https://getrush.ai/run/fix-flaky-tests/react/)

## The same job on other stacks

- [Debug a Front-End Bug in a Nuxt App Together](https://getrush.ai/run/debug-together-in-browser/nuxt/)

## More jobs like this: Steer a run as a team

- [Fix Mobile Layout Bugs in a Laravel App](https://getrush.ai/run/fix-mobile-layout/laravel/)
- [Fix Mobile Layout Bugs in a Nuxt App](https://getrush.ai/run/fix-mobile-layout/nuxt/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
