feat(polls): implement MSC3381 polls#589
Open
Just-Insane wants to merge 8 commits intoSableClient:devfrom
Open
feat(polls): implement MSC3381 polls#589Just-Insane wants to merge 8 commits intoSableClient:devfrom
Just-Insane wants to merge 8 commits intoSableClient:devfrom
Conversation
99b26c1 to
f17ab5a
Compare
- Replace async usePoll hook (race condition → black screen → reload) with synchronous RelationsContainer.getAllChildEventsForEvent() - Rewrite PollEvent to use Attachment/AttachmentHeader/AttachmentBox layout matching Sable design; use folds ProgressBar + RadioButton - Replace toolbar ChartBarHorizontal button with /poll slash command - Add Command.Poll to useCommands enum and autocomplete - Delete usePoll.ts (no longer used) - Pass outlined prop based on message layout (bubble vs default)
…nse/end events from timeline
… prevent form submission
Member
|
is it using the ui you showed in matrix chat or the ui of cinnyapp/cinny#2763 ? |
Contributor
Author
The UI from Cinny |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements Matrix polls (MSC3381) with a creator dialog and timeline renderer.
PollCreatorDialog— question, 2–20 answers, disclosed/undisclosed type, voter visibility toggle (show/hide voter names), poll duration (presets: 1h / 12h / 24h / 48h / 1 week / custom date-time)PollEventtimeline renderer — vote buttons, live/final results bars, expandable voter lists per answer, expiry countdown in footer, auto-expire enforcement, end-poll actionusePollhook — assembles poll state fromorg.matrix.msc3381.poll.start,.poll.response, and.poll.endevents via paginated room timeline; respectsshow_voter_namesandcloses_atfieldsRoomInput, gated byfeatures.pollsinconfig.json(defaultsfalse)Spec: MSC3381
Related upstream issue: cinnyapp/cinny#563
Documentation: SableClient/docs#12
Fixes #
Type of change
Checklist:
AI disclosure:
usePollpaginates the room timeline to collectpoll.responseevents keyed by sender, deduplicating so only the last vote per user counts, and tallies totals and percentages.PollEventrenders the resulting state as vote buttons with fill-bars; it re-fetches onRoomEvent.Timelineso it stays live.PollCreatorDialogbuilds them.poll.startcontent withcrypto.randomUUID()answer IDs and sends viamx.sendEvent. The poll button inRoomInputis conditionally rendered based onclientConfig.features?.polls. Theshow_voter_namesflag is a client-side display hint stored in the poll start event; thecloses_atfield is a Unix ms timestamp enforced client-side (voting blocked after expiry, UI shows countdown).