Repository navigation
fix(control-ui): bound automatic history filling after reload - #171593
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
20db211 to
82fd42a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82fd42a628
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.clearHistoryObserver(); | ||
| this.historyObserverArmed = false; | ||
| void this.loadOlderMessages(); | ||
| void this.loadOlderMessages(readerIntent); |
There was a problem hiding this comment.
Treat Show earlier as renewed autofill intent
When an automatic fill request fails, performOlderMessagesLoad sets historyAutoLoadBlocked; clicking Show earlier then calls loadOlderMessages() directly without clearing that flag. If the retry succeeds but still has older pages, the flag remains true, so syncHistoryObserver() cannot continue filling the underfilled viewport and even the newly staged page remains parked until another manual action. Clear the failure backoff when the button supplies renewed reader intent, as the wheel/keyboard path already does.
Useful? React with 👍 / 👎.
82fd42a to
874e1a1
Compare
5745e82 to
be6c3e8
Compare
be6c3e8 to
03baa28
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03baa28840
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| document.visibilityState === "hidden" || | ||
| !this.transcript.isPositionSettled || | ||
| this.transcript.isProgrammaticScroll || | ||
| this.transcript.isMaintenanceScroll || |
There was a problem hiding this comment.
Re-arm the observer after gated notifications
If a short transcript's queued intersection arrives while the tab is hidden or maintenance scrolling is active, this guard returns without clearing the observer. When the pane becomes eligible again, updated() calls syncHistoryObserver(), but that method reuses the same observer for the same root and sentinel; because the sentinel remained intersecting, no new threshold notification is guaranteed, so automatic history filling can remain stalled until the user scrolls or the intersection changes. Clear the observer when rejecting these transiently gated callbacks so the next synchronization observes the sentinel again.
Useful? React with 👍 / 👎.
…aw#171593) * fix(control-ui): fill short history windows after placement settles * refactor(control-ui): keep history gestures in scroll input owner
What Problem This Solves
The cold-load campaign measured two unnecessary older-history pages at boot (1,022 KB and 553 KB) during a signed-in reload of a dashboard deep link. #171009 removed that overfetch. After #171529 restored basic viewport filling, sparse conversations still needed a per-open page budget, visibility/maintenance gates, and suppression of unused staged requests.
User Impact
Short visible conversations fill automatically after transcript placement settles, through the existing prefetch margin, with at most three automatic pages per open. A first page that already fills the viewport makes no automatic history request. Upward reader input retains automatic paging and staged prefetch; history failures retain the existing retry backoff.
Why This Change Was Made
The history owner replaces bootstrap-mode state with the bounded allowance. It checks placement, presentation, document visibility, connection, and programmatic/maintenance scrolling both before observation and when intersection notifications arrive. Automatic fills avoid staged prefetch. Rejected fills disconnect their observer so later upward input receives a fresh intersection notification.
Gesture parsing and its touch baseline move to the existing scroll-input owner. The superseded base-pane touch field, shared constants, and bootstrap-state path are deleted. There are no configuration or Gateway stored-shape changes.
Production delta: +23 lines (+70/-47), four modules. Growth implements the requested three-page budget and visibility/prefetch contract. Eight files change: the four history/input modules, focused autofill tests and their existing fixture, the history-loading browser test, and chat documentation. No changelog edit is included because release notes are release-owned.
Evidence
Final head:
03baa2884056fbc27f089b447d0bdd687b38ed9d; base:55e654c69666e5e5e25b588ff4e73af9d4bbc9f5. Fresh review is clean through P2. The base includes the upstream community-invite selector correction and accepted-draft retirement assertion correction. The history patch is unchanged by the rebase.AWS Crabbox
cbx_483f5860bf7b, with Chromium and WebKit installed:chat.historyrequests,hasMore: trueThe short-session browser case fills without user input. The removed third request was unused staged prefetch. The margin-fill regression fails against the base and passes with this change. These are deterministic request counts; no wall-clock performance improvement is claimed.
All 72 focused history, pagination, maintenance, and keyboard tests pass. The 12 new autofill cases cover the cap/reset, the prefetch edge, overflowing first pages, hidden/unsettled/maintenance states, failure backoff, exhausted history, and reader intent after a rejected automatic fill. The exact single-file command
pnpm test ui/src/pages/chat/chat-pane-history-autofill.test.ts --maxWorkers=1took 35.162 seconds wall time on AWS. The remaining 60 cases also pass.Changed-file format/lint, ten selected core-test typecheck graphs, UI typecheck, line-count and the other structural guards pass. The changed-file command remains red only on global unused-export scanning: one script, three production, and three full-tree entries. Running
node --import ./scripts/tsx.mjs scripts/check-deadcode-exports.mtson the pinned main base reproduces the same findings. None is introduced by the eight-file patch; the mock-export ratchet passes on this base.The full UI E2E suite ran on this exact head with
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts: 3,441 passed, one failed, one configured-worker skip across 778 files (777 passing files, one failing file). The 15 instant-thread cases, ten community-invite cases, history-loading cases, zero-request cold-load regression, reader paging/anchoring, stale geometry, resize anchors, transcript search, and deep reveal all pass.The sole failure is
extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts, case “configured owners and admin chat manage a Telegram-created job while a non-owner cannot”: Crabline0.1.29reportsPrivate mutation boundary is writable by another POSIX principal.during provider readiness, before Gateway startup. The exact case and error were reproduced on main8578b6f662919746a952174dde54adc722ec7085using AWScbx_299220109fd1. Its fixture and transport are unchanged between that main commit and this PR's base. No permission guard was bypassed. The configured desktop-worker carrier case is skipped; this run does not provide that hardware proof.Full UI E2E file results (ui/src/e2e/ prefix omitted)
Exact-head CI is green: run 38542585370, with 54 successful checks and 38 conditional skips. The head is unchanged since this run.
Release-note context: bound automatic older-history filling after placement settles without restoring full-window reload paging or unused automatic prefetch requests.
The campaign lead owns review and landing. This ready PR has not been merged and must not merge automatically. No private capture was uploaded.