Skip to content

fix(frontend): keep the playground test cases after creating an evaluator from New Evaluation in /w - #8087

Merged
mmabrouk merged 1 commit into
release/v0.128.6from
fix/w-playground-new-eval-drawer
Nov 4, 2026
Merged

mmabrouk merged 1 commit into
release/v0.128.6from
fix/w-playground-new-eval-drawer

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 4, 2026

Copy link
Copy Markdown
Member

For the release after v0.128.5. The bug is already in production; v0.128.5 did not cause it.

In the /w playground, connect a test set. Open New Evaluation, then Evaluators, then "Create new evaluator" (for example Exact Match). Close the drawer and close the modal. The playground now has 0 test case rows.

The modal opened the evaluator drawer without isolatedPlayground: true. The drawer then took over the app's playground store, and its close cleanup deleted the app's rows. The playground header already passes isolatedPlayground: true and keeps the rows.

Change

  • The modal now opens the drawer with isolatedPlayground: true, through a small helper (newEvaluationEvaluatorDrawerParams).
  • OpenDrawerParams is exported from evaluatorDrawerStore.ts for the helper.

Isolated mode in the modal

  • onEvaluatorCreated still fires with the new revision id, so the modal still selects the new evaluator.
  • The drawer skips the playground's own commit callback, which the modal does not need.
  • The drawer gets its own store, so it works the same when the modal opens from the evaluations page.
  • initialAppSelection is not passed. The modal has no app revision to hand over, so the persisted app selection stays the fallback.

Tests

evaluatorDrawerParams.test.ts opens the drawer the way the modal does. It checks that the drawer is isolated and that onEvaluatorCreated still receives the revision id. It fails without the fix. It does not render the drawer, so the row-deletion path is covered by the isolation flag, not by a rendered close.

Checks: pnpm --filter @agenta/oss types:check, the test, eslint and prettier on the changed files all pass.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Summary

Summary by CodeRabbit

  • New Features
    • Creating an evaluator from a template now opens the evaluator drawer in an isolated playground and stays in the current view after creation.
    • The created evaluator’s configuration ID is passed to the creation callback when available.

The New Evaluation modal now uses a helper to build evaluator drawer parameters after template creation. The helper enables isolated-playground mode and keeps navigation in the modal. Tests cover drawer state and callback forwarding.

Changes: New Evaluation evaluator drawer

Layer / File(s) Summary
Drawer parameter helper and tests
web/oss/src/state/evaluator/evaluatorDrawerStore.ts, web/oss/src/components/pages/evaluations/NewEvaluation/Components/evaluatorDrawerParams.ts, web/oss/src/components/pages/evaluations/NewEvaluation/Components/evaluatorDrawerParams.test.ts
OpenDrawerParams is now exported. The new helper returns create-mode parameters with isolated-playground mode enabled and post-create navigation set to "stay". Tests check drawer state and callback forwarding.
Modal integration
web/oss/src/components/pages/evaluations/NewEvaluation/Components/NewEvaluationModalContent.tsx
The modal uses the helper when it opens the evaluator drawer after template creation.

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

Possibly related PRs

  • Agenta-AI/agenta#8065: Changes the same New Evaluation drawer flow and sets postCreateNavigation: "stay" when opening the evaluator drawer.
Merge Risk: Low · up to 59994

The drawer may require selections to be restored manually, and a concurrent save may leave the playground on its previous revision. These risks are bounded but should be understood before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the actual fix: the playground test cases are kept after an evaluator is created from New Evaluation in the /w playground. The changeset adds isolatedPlayground: true to the modal's dr…
Description check Passed The description is directly related to the changeset. It explains the bug (the modal opens the evaluator drawer without isolatedPlayground: true, so the drawer's close cleanup deletes playground rows)…
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: Title check

Explanation

The title names the actual fix: the playground test cases are kept after an evaluator is created from New Evaluation in the /w playground. The changeset adds isolatedPlayground: true to the modal's drawer parameters through a new helper, which matches this. The title is specific and follows the fix(scope) convention. It is long (99 characters) but still reads as one clear sentence.

Full details: Description check

Explanation

The description is directly related to the changeset. It explains the bug (the modal opens the evaluator drawer without isolatedPlayground: true, so the drawer's close cleanup deletes playground rows). It describes the change (the newEvaluationEvaluatorDrawerParams helper and the exported OpenDrawerParams), the behavior of onEvaluatorCreated, the new tests, and the checks that were run.

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.

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: 2

Nitpick comments: 1
web/oss/src/components/pages/evaluations/NewEvaluation/Components/evaluatorDrawerParams.test.ts: 1

13-25: Trivial · Functional Correctness · Quick win

Cover the modal template-creation path.

The tests validate the helper, but they do not validate that NewEvaluationModalContent uses the helper when a template creates an evaluator. A regression in that caller could omit isolatedPlayground: true while both tests still pass. Add a modal-level test that invokes the template handler and asserts the parameters passed to openEvaluatorDrawer.

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 3c8d1a7 and 59994e2.

Files selected for processing: 4
  • web/oss/src/components/pages/evaluations/NewEvaluation/Components/NewEvaluationModalContent.tsx
  • web/oss/src/components/pages/evaluations/NewEvaluation/Components/evaluatorDrawerParams.test.ts
  • web/oss/src/components/pages/evaluations/NewEvaluation/Components/evaluatorDrawerParams.ts
  • web/oss/src/state/evaluator/evaluatorDrawerStore.ts

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 4, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

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

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 4, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: Live check of this PR on a fresh OSS dev stack at head 59994e2, in the old /w app at 1440 px.

  • The release QA steps (connect a test set with 2 rows, New Evaluation > Evaluators > Create new evaluator > Exact Match, close the drawer, close the modal): pass. The playground keeps its 2 test case rows, and the shown revision stays v1 (no evaluator draft).
  • Save the new evaluator in the drawer first: pass. The modal selects the new evaluator and the rows stay.
  • New Evaluation from the Evaluations page (outside the playground), Create new evaluator, save: pass.
  • The playground header's own evaluator drawer: pass, rows stay.
  • Console: no new errors.

One note, not caused by this PR: after any evaluator drawer closes in the playground (this path and the header path, which this PR does not touch), the URL loses ?revisions= and the #pgSnapshot hash. A page reload then shows 1 empty row and no test set. Opening and closing only the modal keeps both.

A video of the steps is in my local evidence folder and can be attached on request.

@mmabrouk
mmabrouk changed the base branch from release/v0.128.5 to release/v0.128.6 November 4, 2026 15:42
@mmabrouk
mmabrouk merged commit e2ce9ca into release/v0.128.6 Nov 4, 2026
76 of 81 checks passed
@mmabrouk mmabrouk mentioned this pull request Nov 4, 2026
2 tasks
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.

1 participant