Repository navigation
Conversation
A pending passive effect can clear a request before its loading state commits. Hand focus over in a layout effect and reproduce the lost request before passive effects flush. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 of 5 tasks
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #1076
Related: #1059
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Loading the last page keeps keyboard focus on a newly added row when the Load more button disappears.
Why
A pending passive effect can consume a pagination focus request written after its render. When the last page removes Load more, the request has already been cleared and focus stays on the page. Perform the handoff in the layout effect for the commit that owns it.
Scope and risk
Changes the shared final-page focus hook and adds a deterministic regression that starts a read before the previous render's passive effects flush. The hook also serves synchronous Show more controls; the existing intermediate-page, explicit user focus and fallback guards still apply. The risk is focus moving at the wrong commit.
Compatibility, rollout and rollback
Tests
npm --prefix frontend run test -- src/lib/useLastPageFocus.test.tsx --maxWorkers=1produced the predicted new failure with focus on the page; all four existing controls passed.useLastPageFocus.test.tsxsuite passes all five cases under the bounded local supervisor on the preceding main composition.git diff --checkpass.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Codex wrote the change and inspected the failing log, effect ordering and regression result. Independent agent review checks the complete diff and related callers.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.main; no migration changes.