Keep the final answer visible when a Goal reloads - #510
Conversation
An unfinished /goal stays active without a closing update_goal. On reload the whole turn was folded into the collapsed Goal chip, so the wrap-up disappeared. Lift trailing prose out of a settled unfinished run, and open a live goal that still has process text.
|
Thanks for this — nice catch, and the diagnosis is spot on. A I went through it fairly carefully and it holds up:
Checks on your branch (8b32de7): No blocking issues — I'll merge this shortly. 🙌 Three small non-blocking notes, purely as possible follow-ups; please don't hold this PR for them:
Thanks again for the clear write-up and the repro steps — made this easy to verify. |
|
Sounds good, thanks. |
|
Follow-up on my review above — I went ahead and wrote the three non-blocking notes up as an actual patch rather than leaving them as homework. All three are addressed, with tests that fail without the fix: 1. const [userOpen, setUserOpen] = useState<boolean | null>(null)
const bodyOpen = userOpen ?? (isError || (isRunning && items.length > 0))The default follows the data — a live run opens as soon as it holds anything, settling collapses it again (its answer has been lifted out by then), a late error still opens — and a manual toggle wins once set. 2. Tests for the incremental shape. Three new cases in 3. The lift now covers every part that is the answer, not just Gates on top of your commit: One logistics note — I couldn't push this to your branch directly because Allow edits by maintainers is off on this PR, so the patch is below. Either flip that checkbox and I'll push it, or
|
…answer The card seeded `bodyOpen` at mount, but a goal run always mounts before its body exists (`create_goal` is adapted on its own, so the run starts with `items: []`). That left the default hostage to whether the row happened to remount later — it does on the sub-turn merge and on virtualizer recycling, but not on a plain same-key update. Derive it from the data instead, with an explicit user override that wins once set. Widen the settled-run lift from `text` to every part that IS the answer: a Plan-mode document and a generated image were still buried in the collapsed capsule. Process parts (tools, reasoning, todo plans, polls) stay inside, and answer parts sitting before a process part stay put so the reply is never reordered.
|
Allow edits is on, and I applied the patch. |
If a
/goalis still active, Codeg folds the rest of the turn into the Goal chip. That chip starts collapsed, so after a reload you just seeGoal: …plus New files / Files changed, and the wrap-up is gone until you expand the chip.This lifts trailing prose out of a settled unfinished goal so the answer stays under the chip. A live goal that still has process text starts open.
Reload a chat that used
/goaland didn't close it. The last assistant message should still be there, not only the Goal pill.