Skip to content

fix(chat): wait for measurable transcripts before restoring position - #5119

Open
reachjalil wants to merge 2 commits into
devfrom
fix/transcript-ready-restoration
Open

reachjalil wants to merge 2 commits into
devfrom
fix/transcript-ready-restoration

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Problem

A conversation can have a normally sized scroll container while its transcript is hidden by Suspense or has not committed yet. Treating that state as usable layout can replace measured group heights with zeros, calculate an invalid list origin, or consume a saved reading anchor against a loading fallback.

Changes

  • Check the transcript itself before measuring groups, reading its origin, or synchronizing its offset. Preserve prior geometry while hidden, observe reveal without requiring a viewport resize, and avoid resetting measurements during Suspense layout-effect replay. Genuinely empty groups still measure zero.
  • Defer position restoration and persistence until committed transcript content is measurable. Keep loading geometry reserved without consuming the anchor, and prevent fallback clamps from overwriting the saved position. Preserve explicit gesture cancellation, empty histories, sticky follow, and submitted-message navigation.

Scope is limited to these two fixes: two implementation files and two existing test files. No virtualization replacement, styling changes, new scrolling timers, or jump-to-latest pagination changes.

Verification

Focused regression tests: Passed. Overall verification: Failed typechecks; runtime evidence: Incomplete.

  • The targeted reproduction before implementation had 109 passes and 7 failures.
  • Final PR head 71db7fa25aadd834dad1388392f6e2ab15459922: 128 tests passed, 0 failed, 809 assertions, using Bun 1.3.14:
    # From apps/app
    pnpm --package=bun@1.3.14 dlx bun test --isolate tests/progressive-message-list.test.tsx tests/session-scroll.test.tsx tests/live-step-scroll.test.ts
  • Added 12 regressions, including actual React Suspense hiding/revealing a retained transcript at an unchanged viewport, initial suspension, manual/sticky restoration, fallback-state preservation, empty history, and user cancellation. Assertions check preserved measurements/anchors and bounded frame work. Geometry is simulated in Happy DOM.
  • git diff --check passed.
  • Final pnpm --filter @openwork/app typecheck failed with two React 18/19 type incompatibilities in workbench-panel-group.tsx and app-sidebar.tsx after the frozen dependency install. An earlier pre-rebase app typecheck passed; it does not override this final failure.
  • Final pnpm --dir evals typecheck failed with 12 progressbar/TargetRole errors in models-analytics-upgrade.e2e.test.ts. The earlier incomplete dependency setup reported additional errors that no longer occur after relinking.
  • Clean-base follow-up at 030be3e313aad4d73a6dbfe54a842284359c75fc: the same 12 eval TS2322 errors reproduced, so those are baseline-matched. The control app typecheck passed, while both feature worktrees still reported the two React-type errors. Compiler resolution confirmed different dependency layouts: panels/framer-motion resolve React types 18.2.79 in the feature worktrees versus 19.2.14 in control; app source resolves 19.2.14 throughout. This is not an equivalent-environment app comparison and does not erase the recorded failures. No claim is made about which preparation step caused the layout difference. Required GitHub build/core checks passed at the current PR head.
  • A fresh local app-web capture at this exact head succeeded after canonicalizing the isolated fixture workspace path, retaining the native-directory equality check. The real native v1 engine stored 150 synthetic messages with noReply; after a clean reload, trusted sidebar clicks opened the history, navigated to another task, and returned without transcript scrolling. The latest message was visible with a 0 px scroll-bottom gap and 16 px between its container and the transcript viewport bottom. DOM checks found a healthy 1170×692 transcript viewport, no loading/error/dialog overlay; PNG dimensions were 1440×900 with nonblank pixel variance and manual visual/privacy inspection. Owned browser/server/engine resources were stopped and the synthetic workspace removed. This supersedes the earlier blocked screenshot attempt, not the typecheck results above.
  • Not run: full browser/Electron/Daytona journey suite, production build, or latency benchmarks. No claim of universal thread-opening correctness or measured speedup.

UI/UX impact

The intended difference is stable thread opening and restoration once real content is ready. Existing loading UI, composer, controls, styling, and deliberate scrolling remain unchanged. Existing components and motion behavior are preserved (DESIGN P5/V6); P10 now has supplementary real-size screenshot evidence below; targeted browser proof of the hidden/loading states remains incomplete.

Supplementary screenshot

Synthetic conversation after navigating away and returning without scrolling

Synthetic 150-message conversation after navigating away and returning, without scrolling the transcript. Captured at 71db7fa25aadd834dad1388392f6e2ab15459922 in local app-web / native v1 / HeadlessChrome 153 at 1440×900. No real provider or private conversation was used.

This image shows only the settled ordinary thread-return state. It does not specifically exercise delayed loading reservation, restoration to a saved manual reading anchor, or a hidden transcript with a positive viewport; it is not a universal fix claim or a replacement for those regression tests.

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 18, 2026 5:50pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Sep 18, 2026 5:50pm UTC
openwork-diagnostics Skipped Skipped Sep 18, 2026 5:50pm UTC
openwork-landing Skipped Skipped Sep 18, 2026 5:50pm UTC

@vercel
vercel Bot temporarily deployed to Preview – openwork-landing September 17, 2026 17:46 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics September 17, 2026 17:46 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den September 17, 2026 17:46 Inactive
@github-actions

Copy link
Copy Markdown
Contributor

Selected evidence: Incomplete · 12/12 tests · 18/18 assertions · 8 images

Commit 71db7fa25aadd834dad1388392f6e2ab15459922 · selected evidence
Required verification is reported separately by the current-head Required verification check.

Open review report

Coverage gaps: Required verification: incomplete. Selected evidence does not satisfy all required specs. No authenticated current-head required plan is available.

@reachjalil
reachjalil requested a review from a team September 18, 2026 17:49
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics September 18, 2026 17:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing September 18, 2026 17:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den September 18, 2026 17:49 Inactive

This branch was successfully deployed

1 active and 3 inactive deployments
Preview – openwork-app 75686fc1 Deployed Sep 18, 2026 by vercel[bot]
Preview – openwork-den 75686fc1 Deployed Sep 18, 2026 by vercel[bot]
Preview – openwork-diagnostics 75686fc1 Deployed Sep 18, 2026 by vercel[bot]
Preview – openwork-landing 75686fc1 Deployed Sep 18, 2026 by vercel[bot]
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