fix(ui): bound progressive fill idle so long transcripts settle - #2259
Merged
Conversation
Bare requestIdleCallback could starve under CI load, leaving a 90-turn overflowing rail mid-fill past Playwright's 10s count timeout. Share one browser scheduler with an idle deadline and wait on data-progressive-fill in prompt-rail instead of racing chunk count.
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.
Summary
Main CI was failing on
e2e/prompt-rail.spec.ts→ the active tick stays visible once the rail overflows: expected 90.maka-turnnodes, received ~54–58 while the progressive fill was still climbing in steps of four.Root cause: progressive mount and turn-size warm-up schedule work with bare
requestIdleCallback(no deadline), so a busy CI main thread can starve fill for >10s. The prompt-railsettled()helper only raced turn count against Playwright’s default 10s expect timeout and did not wait on the publisheddata-progressive-fillend state.This PR:
createBrowserWarmupSchedulerwith{ timeout: 100 }on idle callbacks (fill + warm-up)data-progressive-fill="complete"in prompt-rail before asserting turn count / warm-upVerification
npm run build -w @maka/core && npm run build -w @maka/uinode --test packages/ui/dist/__tests__/browser-warmup-scheduler.test.js packages/ui/dist/__tests__/turn-size-warmup.test.js packages/ui/dist/__tests__/chat-view-progressive-mount.test.js→ passnpm run lint/npm run format:check→ passprompt-railsuite not run locally (Electron E2E); relies on CIe2e_shardRoot cause
Unrelated main merges (#2198, #2214) were canaries: the flake is progressive-fill scheduling + a test that ignored the fill’s own completion attribute.