Skip to content

[feat][UX/UI] Hide mapping and preview until a test set is selected#4692

Open
NamHT4Devlop wants to merge 1 commit into
Agenta-AI:mainfrom
NamHT4Devlop:feat/4616-hide-steps-until-testset-selected
Open

[feat][UX/UI] Hide mapping and preview until a test set is selected#4692
NamHT4Devlop wants to merge 1 commit into
Agenta-AI:mainfrom
NamHT4Devlop:feat/4616-hide-steps-until-testset-selected

Conversation

@NamHT4Devlop

@NamHT4Devlop NamHT4Devlop commented Jun 14, 2026

Copy link
Copy Markdown

Summary

Closes #4616

Steps 2–4 of the Add to test set drawer (DataPreviewEditor, MappingSection, PreviewSection) are now hidden until the user either:

  • selects an existing test set revision (selectedRevisionId is truthy), or
  • switches to creating a new test set (isNewTestset === true).

Before this change all three sections rendered immediately on drawer open, showing mapping controls that had no effect until a test set was chosen — which was confusing.

Changes

web/oss/src/components/SharedDrawers/AddToTestsetDrawer/TestsetDrawer.tsx

Wrapped the three lower sections in a single conditional:

{(!!drawer.selectedRevisionId || drawer.isNewTestset) && (
    <>
        <DataPreviewEditor ... />
        <MappingSection ... />
        <PreviewSection ... />
    </>
)}

Demo

Before — Steps 2–4 (data preview, column mapping, row preview) are always visible even with no test set selected, showing empty/unusable controls:

After — Only Step 1 (test set selector) is shown initially. Steps 2–4 appear only once a test set revision is selected or a new test set is being created:

Before vs After: drawer steps hidden until test set selected

How to test

  1. Open the Add to test set drawer from a trace span.
  2. Confirm only the TestsetSelector (step 1) is visible initially.
  3. Select an existing test set — steps 2–4 should appear.
  4. Clear the selection — steps 2–4 should hide again.
  5. Choose + New test set — steps 2–4 should appear.

Type checks

pnpm run types:check in web/oss/ — no new errors introduced (all pre-existing).

…cted

Steps 2–4 (DataPreviewEditor, MappingSection, PreviewSection) are now
conditionally rendered: they only appear once the user has either chosen
an existing test set revision (selectedRevisionId is set) or toggled the
'create new test set' flow (isNewTestset is true).

Before this change the three sections were always visible, which was
confusing because they showed controls that had no effect until a test
set was selected.

Closes Agenta-AI#4616
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 14, 2026
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

@NamHT4Devlop is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

✅ Thanks @NamHT4Devlop! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Jun 14, 2026
@github-actions github-actions Bot closed this Jun 14, 2026
@CLAassistant

CLAassistant commented Jun 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b9212aa-3fbe-43d1-aaca-81226bfb4ea2

📥 Commits

Reviewing files that changed from the base of the PR and between 399602a and 0077874.

📒 Files selected for processing (1)
  • web/oss/src/components/SharedDrawers/AddToTestsetDrawer/TestsetDrawer.tsx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved testset drawer functionality to conditionally display content sections including data preview, mapping, and preview areas. These sections now appear only after a test revision is selected or when creating a new testset, preventing incomplete information from displaying prematurely.

Walkthrough

TestsetDrawer now wraps DataPreviewEditor, MappingSection, and PreviewSection in a conditional that only renders them when drawer.selectedRevisionId is set or drawer.isNewTestset is true, hiding steps 2–4 until a testset is selected or created.

Changes

Conditional rendering of drawer content steps

Layer / File(s) Summary
Gate content steps on testset/revision selection
web/oss/src/components/SharedDrawers/AddToTestsetDrawer/TestsetDrawer.tsx
DataPreviewEditor, MappingSection, and PreviewSection are now wrapped in a condition checking drawer.selectedRevisionId || drawer.isNewTestset, preventing them from rendering before a testset is selected or a new one is being created.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Jun 14, 2026
@github-actions github-actions Bot reopened this Jun 14, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files. UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat][UX/UI] Hide mapping and preview until a test set is selected

3 participants