Skip to content

fix(threads): show steer messages outside the work section - #639

Merged
nixuuu merged 1 commit into
devfrom
fix/steer-message-work-segments
Nov 13, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/steer-message-work-segments

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Steered user messages could disappear inside the collapsed work section. Every delivered steer now starts a conversation segment: preceding work, the visible input, then following work. Consecutive inputs share the next fold. Web and mobile derive the same layout from persisted item data and transcript order, including catch-up, forks and virtual remounts.

A steer preserves earlier live fold choices. The next final answer or turn end applies the existing collapse preferences to all work since the previous answer; manual expansion after the end survives late items. Platform background-task steers retain their notice renderer and also remain visible outside hidden work.

Each segment has its own work summary. Steer item boundaries have no durable timestamp, so adjacent summaries use the existing “Work”/“Working” labels and counts without an invented duration. The turn footer retains its full duration. Existing feed anchoring, motion tokens and reduced-motion handling remain in use.

Validation:

  • Focused logic tests: 21 passed, 458 assertions. Covers start/middle/end steers, repeated and consecutive inputs, final answers, all fold combinations, replay, fork history, reading anchors, and mobile parity. No UI tests added.
  • Passed with nice: install, gen:check, typecheck, lint, format:check, full check:tmp (including temporary-directory cleanup), and the web build. The review-machine web build also passed.
  • Real Chromium on the isolated second-machine review stack: light/dark, 1440×1000 and 390×844, live user steers through WorkerLink → gateway → SSE, long wrapping input, reload during and after the turn, collapsed segments, and manual expansion retained across a later turn. A reader 124 px from the end retained its row at 27.625 → 27.781 px (0.156 px drift); another history anchor drifted 0.532 px. Following readers continued following. Reduced motion: enabled, zero active animations, no horizontal overflow. No browser errors. Review processes, container, checkout and temporary files cleaned up.
  • Platform notes: pending background-task steers remain excluded from pending user messages; delivered notes retain BackgroundNoteRow on both clients and their existing item identity, now outside the fold.

Scope of verification: the live path used an isolated synthetic worker with steer support; no provider inference or native iOS/Android session was run. Mobile derivation parity is covered by the pure logic tests.

Copy audit (§8): “Working for” without a known duration → “Working”, matching mobile and avoiding an incomplete label. Existing “Work” and summary counts describe untimed completed segments. Sentence case and text cues remain consistent. Short and long inputs reviewed at desktop and phone widths in light/dark.

No regression link: the hidden-mid-turn-steer behavior predates the recent collapse correction; no exact recent introducing PR has been established.

@nixuuu
nixuuu marked this pull request as ready for review November 13, 2026 12:13
@nixuuu
nixuuu merged commit c329aef into dev Nov 13, 2026
12 checks passed
@nixuuu
nixuuu deleted the fix/steer-message-work-segments branch November 13, 2026 12:14
nixuuu added a commit that referenced this pull request Nov 13, 2026
Older turn summaries can arrive while their messages are outside the
independent 128-item watch window. Web treated those turns as completed
empty folds and only paged near the list's beginning, leaving work and
answers blank across reloads.

This change shows compact loading rows for missing or partial work,
prefetches one bounded history page from virtual overscan, and preserves
message anchors when earlier steers renumber segments. Fold coverage
mismatches expose the source rows and emit diagnostics. Initial
positioning has a two-second reveal fallback; diagnostics include
earlier-page request-to-render timings. New running turns without their
first item do not trigger a scan of older history.

History metrics use fixed IDs 450–455, separate from the thread-watch
metrics introduced by #673. Gateway responses classify client metrics by
their registry group, keeping recovery timings in the Client section and
preserving the existing watch-recovery behavior.

Fixes: #541

Verified with git bisect: `0c655ca3ba72f2aea48487d7de62642a15a096f2`
introduced the independent windows; its parent `e483f4274` passes the
same three-turn/600-item reproduction. #639 and #668 steer/group parity
tests pass. Shared mobile fold derivation is unchanged.

Validation:

- Nine focused history/fold regressions pass, including partial cached
tails, steers, collapsed groups, nested tools, a running subagent and
stable message identities. Real gateway/cache/checkpoint recovery
integration passes.
- Production browser checks cover desktop and 390px phone widths,
light/dark and reduced motion. Prefetch starts up to 572px before
missing work reaches the viewport; loading rows measure 44px;
reading-anchor drift stays under 0.5px.
- Held responses, actual thread switching, cached reload with a
simulated desktop persistence bridge, cleared local storage, failed
requests/Retry and blocked row measurement all recover visibly. A fresh
running turn sends zero history requests; scrolling to older gaps sends
one. Recovery and request-to-render diagnostics were captured.
- Initial handover gates passed: install, `gen:check`, typecheck, lint,
`format:check`, `check:tmp` and the web build. That full local run had
2,793 passed, 166 skipped and zero failures across 523 files;
temporary-directory cleanup was clean.
- Rebased onto current `dev` (`89f37fea6`), including #670 and #673.
Post-rebase checks pass: 34 focused feed/fold tests, 10 diagnostics
integration tests, six provider-account integration tests and the
bounded-window/cache integration test (51 total), full typecheck, lint,
format check and production web build. The provider refresh invalidation
regression and forced-refresh race both pass. Diagnostics tests verify
distinct watch/history metrics through authenticated ingestion,
client-section rendering data and redacted export. Runs were detached
with `nice`, with heavy test files run one at a time; each focused
`check:tmp` run cleaned its temporary directory.

Native Mac/Electron and native phone rendering were unavailable. The
desktop renderer and cache contract were checked in Chromium; shared
mobile/web steer and group logic tests pass.

Copy audit (docs/copy.md §8): “Loading earlier work…” is a concise
progress status; existing error and Retry copy is reused. Light/dark
desktop and phone widths checked; no new motion or copy in tool/steer
rows.
nixuuu added a commit that referenced this pull request Nov 17, 2026
## Change

With “After the turn” set to Collapse, a delivered steer now collapses
the preceding work immediately, including work before a context
compaction boundary. Previously those segments continued using “While
working” until a final answer or the turn ended.

The new segment uses “While working”. Manually reopening an earlier
segment after the steer survives subsequent steers and completion. Keep
open remains respected, and compaction alone preserves the current fold
choices. The shared rule applies to web, desktop and mobile; the folding
documentation describes the new behavior.

Fixes: #639

## Verification

- Passed domain source typecheck: `bunx --no-install tsc -p
packages/domain/tsconfig.json --noEmit`.
- Passed lint and formatting for `packages/domain/src/work-fold.ts`, and
`git diff --check`.
- Checked the actual fold controller and header in an isolated Chromium
fixture: steer invalidates live manual choices, manual reopening
survives a later steer, compaction alone preserves choices, a subsequent
steer closes preceding segments, and Keep open works with Collapsed
while working.
- Inspected light/dark screenshots at desktop and phone widths with long
steer text; no horizontal overflow or browser errors.
- Updated the existing fold-logic expectations for the steer boundary,
including all preference combinations, an immediate steer without
subsequent work, mobile parity after compaction, and manual reopening
through later steers and completion. Both affected files pass through
`check:tmp`: 18 tests, 576 assertions, no temporary files left. Lint and
formatting pass for the edited tests.
- No UI copy changed; the copy audit is not applicable. Native mobile
rendering and the full running application were not exercised. Full
repository checks and builds remain with CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant