Repository navigation
feat(quiz): break an option's text where its author breaks the line - #497
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-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
Restoring a revealed question while it is hidden can drop the correct answer from the screen-reader status. I reproduced this in Chromium with a closed disclosure.
Approach: Converting soft breaks in the option label after computing its key is the right place to preserve both the author's layout and existing answers.
Reviewed changes
- Option rendering and keys: Verified that soft wraps render as
<br>in questions and polls, including inside emphasis, and keep the same key when replacing a space. - Validation and docs: Checked when multiline options trigger a rationale warning and how that behavior is documented in the Doctor page and skill reference.
- Answer reveal: Checked the screen-reader status in visible and collapsed questions. The quiz build and all 36 focused tests passed.
gpt-6.2-sol(high) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Session Pushed 1cff1ba and resolved the P1 review thread. Quiz announcements now exclude inline CSS, scripts, and tooltips while preserving line breaks as spaces, even inside closed disclosures. All 36 quiz tests passed, lint exited successfully, and both announcement cases passed in a DOM harness. The sandbox blocked local Chromium, so the new browser regression test awaits hosted CI. |
There was a problem hiding this comment.
Important
The closed-disclosure fix works, but the new label reader can announce a component’s inline CSS and JavaScript instead of just the correct answer.
Reviewed changes
- Reveal status: Verified that a multiline answer restored inside a closed
<details>retains its text, and checked how the new DOM walk handles inline components. - Saved keys: Verified that replacing a space with a plain newline preserves the key, while Markdown hard breaks keep their distinct legacy key, as the updated docs now explain.
- Tests: All 36 quiz parse/render tests and all 16 Chromium quiz tests passed.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes
- Answer announcements: Limited label extraction to revealed answers and excluded scripts, styles, hidden content, and tooltips without relying on layout.
- Regression coverage: Added a Chromium test that verifies an inline
:timeannounces onlyCorrect answer: in 2 days. All 17 Chromium quiz tests and all 36 parser and HTML renderer tests passed, including answer restoration inside a closed disclosure.
gpt-6.2-sol(high) | 𝕏

An option written over two lines in a
::pollor::questionrendered as one run-on line, because Markdown joins a soft newline into a space. Social polls write options like "Neon\nserverless Postgres", and the break is part of how they read.readOptionnow turns each newline in an option's own text into a<br>, inside inline marks too (**a\nb**), but not inside inline code. The key is still the hash of the text with whitespace collapsed, so every existing option keeps its key and stored answers still match. The revealed status line reads a break as a space.Decisions:
comark/quiz/line-break-optionnow fires only on a question's wrong option that has no>reason and runs onto a second line, which is where a missing>is likely. A multi-line option with a reason, or any poll option, is fine. Its doctor page says so.Checked:
packages/quiz/test/quiz.test.ts:<br>in a question option, a poll option and inside<strong>; the key of a two-line option equals the same option on one line; the keys of the existing question and poll fixtures are the same as onmain(I hashed them withmain's source).vite-doctoron the package, and the quiz doctor pages test.Docs: a "Lines" section on the quiz page and a line in the comark-ui skill reference.
Plan: https://drop.vitehub.dev/d/wtn1zg3tajmt/social-poll-drop-plan