Skip to content

feat(frontend): Test sets list in /m behind the developer view switch - #8002

Merged
mmabrouk merged 8 commits into
release/v0.128.4from
feat/m-view-testsets
Nov 3, 2026
Merged

mmabrouk merged 8 commits into
release/v0.128.4from
feat/m-view-testsets

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 2, 2026

Copy link
Copy Markdown
Member

For the release after v0.128.3. Do not merge into v0.128.3.

Context

The old app has a "Test sets" page. /m has none. This PR adds the list to /m as a developer view, behind the staged switch from #7985. It ships with stage hidden, so no user sees it and the navigation has no link.

Scope is the list only. Create, clone, rename, the detail page and the archived page are separate work. Until the detail page lands, a row opens /testsets/<revision id>, which has no page yet.

Changes

  • New view testsets in DEVELOPER_VIEWS (stage hidden, label "Test sets"). Route /w/[workspace_id]/p/[project_id]/testsets, wrapped in DeveloperViewGate.
  • A list of test sets, newest first, 50 per page, with a "Load more" button. Columns are Name, Commit Message, Created by and Date Created. On a phone the list keeps Name and Date Created.
  • Search is sent to the server as a name filter, after a 300 ms pause, and is kept in the address as ?q=.
  • Row menu: View details, Clone and Rename (only drawn when the page is given those actions, which this PR does not do), Export as CSV, Export as JSON, Archive. Archive asks for confirmation and checks first whether an evaluation uses the test set.
  • Clone, Rename, Archive and Create new testset are drawn only for readers with edit_testsets. Export keeps the old page rule (view_api_keys and edit_api_keys).
  • @agenta/entities testset schema now reads the audit fields, so the list can show "Created by".
  • Left out on purpose: bulk select and bulk archive, the date filters, column visibility and the table CSV export.

Bugs in the old page, fixed here (each has a test)

  • A failed load showed an empty list. It now shows "Could not load test sets" with a retry.
  • A failed "Load more" would have hidden the rows already loaded. The loaded rows stay and a message says what failed.
  • The old Commit Message column showed the text the system writes on its own ("Updated testset: ...") on test set rows. Those messages are now hidden.
  • The search text was saved in the browser, so the list opened filtered on the next visit. It now lives in the address.
  • Create, Clone, Rename and Archive showed to readers without edit_testsets. They are now hidden.
  • Clicking a test set that has only the empty first revision did nothing. It now shows a message.
  • The "in use" text said "in used" and asked to delete when the action was archive.
  • A failed archive showed nothing. It now shows a message and keeps the dialog open.
  • Archive is refused while another action on the same row is still running.

New user-facing text (needs Mahmoud's approval)

  • Registry label "Test sets" and description "Show the Test sets page under Developer in the navigation."
  • Empty list: "No test sets yet" and "Create one from a file, from scratch or with the API."
  • No search result: "No test sets match “”" and the button "Clear search"
  • Load error title: "Could not load test sets"
  • "Load more" button, and the toast "Couldn't load more test sets"
  • "This test set has no saved revision yet"
  • "Couldn't open this test set"
  • Archive confirmation: "Archive this test set?" and "“” and all its revisions will be archived."
  • "The test set is used by evaluation(s). Archive or delete the evaluation(s) first."
  • "Couldn't archive this test set"
  • "This test set is busy. Try again in a moment"
  • Unchanged from the old page: "Create new testset", "View details", "Export as CSV", "Export as JSON", "Testset archived", "Preparing export. This may take a moment…", "Testset exported as CSV/JSON", "Failed to export", "Name", "Commit Message", "Created by", "Date Created".
  • Open question for Mahmoud: the old page spells both "Test sets" and "Testsets". The view label uses "Test sets", and the button and toasts keep the old "testset".

Tests

  • pnpm --filter @agenta/mobile types:check and pnpm --filter @agenta/oss types:check: clean.
  • pnpm --filter @agenta/mobile lint: no errors (8 existing warnings).
  • pnpm --filter @agenta/mobile test: 164 of 165 files pass (992 of 993 tests). The one failure is membersTabRoleChange.render.test.tsx, which also fails on release/v0.128.3 (it throws in authEnv). agentPermissions.render.test.tsx, the other known failure, also fails on the release branch and passed in this run.
  • New tests: testsetsList, testsetRowActions, testsetCommitMessage, testsetsListScreen.render, testsetsTable.render, and a schema test in @agenta/entities. Storybook stories for the list are in @agenta/mobile/Developer.
  • Review loop: two rounds ran. Correctness was still Medium after the last round, and I could not recover the finding text, so treat it as open. The other lenses' last ratings were not recorded.
  • Speed: no antd, no new dependency, no package.json change. Nothing in _app, AppProviders, GlobalDrawers or the app shell imports the view. No link prefetches the page.

Open problems

  • The row opens a page that does not exist yet (see Context).
  • The correctness finding left at Medium (see Tests) needs a decision before this view moves to preview.
  • No screenshots of the real app yet, because the view is hidden.

What to QA

Not reachable yet. To try it, set AGENTA_DEVELOPER_VIEWS=testsets on the web container and open /m/w/<workspace>/p/<project>/testsets. Once the stage is preview, switch it on in Settings > Preferences.

  • The list shows test sets, newest first. Scroll to the end and use "Load more".
  • Type in the search box. The address gets ?q=, the list filters, and a reload keeps the search. Open the page in a new tab without ?q=: the list is not filtered.
  • Open the row menu and choose Export as CSV. The file downloads and the toast says "Testset exported as CSV".
  • Archive a test set that an evaluation uses: the message names the evaluation count and nothing is archived. Archive an unused one: the row leaves the list.
  • Sign in as a reader without edit_testsets: Archive is not in the menu.
  • Regression: with the switch off, the same address shows "not found".

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Summary

Summary by CodeRabbit

  • New Features
    • Added a developer view for browsing project test sets, with search, pagination, and clear empty, no-match, and error states.
    • Test set rows show creation dates and, on wider screens, commit messages and creator details.
    • Available row actions include viewing details, cloning, renaming, archiving, and CSV or JSON export, depending on permissions.
    • Added confirmation before archiving a test set.
  • Bug Fixes
    • Improved handling of list-loading and archive errors while preserving already loaded results.

The pull request adds a hidden test-set developer view with URL-backed search, paginated results, commit-message display, row actions, and empty and error states. It also adds test-set creator audit fields to the validation schema.

Changes: Test sets view

Layer / File(s) Summary
List data and test-set metadata
web/packages/agenta-entities/src/testset/core/schema.ts, web/packages/agenta-entities/tests/unit/*, web/mobile/src/features/testsets/list/testsetRowTypes.ts, web/mobile/src/features/testsets/list/useTestsetsList.ts, web/mobile/src/features/testsets/list/useTestsetsSearch.ts, web/mobile/src/features/testsets/list/commitMessage.ts, web/mobile/src/features/testsets/list/formatTestsetDate.ts, web/mobile/src/features/testsets/list/useTestsetCommitMessages.ts, web/mobile/tests/unit/testsetsList.test.ts, web/mobile/tests/unit/testsetCommitMessage.test.ts
The test-set schema includes shared audit fields. New hooks support paginated, name-filtered lists and debounced URL search. Commit-message helpers filter system-generated messages and load latest revision messages for listed test sets.
Row actions and table
web/mobile/src/features/testsets/list/useTestsetRowActions.ts, web/mobile/src/features/testsets/list/TestsetRowCells.tsx, web/mobile/src/features/testsets/list/TestsetRowMenu.tsx, web/mobile/src/features/testsets/list/TestsetsTable.tsx, web/mobile/src/features/testsets/list/states/*, web/mobile/tests/unit/testsetRowActions.test.ts, web/mobile/tests/unit/testsetsTable.render.test.tsx, web/storybook/stories/developer-views/TestsetsList.stories.tsx
Row actions support opening, exporting, and archiving test sets, with per-row busy state and archive checks. The responsive table renders permission-based actions, archive confirmation, pagination, and empty states. Tests and stories cover these behaviors and table states.
Screen and developer route
web/mobile/src/features/developer/developerViews.ts, web/mobile/src/features/testsets/list/TestsetsListScreen.tsx, web/mobile/src/pages/w/[workspace_id]/p/[project_id]/testsets/index.tsx, web/mobile/tests/unit/testsetsListScreen.render.test.tsx
The developer navigation and gated route expose the test-set screen. The screen connects project context, list and search hooks, commit messages, permissions, and row actions. Rendering tests cover route visibility, search synchronization, loading errors, empty states, and create-action permissions.

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

Sequence Diagram(s)

sequenceDiagram
  participant TestsetsPage
  participant DeveloperViewGate
  participant TestsetsListScreen
  participant useTestsetsList
  participant useTestsetCommitMessages
  participant TestsetsTable
  TestsetsPage->>DeveloperViewGate: Render the testsets view
  DeveloperViewGate->>TestsetsListScreen: Render with workspace and project IDs
  TestsetsListScreen->>useTestsetsList: Load rows for the project and search term
  TestsetsListScreen->>useTestsetCommitMessages: Load latest revision messages for row IDs
  TestsetsListScreen->>TestsetsTable: Render rows and action callbacks
Loading
Merge Risk: Low · previous review 2604f

The view remains hidden, and the established issue is limited to comment style. It is mergeable with that cleanup tracked.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: a Test sets list added to /m as a developer view behind the staged developer view switch. The changeset adds the testsets list screen, table, row menu, hooks, page rou…
Description check Passed The description matches the changeset. It explains the hidden 'testsets' developer view, the list columns and pagination, the ?q= search, the row menu and permission rules, the audit-field schema chan…
Docstring Coverage Passed Docstring coverage is 66.67% 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. Documentati…
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 main change: a Test sets list added to /m as a developer view behind the staged developer view switch. The changeset adds the testsets list screen, table, row menu, hooks, page route, and the hidden developer view entry, which matches the title. The title is specific and concise, and it fits the changeset.

Full details: Description check

Explanation

The description matches the changeset. It explains the hidden 'testsets' developer view, the list columns and pagination, the ?q= search, the row menu and permission rules, the audit-field schema change, and the bug fixes. It also lists the tests, the QA steps, and the open items, so it is related to the changes and not off-topic.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% 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 3 functions across 23 files.

  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

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

Nitpick comments: 1
web/mobile/src/features/testsets/list/useTestsetRowActions.ts: 1

33-39: Trivial · Maintainability & Code Quality · Quick win

Shorten multi-line comments to one line.

The frontend conventions set a hard limit of one short line per in-code comment. This block and the one at Lines 46-47 narrate the reasoning in several lines of prose.

The same pattern appears in other files of this PR:

  • useTestsetsSearch.ts: the JSDoc at Lines 7-12.
  • useTestsetCommitMessages.ts: the JSDoc at Lines 13-19.
  • TestsetsListScreen.tsx: the comments at Lines 27-33 and 50-51.
  • TestsetRowCells.tsx: the comment at Lines 55-56.

Cut each comment to one line. Keep a longer comment only when it documents a surprising constraint, such as a race or an ordering requirement. The guarded ref-versus-state split may qualify, but limit it to one or two sentences.

As per coding guidelines: "Hard rule. At most ONE short line per comment. No multi-line blocks narrating why in prose".

Also applies to: 46-47

Source: Coding guidelines


Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between c9bd4a2 and 2604fc3.

Files selected for processing: 23
  • web/mobile/src/features/developer/developerViews.ts
  • web/mobile/src/features/testsets/list/TestsetRowCells.tsx
  • web/mobile/src/features/testsets/list/TestsetRowMenu.tsx
  • web/mobile/src/features/testsets/list/TestsetsListScreen.tsx
  • web/mobile/src/features/testsets/list/TestsetsTable.tsx
  • web/mobile/src/features/testsets/list/commitMessage.ts
  • web/mobile/src/features/testsets/list/formatTestsetDate.ts
  • web/mobile/src/features/testsets/list/states/TestsetsEmpty.tsx
  • web/mobile/src/features/testsets/list/states/TestsetsNoMatch.tsx
  • web/mobile/src/features/testsets/list/testsetRowTypes.ts
  • web/mobile/src/features/testsets/list/useTestsetCommitMessages.ts
  • web/mobile/src/features/testsets/list/useTestsetRowActions.ts
  • web/mobile/src/features/testsets/list/useTestsetsList.ts
  • web/mobile/src/features/testsets/list/useTestsetsSearch.ts
  • web/mobile/src/pages/w/[workspace_id]/p/[project_id]/testsets/index.tsx
  • web/mobile/tests/unit/testsetCommitMessage.test.ts
  • web/mobile/tests/unit/testsetRowActions.test.ts
  • web/mobile/tests/unit/testsetsList.test.ts
  • web/mobile/tests/unit/testsetsListScreen.render.test.tsx
  • web/mobile/tests/unit/testsetsTable.render.test.tsx
  • web/packages/agenta-entities/src/testset/core/schema.ts
  • web/packages/agenta-entities/tests/unit/testset-schema-author.test.ts
  • web/storybook/stories/developer-views/TestsetsList.stories.tsx

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

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

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

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 release/v0.128.3 to release/v0.128.4 November 3, 2026 09:12
@mmabrouk
mmabrouk force-pushed the feat/m-view-testsets branch from 2604fc3 to 653bc36 Compare November 3, 2026 09:19
@mmabrouk
mmabrouk merged commit cbff6b5 into release/v0.128.4 Nov 3, 2026
28 of 32 checks passed
@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Website preview

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

Built from 653bc36ae0dee2990b0973c54d12284e06850032. This comment updates in place on every push.

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