Skip to content

feat(frontend): create a new evaluator from the /m app playground evaluator picker - #8203

Merged
mmabrouk merged 4 commits into
release/v0.128.10from
feat/m-parity-playground-evaluator-create
Nov 6, 2026
Merged

mmabrouk merged 4 commits into
release/v0.128.10from
feat/m-parity-playground-evaluator-create

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member

Context

The evaluator picker in the /m app playground had no "Create new evaluator", which /w has. The picker could already show the action (#8192), but the editable evaluator drawer (#8187) owns the playground state while it is open: it would replace the app on the page with the new evaluator and clear the playground when it closed.

Changes

  • A drawer mode that leaves the playground alone. EditableRevisionDrawer takes playground={false}. In that mode it does not add its revision to the playground state, does not clear it on close, shows no "Test" button, counts only its own revision as unsaved when asked to close, and discards its local draft on close (nothing else would). The default is unchanged.
  • Create new in the app playground (beta developer mode only). The playground header now uses PlaygroundEvaluatorPicker, which passes onCreateNew to the shared picker. It opens the template picker, then the drawer in that mode, then the naming step. After Create the drawer closes and the new evaluator runs after the app, exactly like a picked one. The app, its revision and the test cases stay as they were. Without beta developer mode the picker is unchanged.
  • Phone width. The shared picker's trigger shows only its icon below sm again, so the playground bar keeps room for Compare. feat(frontend): automatic evaluators with types and categories in the /m playground evaluator picker #8192 had lost that when it moved the picker onto the shared cascader (the existing playgroundCompare test caught it). The cascader's placeholder now takes an element for that.

Stacked on #8197 (evaluator create entry points), based on main. The playground PR #8188 changes two lines in the shared picker file (chevron, chip colour); expect a small conflict there.

Tests

  • editableRevisionDrawer.render.test.tsx: off the playground the drawer leaves the page's playground nodes as they were, shows no Test, and drops its local draft on Discard (real molecule and playground controller, HTTP mocked).
  • playgroundEvaluatorCreate.render.test.tsx: no create without beta mode; with it the flow opens off the playground and the new evaluator is connected after the app.
  • The playground screen, compare, refine, revision actions, evaluator and execution header tests pass, including the phone-width check.
  • Types for @agenta/mobile and @agenta/oss, lint on the changed files.
  • Checked in the browser on a dev build against a test stack: Capital finder playground (verbose v5) > Evaluator > Create new evaluator > Exact Match. The drawer has no Test pane; Create with a name; the drawer closes, the new evaluator's chip shows next to Evaluator and its result card shows under the test case; the playground still shows verbose v5.

What to QA

  • Beta developer mode on. Open an app playground, load a test set. Evaluator > "Create new evaluator", pick a template, change a setting, Create, name it. The playground keeps its app revision and test cases, and the new evaluator shows as a chip and runs on Run.
  • Open the create drawer and close it without creating: the playground is unchanged.
  • Regression: without beta developer mode the picker has no Create new; at phone width the Evaluator button shows its icon only.

Agenta Product Agent added 2 commits November 6, 2026 16:26
…luator picker

Entire-Checkpoint: 01M6RR0WK2D9816NXRM4C2ZK7P
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features

    • Added evaluator creation from the playground in beta developer mode. Newly created evaluators connect to the playground when an app node is available.
    • Evaluator drawers can open outside the playground without changing its displayed state. Testing controls are hidden, and local drafts are discarded when the drawer closes.
    • Connected evaluator revisions are grouped and shown as selected. Deselecting a revision disconnects it from the playground.
  • Style

    • On phones, the evaluator picker shows its icon without the text label.

The playground header now supports evaluator creation in beta developer mode and connects created evaluators to the root node when present. The drawer can operate without changing playground state. The evaluator picker supports connected-revision selection and disconnection, plus responsive placeholder text and scoped colors.

Changes: Playground evaluator creation and selection

Layer / File(s) Summary
Drawer mode without playground state
web/packages/agenta-playground-ui/src/panels/drawer/types.ts, web/packages/agenta-playground-ui/src/panels/drawer/EditableRevisionDrawerBody.tsx, web/packages/agenta-playground-ui/src/panels/drawer/useDrawerPlaygroundSession.ts, web/packages/agenta-playground-ui/src/panels/drawer/EditableRevisionDrawer.tsx, web/mobile/tests/unit/editableRevisionDrawer.render.test.tsx
The drawer accepts a playground flag. When false, it hides the test toggle, skips playground session setup, checks unsaved edits for the shown revision, and discards a displayed local draft on close. The test checks that the displayed revision remains unchanged.
Connected evaluator selection
web/packages/agenta-entity-ui/src/selection/components/UnifiedEntityPicker/types.ts, web/packages/agenta-entity-ui/src/selection/components/UnifiedEntityPicker/variants/PopoverCascaderVariant.tsx, web/packages/agenta-playground-ui/src/panels/evaluator/EvaluatorPicker.tsx, web/mobile/src/styles/globals.css, web/mobile/tests/unit/playgroundEvaluatorPicker.render.test.tsx
The picker groups connected revisions by evaluator and supports selecting or disconnecting revisions. It shows selected-child summaries and revision counts. The popup accepts custom styling, the placeholder accepts ReactNode, and playground colors are scoped. Tests cover displayed revision metadata and disconnection.
Creation flow and playground integration
web/mobile/src/features/evaluators/create/CreateEvaluatorFlow.tsx, web/mobile/src/features/evaluators/create/EvaluatorEditorDrawer.tsx, web/mobile/src/features/evaluators/create/PlaygroundEvaluatorPicker.tsx, web/mobile/src/features/playground/PlaygroundHeader.tsx, web/mobile/tests/unit/playgroundEvaluatorCreate.render.test.tsx
The header uses a picker that enables creation in beta developer mode. The creation flow opens with playground mode enabled and connects a created evaluator after the root node when one exists. Tests cover the creation gate and connection.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlaygroundHeader
  participant PlaygroundEvaluatorPicker
  participant CreateEvaluatorFlow
  participant EvaluatorEditorDrawer
  participant PlaygroundState
  PlaygroundHeader->>PlaygroundEvaluatorPicker: render picker
  PlaygroundEvaluatorPicker->>CreateEvaluatorFlow: open with automatic kind and playground mode
  CreateEvaluatorFlow->>EvaluatorEditorDrawer: render creation drawer
  EvaluatorEditorDrawer-->>PlaygroundEvaluatorPicker: return created evaluator
  PlaygroundEvaluatorPicker->>PlaygroundState: connect evaluator after root node when present
Loading

Possibly related PRs

Merge Risk: Low · previous review 5d5c5

Evaluator creation appears mergeable with awareness that a discarded local draft may remain in memory after creation; no visible saved-result error was established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title describes the main change: creating an evaluator from the /m app playground picker.
Description check Passed The description matches the evaluator creation flow, drawer mode, responsive picker, and tests.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%. 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

Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%. 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 1 functions across 14 files. (1 skipped: 1 unsupported.)

  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ac2f89e and 5d5c564.

Files selected for processing: 5

  • web/mobile/src/styles/globals.css
  • web/mobile/tests/unit/playgroundEvaluatorPicker.render.test.tsx
  • web/packages/agenta-entity-ui/src/selection/components/UnifiedEntityPicker/types.ts
  • web/packages/agenta-entity-ui/src/selection/components/UnifiedEntityPicker/variants/PopoverCascaderVariant.tsx
  • web/packages/agenta-playground-ui/src/panels/evaluator/EvaluatorPicker.tsx

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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-8203-agenta-website-preview.mahmoud-637.workers.dev

Built from f64bef529a5cba04ab033cc649169d1575023827. This comment updates in place on every push.

@mmabrouk

mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: @coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

@mmabrouk I’ll review the PR changes.

Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5424116 and ac2f89e.

Files selected for processing: 12

  • web/mobile/src/features/evaluators/create/CreateEvaluatorFlow.tsx
  • web/mobile/src/features/evaluators/create/EvaluatorEditorDrawer.tsx
  • web/mobile/src/features/evaluators/create/PlaygroundEvaluatorPicker.tsx
  • web/mobile/src/features/playground/PlaygroundHeader.tsx
  • web/mobile/tests/unit/editableRevisionDrawer.render.test.tsx
  • web/mobile/tests/unit/playgroundEvaluatorCreate.render.test.tsx
  • web/packages/agenta-entity-ui/src/selection/components/UnifiedEntityPicker/types.ts
  • web/packages/agenta-playground-ui/src/panels/drawer/EditableRevisionDrawer.tsx
  • web/packages/agenta-playground-ui/src/panels/drawer/EditableRevisionDrawerBody.tsx
  • web/packages/agenta-playground-ui/src/panels/drawer/types.ts
  • web/packages/agenta-playground-ui/src/panels/drawer/useDrawerPlaygroundSession.ts
  • web/packages/agenta-playground-ui/src/panels/evaluator/EvaluatorPicker.tsx

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

Ticks on each row to connect several evaluators, the selected summary
line, coloured type tags (colour tokens scoped to the picker popover
with .ag-playground-colors) and a chevron on the Evaluator button.

Entire-Checkpoint: 01M6RZE1A6BGP2YHBF6ZXJVC3G
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

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

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 commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: @coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

@mmabrouk I’ll start an incremental review of the PR.

Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mmabrouk
mmabrouk changed the base branch from feat/m-parity-evaluator-entry-points to release/v0.128.10 November 6, 2026 18:49
@mmabrouk
mmabrouk merged commit 4579661 into release/v0.128.10 Nov 6, 2026
30 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