Repository navigation
Answer decisions on phones from one pane, with a save bar and a closure - #473
Conversation
|
Review: Changes needed I tested this against a fake-GitHub server with Must fix
Should fix
Nice to have
Verified, no change needed
|
|
Review: Changes needed (one remaining issue; everything else is fixed) I re-checked head Fixed, verified in the browser
Must fix: "touched" is a per-card flag, so the bar can still submit someone else's answer
Fix: store this person's selections, not a boolean.
Should fix
Product note, no change neededOn a card only a collaborator touched, hubot now sees a per-card Save (the safety net). It can still submit octocat's answer. It does so as a visible, deliberate action on that card, as on desktop, so I think that is acceptable. If "never submit someone else's selection from a phone" is the rule, that button should become "Save their answer", or be hidden. |
|
Review: Looks good. Nobody can submit someone else's choice from their own save bar any more. One small follow-up is below and doesn't block. Checked on head Both earlier repros are fixed
Product notes, no change needed
Follow-up, not blocking
|
On a phone, open decisions in the document become one-line chips that open Decisions focused on that card. Decisions drops its top inset, moves Save to a bar that appears only with unsaved answers, and shows a brief Decided confirmation once the server publishes the card as decided before folding it into resolved history. Desktop is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bar now counts, clears and saves only cards this person chose answers on, never a collaborator's draft or a visible Planner suggestion, which is accepted on its own card. A failed save says so in the bar and brings the card into view. A partly answered card is named rather than leaving Save disabled. Only this person's own save holds the Decided confirmation, with who decided; anyone else's decision folds away quietly. Chips give the question the full width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Which cards this person answered now lives in a session store rather than the card, so leaving Decisions or reloading keeps the answer in the save bar. It is forgotten on Clear, once the card resolves, or when the selection is gone from the draft. A card whose selection the bar does not count keeps its own Save, so no answer is left without a way to save it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The session store now keeps the answers this person chose, not a flag. A card stays in their save bar only while the shared draft still matches, checked on every draft change and after a remount, so a collaborator's later change is never saved under their name; the card then offers its own Save. A failed card that loses its place to a card folding away above it is brought back into view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed card is now reported when its error first appears, not only after the bar saw it saving, since a reply can land first. While it still shows its error or keeps focus, layout changes in the list re-centre it, so a card folding away above it no longer pushes it off screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r.tsx and questionnaire.tsx - packages/question/src/react/question-view.tsx: adds pending-answer reporting and a deferred-save footer; the only new class choice is a ternary between two literal button tiers on Discard. - packages/editor/src/plan-editor.tsx: threads an onShowDecision callback through to widget options; no style or class logic. - packages/editor/src/widgets/questionnaire.tsx: wires the save-bar context and a phone decision chip with literal classes; reviewed dynamic sites are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5717503 to
2e8956c
Compare
|
The preview deployment for chopin failed. 🔴 Open Build Logs | Open Application Logs Last updated at: 2026-10-11 09:45:56 CET |
Why
On a phone, Decisions was hard to finish (critique M-32, M-33 and M-34):
What changed (phones only)
"Phone" means a coarse pointer and a width of 600px or less, or a height of 500px or less. That condition is defined once in
packages/editor/src/phone.ts, so it can be replaced by the shared phone-class hook. CSS only reacts to.plan-decisions[data-phone].revealmechanism through a newonShowDecisionwidget option. Decided cards and their gutter markers in the document are unchanged.QuestionView. A collaborator's draft and a visible Planner suggestion never count, and Clear and Save never touch them.--phone-bottom-chrome(default 0).submit(), soclaimSubmit(), the revision check and persistence-before-publication are unchanged.sessionStorage(wrapped in try/catch), keeps the answers this person chose on each question of each card. A card counts in the bar only while the shared draft still matches those answers. This is rechecked on every draft change and after a remount, so a tab switch or a reload keeps it. If a collaborator changes the card afterwards, live or while you're away, the card leaves your bar and offers its own visible Save, the same deliberate tap as on desktop. Your bar never submits their choice. The store is cleared on Clear and once the card resolves.role="alert"), its button becomes "Try again", and the failed card is scrolled into view and focused so its own explanation is visible. It is scrolled back into view if a card saved alongside it folds away above it.decided, never by tapping Save.--keyboard-inset).New tokens:
--save-bar-open-dur,--save-bar-close-dur,--decision-closure-dur. Desktop is unchanged: the 1440×900 Decisions pane matches main pixel for pixel, apart from sidebar data.Screenshots (iPhone 15 Pro unless noted; left = before, right = after)
Decisions at rest

With your own unsaved answer: the save bar

After Save: Decided · You (before: the card just vanished)

Then it folds into resolved history

A failed save: the bar says so, and the card is brought into view and focused

Two users: hubot's own save confirms for hubot (left); octocat's open answer is untouched and octocat's bar still counts only octocat's answer (right)

Inline decision in the document becomes a chip (after: iPhone SE 375px)

Add an option with the keyboard (393×380)

Desktop 1440×900, unchanged

Testing
bun test apps/web packages/editor packages/question: 1468 pass.packages/editor/src/save-bar.test.tscovers what the bar counts, failure detection, incomplete cards, local-save tracking, which cards fold away, and the "Decided · You / @handle" label.tokens.test.tsallows the ghost tier on the deferred Discard.bun run types: pass.bun run ci: passes after the hash renewal below.e2e/decisions-phone.e2e.tsruns in the fixtures project:responsive-decisionsanddiscarded-mobile-geometry.question:submit).Needs a real device: the iOS keyboard together with
--keyboard-inset, the safe-area offset of the bar, and how the bar's motion feels.Design-contract review
Reviewed and renewed in
Renew design-contract review hashes for question-view.tsx, plan-editor.tsx and questionnaire.tsx. No new dynamic class or style logic at the reviewed sites; the only new class choice is a ternary between two literal button tiers on Discard.Rebase notes
#474 landed first with its own
packages/editor/src/phone.ts(comment surfaces, coarse pointer and ≤430px). This PR's phone definition (coarse pointer and ≤600px, or ≤500px tall for landscape) is identical to #471'spackages/editor/src/widgets/phone.ts, sodecisions.tsxandwidgets/questionnaire.tsxnow importusePhonefromwidgets/phoneand #474'sphone.tsis unchanged. Behaviour is the same as before. Unifying both onto the shared phone class from #475 is still a follow-up.Known future overlap
The planned "decision decks" work (lane
decision-decks) may later restyle decision cards. Everything in this PR is behind the phone condition and in the presentation layer: the chip, the bar, the confirmation, and the opt-inQuestionViewpropsdeferSaveandonPending. Records, drafts and the submit path are not touched.🤖 Generated with Claude Code