Repository navigation
Pi asks: keep unsent answers, and a calmer card layout - #282
Merged
TannerMidd merged 1 commit intoNov 5, 2026
Merged
Conversation
TannerMidd
added a commit
that referenced
this pull request
Nov 5, 2026
…ne short test A kept Pi asks card saved every field on each key, a secret field's password too, in clear text in the browser's storage until sign-out. A secret field is now kept empty, to type again after a switch or a reload. On a touch screen the card's own answer box stays 44 px high, as every touch target; the global placeholder color serves it. test/ask-answers-ui.test.ts: 346 lines and 4 tests to 139 and one, covering each risk; 7 mutations each make it fail. Follow-up to #282 by @vitalNohj.
TannerMidd
added a commit
that referenced
this pull request
Nov 5, 2026
The answers were kept by the approval's id, which is unique only while it waits, and only a card on screen dropped them. A question that ended while another session showed, or before a reload, left them until sign-out, and a later ask with the same id got them back. They are now kept by session, each under the ask's id and the time it asked, and the card is one per ask. Each read or save of a session's answers drops those of asks no longer waiting. Follow-up to #282 by @vitalNohj.
TannerMidd
added a commit
that referenced
this pull request
Nov 5, 2026
…ks again e4f6066 kept answers under the ask's id and the time it asked. After a restart the ask tool asks again from the same call with the same id but a new time, so the card came back empty and its answers were dropped. An ask is now its id and its call, or the time it asked when it has no call: the same call asking again keeps its answers, and a later ask with the same id from another call is still a new one. Follow-up to #282 by @vitalNohj.
TannerMidd
added a commit
that referenced
this pull request
Nov 5, 2026
…tab kept keptAsks dropped the answers of asks missing from the session's view, also when that view was the copy the tab kept, which may be old. Back in a session whose ask ended while another tab answered a later one, the kept copy's card dropped the later ask's answers from the shared storage. Answers of ended asks now go only by a view the server sent since the session showed (viewSynced in store.js): as it comes, and as a card leaves it. A kept view drops nothing. Follow-up to #282 by @vitalNohj.
TannerMidd
added a commit
that referenced
this pull request
Nov 5, 2026
… unused Follow-up to #282 by @vitalNohj.
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.
Closes #281
Keeps the unsent answers on a Pi asks card when you switch sessions or reload, and clears them once the card is done. It also spaces the card's questions out so a card with several reads more easily.
What it does
person-storage.js, the way the message box keeps a draft. Switching to another session and back, whether or not the tab has shown that session before, or reloading, shows them again.Layout
Each question now has more room above it (24px) than inside it (8px), and its header tag always sits on its own line above the question, so short and long questions start the same way. Option labels and descriptions start at the top, options in one row are the same height, and an odd last option takes the whole row on wide screens instead of leaving a hole. "Or type your own answer" is a quieter one-line box under that question's options, so it no longer looks like one more option, and a hairline sets Decline and Send apart from the last question. CSS only, with the app's existing variables; on a phone the options stay one column and at least 44px tall.
Screenshots
A card with three questions: one long question with two long options, one with three options, and one with three options where more than one can be chosen.
Before (desktop):
After (desktop):
After, light theme:
After, phone (390px):
Tests
Decline, a stopped run, a question answered elsewhere, and a saved entry that no longer fits are not covered by a test of their own.
npm run checkpasses. eslint and prettier pass on the touched files.node --test --test-concurrency=2ontest/ask-answers-ui.test.ts,test/ask.test.ts,test/approvals.test.ts, andtest/person-storage.test.ts: 17 tests, 17 pass. Withtest/mobile-ui.test.tsadded: 44 tests, 44 pass.