feat(desktop): show GitHub star pill on the new workspace screen

Merged
AV
3mo ago
+66-26

Summary

  • Show the existing GitHubStarPill on the new full-screen "new workspace" screen (the new-workspace-screen PostHog-flagged variant), under the "What should we build next?" heading.

Why / Context

The new workspace screen is one of the highest-traffic surfaces in the app but had no star nudge, unlike the empty paneless views (EmptyTabView, WorkspaceEmptyState).

How It Works

  • GitHubStarPill already encapsulates the "only show if not starred" behavior via useGithubStarAction() — it hides itself once state === "starred", so no new star-check logic was needed. It's rendered here the same way it is on the two existing empty-state screens.
  • Added an optional surface prop to GitHubStarPill (default "empty_state", preserving existing behavior for the two current callers) so the star_nag_shown / star_nag_starred / star_nag_opened_web analytics events can distinguish this new placement ("new_workspace") from the original ones.

Manual QA Checklist

  • App launches without errors (dev mode)
  • No console errors during Electron main/renderer build
  • Pill hides automatically once starred (existing GitHubStarPill behavior, unchanged)

Testing

  • npx tsc --noEmit -p apps/desktop/tsconfig.json — no new errors introduced by either changed file (pre-existing unrelated errors come from a missing generated routeTree.gen in this worktree)
  • Manual: ran bun run dev:desktop end-to-end; API + Electron renderer + local DB all started cleanly with the new import/component in place

Summary by cubic

Shows the GitHub star pill on the PostHog‑flagged new workspace screen and keeps layout and focus stable when it hides. Differentiates analytics by surface and fixes missed “shown” impressions when the surface changes.

  • Adds optional surface prop (default "empty_state") to GitHubStarPill; tracks star_nag_shown, star_nag_starred, and star_nag_opened_web with this surface; resets the shown‑impression guard per surface and after starring.
  • Adds optional reserveSpace prop (default false) to keep the pill’s wrapper mounted and fade opacity; disables interaction and focus when hidden (pointer-events: none, aria-hidden, inert), preventing re-centering and focus traps; holds space during loading.
  • Renders GitHubStarPill on NewWorkspaceScreen with surface="new_workspace" and reserveSpace; pill still auto‑hides after starring.

Summary by CodeRabbit

  • New Features
    • Added a GitHub star prompt to the new workspace screen.
    • Improved tracking for GitHub star prompt impressions and clicks across different app surfaces.
    • Preserved layout space while the prompt loads or reflects a starred state.