Repository navigation
feat(frontend): add a shadcn revision drawer for variants, deployments and evaluators - #7995
Conversation
…s and evaluators Read-only RevisionDrawer in @agenta/entity-ui/variant (props only) with a lazy config pane, a details column, load states, and a /m host that keeps the open revision in ?revisionId=.
|
Caution Review failedThe pull request is closed.
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. |
Website previewPreview URL: https://pr-7995-agenta-website-preview.mahmoud-637.workers.dev Built from |
…e config emptiness check
…orkflow slug loads
|
🤖 The AI agent says: Review loop result for head
The security lens did not run. This change adds no access check, no API call, and no stored data; it reads the same revision queries the app already uses. Fixed: The evaluator "Slug" row now reads the workflow slug ( Left on purpose: The "Type" row keeps the |
Railway Preview Environment
Preview use finished or expired. Environment absence verified; retained storage requires separate provider accounting. Post |
Context
The /m variants, deployments and evaluators views (M5) each need to show one revision when a user clicks a row. In the old app this is a drawer that is really a full playground, built on antd, opened through global atoms. It closes only on clicks on an antd
Layout, its prev/next arrows vanish after the first close, and a deleted revision id opens an empty drawer. /m has no playground for non-agent apps yet, so it needs a smaller, read-only drawer that all three views can share.Changes
This PR adds
RevisionDrawerto@agenta/entity-ui/variant(an existing subpath, so nopackage.jsonchange) and a small /m host for it. It adds no /m page; the variants, deployments and evaluators pages come in later PRs.The API is the contract the three views use. It is props only, with no atom and no context:
What the drawer draws:
Sheet: full screen on phones,min(1100px, 92vw)above. Close with the X ("Close"), Escape, or a click on the overlay.The /m host,
features/revisions/RevisionDrawerHost.tsx, keeps the open revision in the URL as?revisionId=(the old app's name, so old links open here too). It writes with a shallowrouter.replace.Speed. The config pane wraps the whole drill-in editor. The drawer loads it with
React.lazy, so importing@agenta/entity-ui/variantdoes not load it.revisionDrawerLazyConfig.test.tsproves this: it imports the entry and checks that the config section module did not load, then imports the pane and checks that it did. I also checked that the test fails when the drawer imports the pane eagerly. Pages still load the host withnext/dynamicand{ssr: false}and render it only after the first open.One change from the M5 spec. The spec puts the
DrillInUIProvider(the editor slots) in the /m host. I put it inside the lazy config pane instead, with editor slots from@agenta/ui, and a host's own slots still win. Reasons: the drawer then works with props only in every host, and the host does not pull the drill-in barrel into its chunk. The API above does not change.New copy (not in the old app): "This revision is no longer available.", "Could not load this revision", "Previous revision", "Next revision".
Old-app bugs this drawer does not have (each has a test):
Layout.Deferred to M9 and M10, as the spec says: editing, Commit, "Playground", "Test App" / "Test Evaluator", and the create contexts.
Tests
@agenta/entity-ui:revisionDrawer.render.test.tsx(shell, header, states),revisionConfigView.render.test.tsx(view modes, read only, empty),revisionDetails.render.test.tsx(rows per kind; variant revisions never read the evaluator catalog),revisionDrawerLazyConfig.test.ts(speed guard).@agenta/mobile:revisionDrawerHost.render.test.tsx(URL open, close, shallow replace on next).@agenta/mobile/Developer/Revisions/RevisionDrawerwith Variant, Deployment, Evaluator, Loading, NotFound, LoadError and Phone stories. The Variant story's play function clicks next, switches to YAML and presses Escape.@agenta/entity-uitests (1546 passed) and type check,@agenta/mobiletype check, full@agenta/mobiletests (832 passed; the one failure isagentPermissions.render.test.tsx, which also fails on the release branch), eslint on the changed files.Follow-ups
parameters. Code and hook groups show in Form only. This comes from the sharedPlaygroundConfigSectionserializer, which the playground also uses, so it needs a separate change.What to QA
There is no /m page yet. The variants, deployments and evaluators PRs add the pages and their QA.