-
[OPIK-6307] [FE] feat: redesign Run experiment flow in Prompt Playground (#6571)
发布于
2026-05-06 13:25:04 +00:00 - [OPIK-6307] [FE] feat: redesign Run experiment flow in Prompt Playground
- Replace "Test on" dropdown with single "Run experiment" entry-point button
- Rebuild dialog with Dataset / Test suite segmented control + smart-default
- Empty-state CTA opens AddEditDataset/TestSuite dialog with Figma-matched icon
- Move dataset filter pill out of the dialog onto the header, beside the chip
- Pre-select most-recently-used dataset/test suite per type (persisted)
- Restore per-dataset score selection on re-open (persisted)
- Reset filters when applying a different dataset; remove RunOnDatasetDialog
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] fix: align Run experiment segmented control with Figma
Switch from ToggleGroup ghost variant to Tabs segmented variant so the
Dataset/Test suite control matches the Figma spec — neutral
slate-300/40 active background and foreground hover, no blue tint.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] style: prettier formatting for TabsTrigger
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] fix: use ToggleGroup ghost for segmented control hover
Match the alert form's Destination selector: ToggleGroup variant="ghost"
gives hover:text-primary-hover (blue text on hover), which the segmented
Tabs variant did not provide.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] fix: address review feedback on RunExperimentDialog
- Normalize composite vs plain dataset id when comparing for filter reset
- Hydrate scores from per-dataset map alongside dataset id (was unused)
- Use canCreateDatasets / canUsePlayground gates instead of canCreateProjects
- Mark defaults applied on manual toggle so smart default does not override
- Refactor hydration into pure resolveSlotForType + idempotent hydrateSlot
helpers, removing the per-type-switch effect
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] fix: drop stale dataset id when list refresh removes it
Add a re-validation effect that clears datasetIdByType[type] when the
underlying list no longer contains the stored id (e.g. deleted server-side
while the dialog was open) so stale selections never reach
useDatasetVersionsList / useDatasetItemsList / onRun.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] feat: add dark variant for empty-dataset-or-suite icon
Rename existing asset to empty-dataset-or-suite-light.svg and add a dark
counterpart following the same palette mapping as other empty-state pairs
(canvas #030712, slate #64748B, lime #CCFE41 unchanged). EmptyDatasetState
now reads the theme via useTheme() and swaps the source.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] chore: explicit React import in EmptyDatasetState
Codebase convention is to import React explicitly when using React.FC;
the file used the type without importing the namespace. Build passes
under jsx:react-jsx but follow the project pattern.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
- [OPIK-6307] [FE] refactor: extract toPlainDatasetId helper
Replace the repeated parseDatasetVersionKey(x)?.datasetId ?? x pattern
with a small helper in datasetVersionStorage.ts. Used in
RunExperimentDialog (resolveSlotForType, stale-list cleanup, dataset
change handler) and PlaygroundHeader (filter-reset comparison and
score persistence) so the storage-key handling stays in sync.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Co-authored-by: Claude Opus 4.7 noreply@anthropic.com
下载附件