Skip to content

feat(quiz): let a poll's voter add a note that is sent with their vote - #499

Merged
vite-hub[bot] merged 11 commits into
mainfrom
feat/quiz-poll-note
Nov 28, 2026
Merged

vite-hub[bot] merged 11 commits into
mainfrom
feat/quiz-poll-note

Conversation

@onmax

@onmax onmax commented Nov 28, 2026

Copy link
Copy Markdown
Owner

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 note in the comark-quiz:answer detail, in a host's answers (comark-quiz:state and window.__comarkQuizState), in localStorage with the answer, and over the data-quiz-relay postMessage. It's trimmed and up to 500 characters, keeps line breaks, and is "" for none. A poll without note sends no note key, so today's hosts see no change.

Decisions:

  • A host that leaves note out 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.
  • Each send replaces the earlier note. There's no history, since Drop D3 stores one note per voter.
  • The note isn't an option. It has no key and no count, and it never shows in the results bars.
  • The note under the pick is .cqz-mine, muted, white-space: pre-line, and its option's input gets aria-describedby, so a screen reader reads it with the pick. It has no motion of its own. The toggle is a link button with aria-expanded, so the motion layer's press applies.
  • The textarea is 1rem, so iOS doesn't zoom, with --comark-ring on :focus-visible.
  • Six new 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 with note="false", the issue for note on a question, and the labels option.
  • e2e/quiz.e2e.ts in Chromium:
    • voting with a note, the detail, the note under the pick and its description, an edit with Ctrl+Enter replacing it, Escape not sending, a changed vote keeping the note, and an empty note clearing it;
    • sending before voting;
    • restoring from __comarkQuizState, a host omitting note, and a closed poll;
    • no field without the script or a host;
    • the relay posting the note and restoring it from parent state.
  • All 20 quiz e2e tests pass. Also run: the quiz, motion, inline-scripts, workspace and ui info tests (491), test/doctor.test.ts -t quiz, format, lint, and vite-doctor on the package with 0 findings.

Docs: a "Note" section under Poll, the note prop, the labels, an exact definition of note in 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

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T12:48:27.627476Z
We couldn’t complete this review. Comment @codex review to try again.
682c909 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@499

comark-badge

pnpm add https://pkg.pr.new/comark-badge@499

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@499

comark-cards

pnpm add https://pkg.pr.new/comark-cards@499

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@499

comark-cast

pnpm add https://pkg.pr.new/comark-cast@499

comark-charts

pnpm add https://pkg.pr.new/comark-charts@499

comark-chat

pnpm add https://pkg.pr.new/comark-chat@499

comark-chips

pnpm add https://pkg.pr.new/comark-chips@499

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@499

comark-code

pnpm add https://pkg.pr.new/comark-code@499

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@499

comark-colors

pnpm add https://pkg.pr.new/comark-colors@499

comark-comments

pnpm add https://pkg.pr.new/comark-comments@499

comark-critic

pnpm add https://pkg.pr.new/comark-critic@499

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@499

comark-details

pnpm add https://pkg.pr.new/comark-details@499

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@499

comark-diff

pnpm add https://pkg.pr.new/comark-diff@499

comark-embed

pnpm add https://pkg.pr.new/comark-embed@499

comark-fields

pnpm add https://pkg.pr.new/comark-fields@499

comark-figure

pnpm add https://pkg.pr.new/comark-figure@499

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@499

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@499

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@499

comark-github

pnpm add https://pkg.pr.new/comark-github@499

comark-icon

pnpm add https://pkg.pr.new/comark-icon@499

comark-include

pnpm add https://pkg.pr.new/comark-include@499

comark-keys

pnpm add https://pkg.pr.new/comark-keys@499

comark-links

pnpm add https://pkg.pr.new/comark-links@499

comark-linter

pnpm add https://pkg.pr.new/comark-linter@499

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@499

comark-mark

pnpm add https://pkg.pr.new/comark-mark@499

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@499

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@499

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@499

comark-media

pnpm add https://pkg.pr.new/comark-media@499

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@499

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@499

comark-motion

pnpm add https://pkg.pr.new/comark-motion@499

comark-outline

pnpm add https://pkg.pr.new/comark-outline@499

comark-properties

pnpm add https://pkg.pr.new/comark-properties@499

comark-qr

pnpm add https://pkg.pr.new/comark-qr@499

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@499

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@499

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@499

comark-social

pnpm add https://pkg.pr.new/comark-social@499

comark-sources

pnpm add https://pkg.pr.new/comark-sources@499

comark-steps

pnpm add https://pkg.pr.new/comark-steps@499

comark-table

pnpm add https://pkg.pr.new/comark-table@499

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@499

comark-tests

pnpm add https://pkg.pr.new/comark-tests@499

comark-time

pnpm add https://pkg.pr.new/comark-time@499

comark-ui

pnpm add https://pkg.pr.new/comark-ui@499

comark-xref

pnpm add https://pkg.pr.new/comark-xref@499

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@499

commit: ff46bb3

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/quiz/src/script.ts Resolved
Comment thread packages/quiz/src/script.ts Resolved
Comment thread packages/quiz/src/script.ts Resolved
Comment thread packages/quiz/src/script.ts Resolved
@vite-hub

vite-hub Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Waiting 2026-11-28T14:17:37.164Z 3m 38s
View session Completed 2026-11-28T14:05:01.044Z 5m 20s
View session Waiting 2026-11-28T13:17:58.209Z 4m 7s
View session Cancelled 2026-11-28T12:58:49.050Z 10m 17s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

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.

View session

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.

View session

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

Pullfrog  | View workflow run | Using gpt-6.2-sol(high) | 𝕏

@onmax

onmax commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Before/after on Drop

@vite-hub
vite-hub Bot changed the base branch from feat/quiz-recommended to main November 28, 2026 13:43
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.
@vite-hub
vite-hub Bot merged commit fc1067f into main Nov 28, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/quiz-poll-note branch November 28, 2026 14:23
@github-actions github-actions Bot mentioned this pull request Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant