feat(desktop): let users dismiss the new-workspace sample prompts

Merged
KI
3mo ago
+72-26

Summary

  • Adds a hover-reveal ✕ to the sample-prompt suggestions on the new-workspace screen (both experiment arms — cards tray and rows). Dismissing hides them permanently; the rotating ghost-text placeholder remains as the suggestion surface.

Why / Context

Follow-up to #6537. The template cards target cold-start users, but they render for every user on every empty composer, forever — Codex, by comparison, only shows its template cards until you have task history. Power users get a way to clear them; the analytics keep measuring whether veterans use them at all.

How It Works

  • samplePromptsDismissed boolean on the existing v2-workspace-create-defaults persisted store (already allowlisted in the persisted-key registry; fixed-size singleton, zustand persist shallow-merges the new field to false for existing profiles — no version bump).
  • NewWorkspaceScreen gates the suggestion block on the flag and passes onDismiss to both layouts; dismissal fires new_workspace_sample_prompts_dismissed with the active layout so the cards-vs-rows experiment can account for lost exposure.
  • The ✕ is opacity-0 until container hover (or keyboard focus), so it adds no visual noise.

Manual QA Checklist

Verified live via CDP against the dev desktop:

  • ✕ appears on hover at the tray's top-right, hidden otherwise
  • Clicking it removes the suggestions; composer + ghost text unaffected
  • samplePromptsDismissed: true lands in the persisted store
  • Suggestions stay gone after location.reload()
  • Persisted-key registry tests pass (no unregistered writer)

Testing

  • bun run typecheck
  • biome check on touched files
  • bun test src/renderer/lib/persisted-keys

Known Limitations

  • No un-dismiss UI yet — deliberate until the dismissal-rate data says whether anyone wants them back (a Settings → Behavior toggle is the natural home if so).

Summary by cubic

Let users dismiss sample prompt suggestions on the new-workspace screen. Previously they showed on every empty composer; now a hover-reveal X hides them permanently while the rotating ghost-text placeholder remains. The sample-card container is removed so cards float directly on the canvas.

Review notes

  • Persist samplePromptsDismissed in v2-workspace-create-defaults (default false; shallow-merged for existing profiles). No migration.
  • Gate suggestions on this flag in both layouts; pass onDismiss through SamplePromptCards and SamplePrompts; show the close button on hover/focus only.
  • Track new_workspace_sample_prompts_dismissed with the active layout to account for lost exposure.

Summary by CodeRabbit

  • New Features
    • Added the ability to dismiss sample prompt suggestions when creating a workspace.
    • Dismissal preferences are saved and persist across sessions.
    • Added accessible dismiss controls that appear on hover or keyboard focus.
    • Sample prompts now hide after dismissal and only appear when relevant.