Repository navigation
docs(examples): build the poll recipe on the composer preview set - #3374
Conversation
The poll card is now a `poll` item in the MessageComposerPreviews set instead of a wrapper around MessageComposerUI, and the Create poll dialog keeps its form: only its footer is replaced, through the PollCreationDialogControls slot. installPollWithText removes the poll-only middleware by its exported id and leaves retainCompositionOnSubmit at its default, which empties the composer once that middleware is gone.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Size Change: -800 B (-0.09%) Total Size: 911 kB π¦ View Changed
βΉοΈ View Unchanged
|
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3374 +/- ##
=======================================
Coverage 88.94% 88.94%
=======================================
Files 571 571
Lines 17293 17293
Branches 5287 5287
=======================================
Hits 15382 15382
Misses 1911 1911 β View full report in Codecov by Harness. π New features to boost your workflow:
|
A message sent from the composer while the poll was still being created went out without it. The dialog now closes after createPoll() settles, and Add to message is disabled meanwhile. The migration guide's example gets the same order.
β¦reated Cancel is disabled while the poll is being created, since the poll would still be attached after it. The migration guide's example gets the same guard on both buttons.
|
π This PR is included in version 15.0.0-rc.4 π The release is available on: Your semantic-release bot π¦π |
|
π This PR is included in version 15.0.0 π The release is available on: Your semantic-release bot π¦π |
Ticket: https://linear.app/stream/issue/REACT-1441
π― Goal
Build the UI Cookbook's "Poll with text and attachments" recipe on the API from #3365, so it matches its docs page (GetStream/getstream.io, branch
v15-review-3).π Implementation details
AddPollDialogis gone.AttachPollControlsreplaces only the dialog's footer through thePollCreationDialogControlskey, so the default form (question, options, settings) stays. Add to message closes the dialog, focuses the composer and callsmessageComposer.createPoll()without sending.pollitem in theMessageComposerPreviewsset, right afterquotedMessage, visible whilepollIdis set and no message is being edited. The wrapper aroundMessageComposerUIand its CSS are gone, and so is the card's outer margin.installPollWithTextremoves the poll-only middleware byPOLL_ONLY_COMPOSITION_MIDDLEWARE_IDand puts back one made withcreatePollOnlyCompositionMiddleware()on cleanup. It no longer setsretainCompositionOnSubmit: the default empties the composer once the poll-only middleware is gone.shots.jsonclips the composer screenshot to.str-chat__message-composer.π¨ UI Changes
The poll card now sits in the composer's own preview area, above the attachments. Screenshots are retaken on the docs branch. The dialog footer couldn't be opened in the cookbook, since polls are off in the demo app; it's covered by the type check.
Checks: eslint, prettier, cookbook
buildandcheck:csspass.Summary by CodeRabbit