You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(frontend): Test sets list in /m behind the developer view switch - #8002
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".
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 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.
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: 5
Check name
Status
Explanation
Title check
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
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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".
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
testsetsinDEVELOPER_VIEWS(stagehidden, label "Test sets"). Route/w/[workspace_id]/p/[project_id]/testsets, wrapped inDeveloperViewGate.?q=.edit_testsets. Export keeps the old page rule (view_api_keysandedit_api_keys).@agenta/entitiestestset schema now reads the audit fields, so the list can show "Created by".Bugs in the old page, fixed here (each has a test)
edit_testsets. They are now hidden.New user-facing text (needs Mahmoud's approval)
Tests
pnpm --filter @agenta/mobile types:checkandpnpm --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 ismembersTabRoleChange.render.test.tsx, which also fails onrelease/v0.128.3(it throws inauthEnv).agentPermissions.render.test.tsx, the other known failure, also fails on the release branch and passed in this run.testsetsList,testsetRowActions,testsetCommitMessage,testsetsListScreen.render,testsetsTable.render, and a schema test in@agenta/entities. Storybook stories for the list are in@agenta/mobile/Developer.package.jsonchange. Nothing in_app,AppProviders,GlobalDrawersor the app shell imports the view. No link prefetches the page.Open problems
What to QA
Not reachable yet. To try it, set
AGENTA_DEVELOPER_VIEWS=testsetson the web container and open/m/w/<workspace>/p/<project>/testsets. Once the stage ispreview, switch it on in Settings > Preferences.?q=, the list filters, and a reload keeps the search. Open the page in a new tab without?q=: the list is not filtered.edit_testsets: Archive is not in the menu.