Skip to content

feat(examples): add selection-capture vanilla example (SD-2929)#3138

Open
caio-pizzol wants to merge 1 commit intomainfrom
caio/sd-2929-selection-capture-example
Open

feat(examples): add selection-capture vanilla example (SD-2929)#3138
caio-pizzol wants to merge 1 commit intomainfrom
caio/sd-2929-selection-capture-example

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

The smallest example that proves why ui.selection.capture() exists. Single file, no framework: select text, click Add, type a comment, post. The capture survives the textarea stealing focus, so the new comment anchors against the original selection.

Linked from the Custom UI > Comments and Selection and viewport docs pages. The example deliberately does nothing else: no threading, no resolve / reopen / reply, no toolbar, no mode toggle. The full Custom UI sidebar is in demos/custom-ui.

Verified: pnpm install; pnpm --filter superdoc build; pnpm exec tsc --noEmit clean; pnpm dev boots on http://localhost:5173/ and the editor + sidebar render.

@linear
Copy link
Copy Markdown

linear Bot commented May 5, 2026

@caio-pizzol caio-pizzol marked this pull request as ready for review May 5, 2026 00:22
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 5, 2026 00:22
@caio-pizzol caio-pizzol force-pushed the caio/sd-2929-selection-capture-example branch from 9364e23 to ac32e9a Compare May 5, 2026 00:24
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Smallest example that proves why ui.selection.capture() exists. Single
file, no framework. Shows the capture-at-composer-open then
createFromCapture-at-submit flow that survives the textarea stealing
focus from the editor.

Linked from the Custom UI > Comments and Selection-and-viewport docs
pages.
@caio-pizzol caio-pizzol force-pushed the caio/sd-2929-selection-capture-example branch from ac32e9a to 4b4d748 Compare May 5, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants