feat(desktop): new-workspace screen experiment with sample prompts

Merged
SA
3mo ago
+1265-6

Links

Summary

  • Test arm for the new-workspace-screen experiment: a page-based create surface for new users — Superset mark, "What should we build next?", three clickable sample prompts, and a decluttered composer — replacing the ~20-control modal. Control arm renders the existing modal, byte-identical.
  • Targets the worst step in the activation funnel: dashboard → first real workspace converts at 38% today (49% in March); ~54% of new users who reach the dashboard never create anything.

Why / Context

Sample prompts + reduced clutter at the exact moment new users stall ("what do I type?"). Primary metric: workspace_created (type != main) funnel from exposure; guardrails: agent_session_launch and 1–7d return retention, so a creation lift must be backed by real engagement.

How It Works

  • Arms: useNewWorkspaceScreenVariant gates on account age (NEW_WORKSPACE_SCREEN_EXPERIMENT_START), waits for PostHog flags to load before evaluating (avoids the undefined-flag race that would cross-contaminate brand-new users), and falls back to control-without-exposure after 2s offline. The new-workspace-screen-override flag short-circuits to the test UI with zero experiment exposure (team/dev access).
  • Test arm is a route (/new-workspace): store opens ("+", ⌘N, onboarding hand-off) redirect there; an empty dashboard renders the screen pinned as its zero state, replacing "No workspaces yet". TopBar hides under the same expanded-sidebar condition as the v2 workspace route (page brings its own drag strip).
  • Screen: purpose-built (NewWorkspaceScreen), reusing only non-visual plumbing (useSubmitWorkspace, draft store, pickers). Enter submits / Shift+Enter newlines (opt-in onEnterSubmit on MarkdownEditor), empty submit blocked, sample click fills + focuses the editor, suggestions animate out while typing.
  • Attachments: page-wide drop zone with animated "Drop to attach" overlay (dragover-heartbeat, self-healing), Codex-style cards — square image thumbnails with lightbox (download via new external.saveToDownloads), file cards with file-tree extension icons + reveal-in-Finder. Linked Linear/GitHub issue and PR parity with the modal (pills + link buttons + "based off PR #n").

Manual QA Checklist

Verified live over CDP against the dev stack (real mouse/keyboard input, screenshots captured):

  • Screen renders on /new-workspace with sidebar visible; no TopBar strip with expanded sidebar
  • Sample prompt click fills editor, hides suggestions, enables submit, focuses caret at end
  • Clear restores suggestions; Enter on empty does nothing
  • Typed prompt + Enter → workspace created, worktree provisioned, Claude launched with the prompt and responded (primary metric + guardrail path end-to-end)
  • 6× rapid nav bounce: exactly one screen instance, no exceptions
  • Draft text persists across navigation
  • Control modal unchanged (PromptGroup/ModalContent have zero diff)
  • Onboarding hand-off on a fresh account lands on /new-workspace with the new project pre-selected (needs a fresh-signup run)
  • Drag-drop overlay + image lightbox + reveal-in-Finder spot-check in packaged build

Testing

  • bun run typecheck
  • bun run lint
  • CDP-driven E2E in dev (above); one pre-existing console error observed (DockBadgeController setState-in-render from sidebar items — unrelated, tracked separately)

Design Decisions

  • Duplicate screen vs. layout-prop on PromptGroup: separate component so arms evolve independently and control stays pristine; only battle-tested plumbing is shared.
  • Code-gated eligibility vs. flag targeting: no signup-date person property exists, and identify/ingest races make flag-side date conditions unreliable for brand-new users; the code gate + surface-scoped evaluation keeps exposure exactly equal to the experiment population.
  • Test arm can't create promptless workspaces (control can): intentional treatment difference that biases against the test arm on the primary metric — a win is a conservative win.

Deployment / Rollout

  • Ships dark: experiment 387127 is a draft, so the flag serves nothing; only @superset.sh accounts see the screen (override flag, already live).
  • Before launching the experiment: bump NEW_WORKSPACE_SCREEN_EXPERIMENT_START to the release date, then launch in PostHog. New signups install the current build, so ramp is immediate.
  • Do not touch flag rollout/variants/prompts/cutoff mid-experiment.

Rollback

  • Kill the test UI instantly by setting the experiment flag to serve control 100% (or stopping the experiment); code paths degrade to the existing modal with no data impact.

https://claude.ai/code/session_01SfU6AHAcHwrjwXwUFUDth5


Summary by cubic

Adds an experiment arm that replaces the dense “New workspace” modal with a full‑screen create page and sample prompts to help new users start faster. Control is unchanged.

  • New Features

    • New route: “/new-workspace”. Store opens redirect here in the test arm; the empty dashboard pins this screen only when isReady, there are zero workspaces, and default filters are active (prevents transient flashes and respects filtered views).
    • Composer: sample prompts insert full, actionable instructions with docs links (e.g., .superset/config.json setup). Enter submits; Shift+Enter adds a newline. Empty submit is blocked.
    • Attachments: page‑wide drag/drop overlay, compact attachment cards, image lightbox with “Save to Downloads” via external.saveToDownloads, and reveal-in-Finder.
    • Experiment gating: NEW_WORKSPACE_SCREEN with eligibility from NEW_WORKSPACE_SCREEN_EXPERIMENT_START. Evaluated only when the surface opens, after flags load, with a 2s offline fallback to control; NEW_WORKSPACE_SCREEN_OVERRIDE forces the screen without exposure.
    • Editor: MarkdownEditor now supports onEnterSubmit.
    • UI polish: hides TopBar on the new screen and adds a window drag strip.
  • Bug Fixes

    • Preselected project is applied once per mount to avoid snapping the picker back to the projectId URL param while editing.
    • Pinned empty state respects the default device filter (“This device”) so filtered‑to‑empty views keep the normal empty state.
    • Reveal-in-Finder avoids wrong-file opens by poisoning ambiguous same‑name attachments in the source path map.

Summary by CodeRabbit

  • New Features
    • Added a full-screen authenticated new workspace experience at /new-workspace, including project preselection, prompt/configuration, and attachment cards.
    • Added sample prompts to quickly start the creation flow.
    • Added image preview with an in-app download to the system downloads folder, including safe filename handling and collision avoidance.
  • Improvements
    • Enabled Enter-to-submit in the new workspace markdown editor.
    • Rolled out the experience behind an experiment, with an optional override, and updated dashboard routing/empty-state behavior accordingly.