Skip to content

Personalize empty-chat suggestions with site context - #4409

Draft
shaunandrews wants to merge 1 commit into
refine-empty-chat-w-blurfrom
personalize-empty-chat-suggestions
Draft

Personalize empty-chat suggestions with site context#4409
shaunandrews wants to merge 1 commit into
refine-empty-chat-w-blurfrom
personalize-empty-chat-suggestions

Conversation

@shaunandrews

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

AI helped prototype the contextual ranking strategy, implement the scorer and tests, and exercise a local visual matrix. I reviewed the resulting code, removed the temporary visual-fixture switch before committing, and verified the final branch with lint, type checking, unit tests, and a production UI build.

Proposed Changes

  • Make empty-chat suggestions respond to what Studio already knows about the current site, so the starting ideas feel less generic without spending AI quota or waiting on a model call.
  • Promote relevant next steps from the active theme type, prior chats, preview state, connected production/staging sites, sync recency, and the earliest known site activity.
  • Explain why a personalized idea surfaced in its tooltip, while keeping the existing rotating fallback for sites with little context.
  • Let “Build on recent work” carry a short excerpt from the latest opening request into the composer only after the user chooses it.

⚠️ Visual change: please review in light and dark mode.

Review focus

  • Do the contextual suggestions feel useful and appropriately conservative?
  • Are the candidate set, category cap, and ranking weights reasonable for a first local prototype?
  • Are the personalized tooltip explanations helpful, or do they expose more implementation detail than users need?
  • Is including a capped excerpt from a previous chat appropriate when the user explicitly chooses “Build on recent work”?

Safety and trade-offs

  • This is a read-only ranking layer: it does not persist new data, mutate a site, publish/sync automatically, or add migrations.
  • It makes no model request and consumes no AI quota.
  • Previous-chat text is capped at 180 characters and enters the draft only after a click. Names and URLs from other connected sites are not included.
  • Studio does not currently persist the local site's creation time, so “site age” uses the earliest known chat, connection, or preview timestamp as a proxy.
  • Theme context depends on cached theme details, and previous-chat category inference is intentionally lightweight and language-sensitive.
  • Content inventory such as pages/posts and model-based reranking are deliberately left out of this prototype.

Testing Instructions

  1. Start from Refine empty-chat suggestions and W interactions #4408, open a new empty chat for a local site, and confirm seven suggestions appear.
  2. Compare a site with previous chats, a block-theme site, a classic-theme site, a site with a preview, and a connected site. Confirm the leading contextual idea changes without losing category variety.
  3. Hover contextual ideas and confirm the tooltip explains the relevant signal.
  4. Choose “Build on recent work” and confirm the composer receives the contextual request only after the click.
  5. Confirm the existing transfer animation, reduced-motion behavior, reduced-transparency behavior, light mode, and dark mode remain intact.

Validated locally:

  • npx eslint --fix on all modified TypeScript files
  • npm run typecheck
  • npm test -- apps/ui/src/ui-classic/components/session-view/suggested-prompts/prompts.test.ts apps/ui/src/ui-classic/components/session-view/suggested-prompts/index.test.tsx apps/ui/src/ui-classic/components/session-view/session-chat-actions.test.tsx (28 tests)
  • npm run cli:build:ui
  • Browser console: no warnings or errors in the isolated preview

Visual matrix

New block-theme site

New block-theme site suggestions

Expired preview

Expired preview suggestions

Established connected classic-theme site

Established connected site suggestions

Returning site with previous chat history

Returning site suggestions

Cursor reaction through the suggestion layer

WordPress mark reacting while the pointer is over a suggestion

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant