TimZander / TimZander/life-compass

An open assistant panel goes stale under the answer the reader is dictating

Open
#83 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. No re-read while open. refresh runs on open and on the include checkbox changing. Nothing re-runs it when the answer underneath changes.
  2. flushAnswers closes only half the window. It settles answers.flush(), but record (fields.ts) calls answers.set after materialise resolves. A repeat's first-ever dictation is therefore neither pending nor claimed when readAll runs — so it is missing, with nothing said. The comment in app.ts claims to have closed exactly this window; it closed the debounce half.
  3. A closed panel keeps its payload. Closing sets hidden but leaves shown set, 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

  1. Dictating into a field beneath an open panel updates the preview, and the copy sends the new text.
  2. A repeat's first-ever dictation is present in the payload, including its minted instance identifier.
  3. Rebuilds triggered in quick succession resolve to the newest, never an older one.
  4. A closed panel holds nothing copyable.
  5. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.