TimZander / TimZander/life-compass
An open assistant panel goes stale under the answer the reader is dictating
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 8h 34m
- Merged PRs (30d)
- 3
Description
Problem
The panel builds its payload when it opens and never re-reads while it stays open. It is placed directly above its question (#78, deliberately — appending put it below all five of Day 1's slots), so dictating into the field beneath an open panel is the expected flow, not an edge case. The reader dictates, taps Copy, and hands over the text from before they started.
Found by review, not on device. Three separate routes to the same stale value:
- No re-read while open.
refreshruns on open and on the include checkbox changing. Nothing re-runs it when the answer underneath changes. flushAnswerscloses only half the window. It settlesanswers.flush(), butrecord(fields.ts) callsanswers.setaftermaterialiseresolves. A repeat's first-ever dictation is therefore neither pending nor claimed whenreadAllruns — so it is missing, with nothing said. The comment inapp.tsclaims to have closed exactly this window; it closed the debounce half.- A closed panel keeps its payload. Closing sets
hiddenbut leavesshownset, so a hidden panel still holds a copyable value. Not reachable by pointer in a real browser (hidden elements are inert), but it is state outliving its visible reason to exist.
Why it matters
ADR 0007 · 1 makes the preview and the clipboard one value. These make them one value as of some earlier moment, which the reader has no way to see. The failure is silent and produces a plausible-looking prompt — the worst shape for this feature, because the reader finds out from the assistant's reply, not from the page.
Proposed fix
Re-read on the events that mean the answer changed — input/change on the fields belonging to the panel's group, or a general "answers written" signal from createAnswers — and rebuild through the existing generation token so an in-flight read cannot paint over a newer one. Have flushAnswers await in-flight materialisation as well as the debounce. Clear shown when a panel closes.
Acceptance criteria
- Dictating into a field beneath an open panel updates the preview, and the copy sends the new text.
- A repeat's first-ever dictation is present in the payload, including its minted instance identifier.
- Rebuilds triggered in quick succession resolve to the newest, never an older one.
- A closed panel holds nothing copyable.
- Negative case: a rebuild that fails leaves the preview saying so rather than showing the previous payload (the behaviour #78 established).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with refresh and flushAnswers in app.ts, then follow record in fields.ts and the createAnswers materialisation flow. Trace the generation token and the panel's shown/hidden state before changing rebuild triggers. Done means all five acceptance criteria pass, including fresh dictation, minted repeat identifiers, newest-result ordering, cleared closed panels, and visible rebuild errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100