Skip to content

fix(frontend): playground message editors fit their text and use the app font in /m - #8145

Merged
mmabrouk merged 1 commit into
release/v0.128.9from
fix/m-playground-editor-font
Nov 6, 2026
Merged

mmabrouk merged 1 commit into
release/v0.128.9from
fix/m-playground-editor-font

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member

What the user sees

In /m developer mode, the playground's message editors now look like /w:

  1. Messages use the app font at 13 px, not a code font (parity findings playground-font-01 and evaluators-pg-07). Before, every System, User and Assistant message, and the LLM judge prompt in the evaluator playground, rendered in the browser's monospace font at about 15 px.
  2. Message boxes fit their text (playground-editor-height-01). Before, every message box was about 210 px tall, even for one line. System plus User took about 430 px in /m and about 190 px in /w. They now take about 160 px. In the chat pane, a full turn and the next empty User message now fit on one screen with the Run button visible. After one chat run with Mistral Small, the Run button sits at y=671 on a 900 px window. Before, it sat at y=1118, below the screen.
  3. Message text lines up with the role label (playground-editor-align-01). Before, the text started about 8 px left of "System" or "User".

/m without developer mode does not change. The new rules apply only inside the playground, which only developer mode shows. The agent config and the trace drawer render the same editor, and they keep their current look.

Why it was broken, and the fix

  • Height: the shared editor theme (@agenta/ui/editor-theme.css) gives .editor-input a min-height: 150px. The editor overrides it with the Tailwind class min-h-[inherit]. In /w that class wins. In /m the theme file is imported without a CSS layer, and CSS outside a layer always beats Tailwind's layered classes, so the 150 px stayed.
  • Font: Tailwind's base styles give code the monospace font, and the editor's text view renders each message inside a <code>. /w resets that element to the app font in web/oss/src/styles/globals.css. /m had no reset.
  • Alignment: /w pads the role label and the text with the same 8 px inset (--ag-message-inline-pad). /m had no such rule.

The fix adds those rules to web/mobile/src/styles/globals.css, scoped to [data-playground]. PlaygroundWorkspace and EvaluatorPlaygroundWorkspace set that attribute on their root element. No shared package changes, so /w does not change.

Tests

  • mobile/tests/unit/playgroundEditorStyle.test.ts loads the real editor theme and the real /m globals.css and reads the computed style of a message editor. Inside the playground, the editor has no minimum height, the text uses the app font at 13 px, and the text and the role label share the same inset. Outside the playground, the same editor keeps its 150 px minimum height and its code font. Three of the four tests fail without the fix.
  • mobile/tests/unit/playgroundScreen.render.test.tsx checks that the config pane and the run pane are inside the [data-playground] element.

Checks: the /m type check passes. ESLint and Prettier pass on the changed files. The playground screen and evaluator playground tests pass.

Live check: I ran /m from this branch (local dev server behind a proxy to the QA stack) at 1440 px and 390 px. I checked the Capital finder completion playground, the Support bot chat playground (one chat turn and one completion run, both with Mistral Small) and the Answer correctness judge in the evaluator playground. There were no page errors.

Not in this PR

  • playground-prompt-header-01: no change needed. "Prompt Template" has the same weight (500) and size (14 px) in /w and /m. It looks lighter in /m only because /m uses the system font everywhere and /w uses Inter. Changing the app font is out of scope.
  • The trace drawer output keeps its current font. The trace drawer also opens outside developer mode, so changing it would change /m for users without developer mode.
  • The run results, inputs and the empty User box in the chat pane are in the next PR (results and rows).

…app font in /m

Entire-Checkpoint: 01M6R1CZ9QKZNK08CEY3XJJXR0
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Summary

Summary by CodeRabbit

  • Style
    • Improved the appearance of playground chat editors with consistent text sizing, aligned message labels and content, and more compact spacing.
    • Kept editor styling outside the playground unchanged.

The playground workspace roots now carry a data-playground attribute. Global CSS uses that scope to format message editors, and tests check the scoped styles and workspace markup.

Changes: Playground editor styling

Layer / File(s) Summary
Mark playground workspace roots
web/mobile/src/features/playground/EvaluatorPlaygroundWorkspace.tsx, web/mobile/src/features/playground/PlaygroundWorkspace.tsx, web/mobile/tests/unit/playgroundScreen.render.test.tsx
Both workspace roots gain data-playground. A render test checks that the configuration panel and run pane are nested beneath an element with that attribute.
Style and verify playground editors
web/mobile/src/styles/globals.css, web/mobile/tests/unit/playgroundEditorStyle.test.ts
Scoped CSS sets editor font size and inset, removes the input’s minimum height, and styles markdown editor content. The test checks the scoped styles and verifies that an unscoped editor retains its minimum height and monospace font.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • Agenta-AI/agenta#8070: Adds EvaluatorPlaygroundWorkspace, which this change marks with data-playground.
  • Agenta-AI/agenta#8012: Adds the /m playground workspace, which this change marks with data-playground and scopes editor styles to.
  • Agenta-AI/agenta#8049: Adds a compare view that renders ChatMessage editors inside PlaygroundWorkspace, where the scoped styles apply.
Merge Risk: Low · up to 295ea

Markdown messages may appear slightly larger than intended, and the empty User box may shrink. These are bounded visual regressions that can be corrected without blocking merge.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title identifies the playground editor height and font changes in /m.
Description check Passed The description explains the scoped playground editor styling and related tests.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Nitpick comments: 1

web/mobile/src/styles/globals.css: 1

562-570: Trivial · Maintainability & Code Quality · Low value

Shorten the CSS comment block.

The block is nine lines of prose that explain why. The repository rule allows at most one short line per comment. A longer comment is allowed only for a surprising constraint, and then a sentence or two at most. Cut the block to the one surprising constraint: the unlayered editor theme outranks Tailwind utilities, so min-height must be reset here.

As per coding guidelines: "Keep in-code comments terse. Hard rule. At most ONE short line per comment."

Source: Coding guidelines

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8d75125 and 295eacd.

Files selected for processing: 5

  • web/mobile/src/features/playground/EvaluatorPlaygroundWorkspace.tsx
  • web/mobile/src/features/playground/PlaygroundWorkspace.tsx
  • web/mobile/src/styles/globals.css
  • web/mobile/tests/unit/playgroundEditorStyle.test.ts
  • web/mobile/tests/unit/playgroundScreen.render.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

Comment thread web/mobile/src/styles/globals.css Resolved
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit 295eacd4384d01b125783ae43f0d7a7b2c6daa9e
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/42191967655

Dependent tests finished. Post /preview for manual review. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

@mmabrouk
mmabrouk changed the base branch from main to release/v0.128.9 November 6, 2026 14:25
@mmabrouk
mmabrouk merged commit 35cf74a into release/v0.128.9 Nov 6, 2026
87 of 90 checks passed
@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant