fix(web): keep the reader's line when Load full history stands in for Reload (#814)

- The notice's Load full history button pulls with anchor 'content' when
  Reload history is eligible (read at click time, since the bar only
  re-renders on eligibility transitions) and keeps 'top' otherwise.
- Tests: the single load control asserts the content anchor; an
  ineligible session keeps the top anchor.
This commit is contained in:
Hadrien Kerlero committed 2026-11-22 02:44:24 +01:00
1 parent b3698756a2
commit 6311e59412
3 files changed
+24 -3

No files matched your search

+6 -1
View File
@@ -10035,7 +10035,12 @@ class CodemanApp {
btn.disabled = true;
btn.textContent = 'Loading…';
// Forced: the cooldown exists to throttle scroll gestures, not choices.
this._maybeRefetchFullHistory({ force: true }).finally(() => {
// When Reload history is eligible, this button is shown in its place
// (one load control per bar), so it must keep the reader's line the same
// way. Checked at click time, not render time: the bar only re-renders on
// eligibility transitions, and the reader may have scrolled since.
const anchor = this._historyReloadActionEligible() ? 'content' : 'top';
this._maybeRefetchFullHistory({ force: true, anchor }).finally(() => {
this._renderHistoryTruncationBanner();
});
};