[OPIK-6761] [FE] feat: rework Optimization runs empty state to match Figma#7025
Conversation
…ion cards (OPIK-6761) Replace the two-card Optimization runs empty state with the three-card Figma design: "Run a demo example", "Use the Optimization Studio", and a new "Optimize via SDK" card. Each card maps to an existing entry point: - Run a demo example -> Studio wizard pre-filled with the opik-chatbot template - Use the Optimization Studio -> blank Studio wizard - Optimize via SDK -> AddOptimizationDialog (SDK starter code) Consolidate the studio navigation into a single navigateToStudio() helper mirroring StudioTemplates, align card layout/typography/icon colors to the design tokens, and rename the prop onOptimizeClick -> onOptimizeViaSdkClick. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| <button | ||
| type="button" | ||
| onClick={onOptimizeClick} | ||
| className="flex items-start gap-3 rounded-md border p-4 text-left transition-colors hover:border-primary hover:bg-primary-100" | ||
| onClick={() => navigateToStudio("opik-chatbot")} | ||
| className="flex flex-col gap-1 rounded-md border p-4 text-left transition-colors hover:border-primary hover:bg-primary-100" | ||
| > | ||
| <SquareDashedMousePointer className="mt-0.5 size-5 shrink-0 text-chart-green" /> | ||
| <div className="flex flex-col gap-0.5"> | ||
| <span className="flex items-center gap-2"> | ||
| <BotMessageSquare className="size-4 shrink-0 text-chart-blue" /> | ||
| <span className="comet-body-s-accented text-foreground"> | ||
| Optimize your prompt | ||
| </span> | ||
| <span className="comet-body-s text-muted-slate"> | ||
| Start from scratch and configure your own optimization setting | ||
| Run a demo example | ||
| </span> | ||
| </div> | ||
| </span> | ||
| <span className="comet-body-xs text-muted-slate"> |
There was a problem hiding this comment.
OptimizationsEmptyState duplicates the CTA card JSX three times; should we extract an ActionCard helper (or map configs) so the shared layout lives in one place?
Want Baz to fix this for you? Activate Fixer
There was a problem hiding this comment.
Commit b34fdf3 addressed this comment by extracting the repeated CTA markup into a reusable ActionCard component and rendering the cards from an actionCards config array. This removes the duplicated JSX and centralizes the shared layout in one place.
|
🔄 Test environment deployment process has started Phase 1: Deploying base version You can monitor the progress here. |
|
✅ Test environment is now available! To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml) Access Information
The deployment has completed successfully and the version has been verified. |
…te (OPIK-6761) Address review feedback: the three CTA cards duplicated identical layout JSX. Extract a single `ActionCard` component driven by an `actionCards` config array so the shared layout lives in one place. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| const navigateToStudio = (templateId?: string) => { | ||
| navigate({ | ||
| to: "/$workspaceName/projects/$projectId/optimizations/new", | ||
| params: { workspaceName, projectId: activeProjectId! }, | ||
| search: { template: "opik-chatbot" }, | ||
| search: templateId ? { template: templateId } : undefined, | ||
| }); | ||
| }; |
There was a problem hiding this comment.
navigateToStudio duplicates handleTemplateClick's routing logic, should we reuse that helper or extract a shared useOptimizationStudioNavigation hook?
Want Baz to fix this for you? Activate Fixer
There was a problem hiding this comment.
Commit ecac02a addressed this comment by extracting the shared navigation logic into useNavigateToOptimizationStudio and using it from both OptimizationsEmptyState and StudioTemplates. This removes the duplicated routing code and centralizes the Optimization Studio navigation path in one hook.
|
🌙 Nightly cleanup: The test environment for this PR ( |
…io hook (OPIK-6761) Address review feedback: OptimizationsEmptyState.navigateToStudio and StudioTemplates.handleTemplateClick duplicated the same project-scoped /optimizations/new routing. Extract a shared useNavigateToOptimizationStudio hook and use it in both, so the routing lives in one place. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…Figma (#7025) * feat(optimizations): rework empty state to match Figma with three action cards (OPIK-6761) Replace the two-card Optimization runs empty state with the three-card Figma design: "Run a demo example", "Use the Optimization Studio", and a new "Optimize via SDK" card. Each card maps to an existing entry point: - Run a demo example -> Studio wizard pre-filled with the opik-chatbot template - Use the Optimization Studio -> blank Studio wizard - Optimize via SDK -> AddOptimizationDialog (SDK starter code) Consolidate the studio navigation into a single navigateToStudio() helper mirroring StudioTemplates, align card layout/typography/icon colors to the design tokens, and rename the prop onOptimizeClick -> onOptimizeViaSdkClick. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor(optimizations): extract ActionCard + config map in empty state (OPIK-6761) Address review feedback: the three CTA cards duplicated identical layout JSX. Extract a single `ActionCard` component driven by an `actionCards` config array so the shared layout lives in one place. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor(optimizations): extract shared useNavigateToOptimizationStudio hook (OPIK-6761) Address review feedback: OptimizationsEmptyState.navigateToStudio and StudioTemplates.handleTemplateClick duplicated the same project-scoped /optimizations/new routing. Extract a shared useNavigateToOptimizationStudio hook and use it in both, so the routing lives in one place. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Details
Reworks the Optimization runs empty state to match the Figma design (OPIK-6761). The previous state had two action cards; the design has three, with refreshed copy, icons, and layout. Frontend-only — no backend, migrations, or
v1changes; the rich empty state remains gated behind theOPTIMIZATION_STUDIO_ENABLEDflag +canUseOptimizationStudiopermission, with thePageEmptyStatefallback untouched.Each card maps to an existing entry point:
opik-chatbottemplate (/optimizations/new?template=opik-chatbot)./optimizations/new).AddOptimizationDialog(SDK starter code:pip install opik-optimizer+ a credential-injected snippet + Colab link).Also: consolidated studio navigation into a single
navigateToStudio()helper mirroringStudioTemplates, aligned card layout/typography/icon colors to the design tokens (comet-*,text-chart-blue|purple|burgundy), and renamed the proponOptimizeClick→onOptimizeViaSdkClickfor clarity.Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
Testing
Commands (from
apps/opik-frontend):npx eslinton both changed files — 0 problemsnpx tsc --noEmit(project-wide) — no errors in the changed filesManual UI (local process mode, Chrome, on an empty project) — temporarily forced the flagged branch to render
OptimizationsEmptyState, then:642-30557) — cards, order, copy, icon colors (blue/purple/burgundy), icon+title-row / description-below layout, "View docs" button, and right-side illustration all match./optimizations/new?template=opik-chatbot; Studio form pre-filled (Name "Opik chatbot optimization", "Demo - Opik Chatbot" dataset, G-Eval metric)./optimizations/new; blank Studio wizard.pip install opik-optimizer+ live SDK snippet + Colab link.Not run: automated component tests — this is a presentational empty state with no existing test coverage for the component; behavior was verified manually end-to-end.
Notes for reviewers:
comet-title-s(18px), consistent with other empty states (PageEmptyState); the Figma token is 16px but the codebase has no 16px title utility.Documentation
N/A — no user-facing docs change.
🤖 Generated with Claude Code