fix(schedule): stop the whole agenda from unmounting on every calendar refetch - #370
Merged
LUPENGHAN merged 2 commits intoAug 24, 2026
Conversation
…r refetch loading was occurrencesLoading || locationsLoading, and the screen unmounts the entire agenda list whenever loading is true. Every refetch after the first (create/delete a schedule, a voice write, a confirm) briefly set it back to true, so the whole list flashed and remounted instead of just the changed row. loading now only reflects the very first load; later refetches update data in place.
yyy-router
previously approved these changes
Aug 24, 2026
Contributor
There was a problem hiding this comment.
Reviewed the initial-load transition, background refetch behavior, retry/error paths, and the ScheduleCalendarScreen loading consumer. The successful-first-load refetch path matches issue #369, but the initial-error retry path loses its loading state. git diff --check passes; the focused Jest test suite was not run because dependencies are not installed in the mounted workspace.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…fetch fails initialLoadDone flipped as soon as both requests settled, regardless of success. If the first load failed, retrying it left loading false, so the screen rendered the empty/stale agenda instead of the full-screen first-load state. It now only locks once both requests succeed. fennoai review on 1024XEngineer#370.
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.
Fixes #369
Summary
useScheduleCalendar的loading是occurrencesLoading || locationsLoading,ScheduleCalendarScreen用它整体包住 agenda 列表——loading一变true就把整个列表卸载换成全屏转圈,数据回来再整个重新挂载。true(也就是真的还没数据)时,loading才会是true。首次加载完成后就永久锁定,之后的重取只在后台悄悄换occurrencesByDate/locationSchedules,agenda 不再卸载。useEffect里 setState),跟这个仓库其他地方处理派生状态的写法一致,也避免多触发一轮级联渲染。Test plan
useScheduleCalendar.test.ts用例:首次加载完成后触发retry(),确认第二次请求已发出但loading仍是false。npm run lint/npm run format:check/npm run typecheck/npm run test(jest 713 + vitest 87)全绿。🤖 Generated with Claude Code