feat(a2ui-playground): add per-conversation share button#549
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to share conversations by generating and copying a shareable link. It adds a 'Share' button to the conversation list and implements the sharing logic in AIChatPage, which retrieves or publishes the conversation payload. Additionally, payload publishing utilities are refactored into a shared publishPayload.ts file. Feedback is provided to optimize the search for the latest published message in AIChatPage by using a reverse loop instead of copying and reversing the entire messages array.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Each conversation in the Create page now has a Share action that copies a durable, Supabase-backed render link for the conversation's generated UI to the clipboard — mirroring PreviewPanel's existing "Copy render URL". The link is resolved from the previewPayloadUrls already persisted on the conversation snapshot (published to Supabase at generation time); a conversation without a stored URL publishes its A2UI messages on demand via POST /a2ui/payload. Extracts DemosPage's payload-publish helper into utils/publishPayload.ts and reuses it in both DemosPage and AIChatPage.
a934e5d to
33b4f0a
Compare
What
Adds a Share action to every conversation in the GenUI playground's Create page. Clicking it copies a durable, Supabase-backed
render.htmllink for that conversation's generated UI to the clipboard, with the existing copy toast — the same artifactPreviewPanelalready produces via "Copy render URL", now available per conversation from the list.Why
Conversations could be renamed and deleted, but not shared. The server already publishes each turn's A2UI payload to Supabase Storage (lynx-family#2743) and the playground persists the resulting
previewPayloadUrlson each conversation snapshot, so a durable shareable link is essentially already available — it just wasn't surfaced.How it works
handleShareConversation(id)resolves a durablemessagesUrlwith minimal work:previewPayloadUrlspersisted on the conversation snapshot (or the most recent message that has them).POST /a2ui/payload.buildRenderUrl()then turns themessagesUrlinto the shareable link, which is copied to the clipboard.Changes
src/utils/publishPayload.ts— shared client→Supabase publish helper (publishA2UIPayload), extracted fromDemosPage.ConversationListPanel.tsx— newonShareprop + a Share pill (reuses the existingconversationIconButtonstyling; no new CSS).AIChatPage.tsx—handleShareConversation+ wiring; reuses in-scopebuildRenderUrl,copyToClipboard, and the existing copy toast.DemosPage.tsx— refactored to import the shared helper (dropped its local duplicates).Testing
dprint checkpasses on all changed files.pnpm --filter a2ui-playground dev(with the genui server reachable) → generate a UI in a conversation → Share → "Copy succeeded" toast + arender.html?…messagesUrl=…link that renders the surface when opened.Notes for reviewers
tsctypecheck wasn't run in this environment (worktree withoutnode_modules; the playground builds via rsbuild/SWC, not atscgate). Verified via dprint + manual type review.node_moduleswasn't available in the worktree; dprint formatting was validated manually instead.