Repository navigation
feat(quiz): let a poll's voter add a note that is sent with their vote - #499
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-motion
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-social
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
Important
A host rerender can drop a voter’s note, and a note editor left open past the poll’s deadline can still send an update.
Approach: An opt-in note on the existing poll answer event is the right fit — it keeps the note attached to the vote without changing the payload for polls that don’t opt in.
Reviewed changes — I traced note entry, submission, and restoration through the HTML renderer and browser runtime. The quiz build, 46 unit tests, and 20 Chromium tests passed; I reproduced the inline findings separately in Chromium.
- Authoring and rendering:
::poll{note}adds a hosted note editor with an optional custom placeholder and displays the saved note under the voter’s first pick. - Host contract: Votes and note edits share the answer event and iframe relay; host state can restore or explicitly clear the note.
- Docs and tests: The package docs and skill reference describe the new prop, keyboard behavior, and event payload; tests cover the basic voting, editing, restoration, and relay flows.
gpt-6.2-sol(high) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. PR #499 is ready to merge. Verified that notes survive remounts, submissions stop at the deadline, the 500-character limit holds, and dismissing the editor clears the prompt. All hosted checks passed, including Chromium e2e. All 49 quiz unit tests passed locally, and lint passed with warnings. No changes were needed. Pushed ff46bb3 to resolve four merge conflicts, preserving both poll notes and recommended options. Verified that all prior review fixes remain intact. All 49 quiz unit tests passed, and lint completed with warnings. The sandbox blocked the local Chromium test server, so browser validation awaits hosted CI. Session GitHub is still calculating mergeability for this PR head. PR #499 is ready. The current head preserves notes across remounts, blocks submissions after the deadline, enforces the 500-character limit, and clears the prompt when a draft is dismissed. All review threads are resolved and hosted checks passed. Locally, all 46 quiz unit tests passed and lint reported warnings only. The sandbox blocked the local browser test server, so browser validation rests on hosted CI. No repair push was needed. |
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — I re-reviewed 51014605 against 682c909f and verified the fixes in Chromium.
- Preserved notes across remounts: A host echo that includes only the choice keeps the saved note, while an explicit empty note still clears it.
- Blocked late submissions: The send button, keyboard shortcut, and option click all respect the poll deadline, even when the note editor was already open.
- Enforced the note limit and cleared stale prompts: Restored and submitted notes are capped at 500 characters, and Escape or the note toggle clears the pick-first prompt.
All 46 quiz unit tests, 26 Chromium quiz tests, and 21 inline-script checks passed.
gpt-6.2-sol(high) | 𝕏
Keeps this PR's version over base changes: - skills/comark-ui/references/quiz.md: The PR intentionally replaces the base poll props table row to document the note prop, while retaining the entire recommended-option guidance from the base row.

A poll voter had nowhere to say why they picked an option, short of an author adding a "My own words" option.
::poll{note}now adds a note field that goes out with the vote.note="Why this one?"sets its placeholder. Stacked on #498.The field only shows once a host sends state, the same as voting. Without the script, or with no host, it stays hidden. "Add a note" opens a textarea under the options. Send note, or Cmd/Ctrl+Enter, sends it. Escape closes it without sending. A vote made while the field is open carries its text. Sending before voting asks the reader to pick an option first and keeps the field open, so their next vote carries the note. After voting, the note sits under the reader's own pick, where only they see it. "Edit note" reopens it, and sending again re-announces the same choice with the new note.
The note travels as
notein thecomark-quiz:answerdetail, in a host'sanswers(comark-quiz:stateandwindow.__comarkQuizState), in localStorage with the answer, and over thedata-quiz-relaypostMessage. It's trimmed and up to 500 characters, keeps line breaks, and is""for none. A poll withoutnotesends nonotekey, so today's hosts see no change.Decisions:
noteout of an answer keeps the note the page shows. A host that doesn't store notes would otherwise wipe one the moment it echoes the vote back.note: ""clears it..cqz-mine, muted,white-space: pre-line, and its option's input getsaria-describedby, so a screen reader reads it with the pick. It has no motion of its own. The toggle is a link button witharia-expanded, so the motion layer's press applies.--comark-ringon:focus-visible.labels:addNote,editNote,notePlaceholder,sendNote,yourNote,pickFirst.Checked:
packages/quiz/test/quiz.test.ts: the note markup and where it sits, the prop's placeholder escaped, no field without the prop or withnote="false", the issue fornoteon a question, and the labels option.e2e/quiz.e2e.tsin Chromium:__comarkQuizState, a host omittingnote, and a closed poll;uiinfo tests (491),test/doctor.test.ts -t quiz, format, lint, andvite-doctoron the package with 0 findings.Docs: a "Note" section under Poll, the
noteprop, the labels, an exact definition ofnotein Events for hosts, keyboard and focus, the slots, and the comark-ui skill reference.Plan: https://drop.vitehub.dev/d/wtn1zg3tajmt/social-poll-drop-plan