feat(desktop): richer new-workspace templates + labeled model/effort pills

Merged
KI
3mo ago
+176-38

Summary

  • The composer's model and effort selects both rendered a bare "Default" — two identical, indistinguishable pills. AgentModelSelect now takes a defaultLabel prop and the create surfaces pass "Default model" / "Default effort".
  • The create screen's empty state gets livelier: the sample-prompt pool grows from 3 to 6 (agent-docs audit, missing-tests, TODO cleanup), the cards experiment arm shows 4 in a 2×2 grid (rows arm capped at 4), and the composer placeholder rotates through 8 ghost-text suggestions, one per open.

Why / Context

From a Mobbin pass over competitor create surfaces (Cursor Cloud Agents, Codex, Claude Code web): every one of them names the model in the select trigger, seeds the empty state with rotating prompt suggestions, and offers more than two outcome templates. These were the two cheapest gaps to close; the bigger finding (multi-agent fan-out) is deliberately not in this PR.

How It Works

  • AgentModelSelect gets an optional defaultLabel (default "Default", so other future callers are unaffected); it's used for both the trigger placeholder and the default item. Applied at both call sites — NewWorkspaceScreen and the control modal's PromptGroup.
  • New prompts live in the existing SAMPLE_PROMPTS pool; the cards arm slices 4 (setup card still leads only when the project needs setup), the rows arm slices 4.
  • PROMPT_PLACEHOLDERS ghost text is picked per open, keyed on the draft resetKey: the tiptap Placeholder extension freezes its text at editor mount, so rotation rides the same remount the prompt-insertion path already uses.

Manual QA Checklist

Verified live via CDP against the dev desktop:

  • Pills read "Default model" / "Default effort"; dropdowns open and list the named default first
  • 4 sample cards render (2×2) with correct icons; clicking inserts the full prompt
  • Placeholder differs across app opens (observed two different suggestions on consecutive boots)
  • Cards still hide once the prompt is non-empty; submit flow unchanged
  • No renderer console errors

Testing

  • bun run typecheck
  • biome check on touched dirs
  • bun test on touched dirs (PromptGroup util tests pass)

Known Limitations

  • Placeholder rotates per open, not on a timer — a live timer would either remount the editor under the user's cursor or need a tiptap Placeholder rework.

Summary by cubic

Clarifies model/effort selects and makes the new‑workspace empty state dynamic. Previously both pills read “Default” and the empty state was static; now pills read “Default model”/“Default effort”, the template pool expands and shuffles, cards render as a 2×2 tray (setup leads only when needed), and the composer placeholder rotates per open.

  • AgentModelSelect adds a defaultLabel prop (defaults to "Default"); NewWorkspaceScreen and the control modal PromptGroup pass "Default model"/"Default effort". Other callers are unaffected.
  • Sample prompts grow from 3 to 6 (adds agent‑docs audit, missing tests, TODO cleanup). The pool shuffles once per mount; the card layout shows 4 in a rounded tray with the setup card only if the project needs it; the row layout shows 4 from the same shuffled pool.
  • The agent‑docs card shows Claude+Codex logos when available (falls back to a generic icon).
  • The composer placeholder picks one of 8 suggestions on modal open or draft reset and stays fixed after mount.
  • Submit flow and card‑hiding behavior are unchanged. No migration required.

Summary by CodeRabbit

  • New Features
    • Added sample prompts for improving instructions, adding tests, resolving TODOs, and fixing bugs.
    • Expanded sample prompts to four shuffled cards with refreshed icons, layout, and hover styling.
    • Added rotating placeholder suggestions when starting or resetting a new workspace.
    • Added clearer default labels for model and effort selections.
    • Limited the sample prompt display to four cards for a more focused experience.