Skip to content

feat(react-ui): native prefill-chips welcome screen - #831

Merged
ankit-thesys merged 11 commits into
mainfrom
ankit/welcome-prefill-chips
Jul 23, 2026
Merged

feat(react-ui): native prefill-chips welcome screen#831
ankit-thesys merged 11 commits into
mainfrom
ankit/welcome-prefill-chips

Conversation

@ankit-thesys

Copy link
Copy Markdown
Contributor

What

Ports the prefill-chips welcome UX from genui-sdk's agent-workspace example (genui-sdk PR #112) into react-ui's props-mode WelcomeScreen, so consumers get it natively instead of forking the composer via Welcome Mode C.

  • WelcomeScreen gains prefillChips?: PrefillChip[] (new exported type — the only public-API additions). Chip click prefills the welcome composer and swaps in the chip's contextual starters, which append to the draft. Without chips, markup is byte-identical to before (SSR-tested).
  • Internally: DesktopWelcomeComposer is now optionally controlled (the draft was private state — the reason the example had to fork it), and ConversationStarter accepts an onSelect override. Neither component is publicly exported.
  • Chips-mode draft resets on thread switch (the welcome renders unkeyed, so a chip-prefilled draft would otherwise leak into the next empty thread).
  • New welcomePrefillChips.scss (cssUtils tokens, BEM, no Tailwind) + scoped container tweaks in welcomeScreen.scss.
  • Storybook: WelcomeWithPrefillChips story.
  • openui-cloud example: adds the Welcome slot with chips (the example previously rendered no welcome at all); also makes the Cloud base URLs env-driven (OPENUI_CLOUD_BASE_URL / NEXT_PUBLIC_OPENUI_CLOUD_BASE_URL) for local-stack testing.

Testing

  • pnpm --filter @openuidev/react-ui run ci (eslint + prettier + vitest 27/27) green; also tsc --noEmit, tsc -p tsconfig.test.json --noEmit, full build incl. check:css.
  • SSR tests pin chips markup, the controlled composer, and the no-chips back-compat guarantee (byte-identical DOM).
  • Storybook interaction QA (browser-driven): prefill + caret-to-end + focus, contextual append with single-space separator, clear-restores-chips, manual-typing fade (data-drafting), send flow, and the legacy WithWelcome story unchanged.
  • Live run against prod OpenUI Cloud: chip → prefill → contextual append → send streamed thesys_generate_slides and rendered the slides artifact; mobile fallback (chips desktop-only, root starters retained) and dark theme verified.
  • Interaction unit tests are deferred on purpose: the repo has no DOM test env yet; a jsdom + @testing-library follow-up lands after this merges.

Follow-up (separate repo): simplify genui-sdk's agent-workspace example to use the native prop once react-ui publishes.

🤖 Generated with Claude Code

ankit-thesys and others added 10 commits July 23, 2026 13:23
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Controlled iff value !== undefined; drafting override + external textarea
ref so the prefill-chips welcome can own the draft.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nent

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Chips mode lifts the draft into WelcomeScreen and drives the controlled
composer; without chips the markup is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…i-cloud

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dot-access NEXT_PUBLIC env read (Next inlining), reset chip draft on
thread switch, index-suffixed chip keys, docstring precision.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ankit-thesys
ankit-thesys requested a review from abhithesys July 23, 2026 13:55
* chip drops its prompt into the composer (instead of sending) and shows the
* chip's contextual starters, which append to the draft.
*/
prefillChips?: PrefillChip[];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name suggestion. for this prop,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #836 — renamed to promptTemplates / PromptTemplate, with the nested starters becoming completions. Landed pre-release so nothing breaks.

@ankit-thesys
ankit-thesys enabled auto-merge (squash) July 23, 2026 14:35

@i-subham23 i-subham23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L. G.

@ankit-thesys
ankit-thesys merged commit 780bc97 into main Jul 23, 2026
2 checks passed
@ankit-thesys
ankit-thesys deleted the ankit/welcome-prefill-chips branch July 23, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants