refactor(checkin): propagate useApiResource + add background reload#44
Merged
Conversation
Migrate checkin's 5 hand-rolled GET fetch state machines to the shared useApiResource hook (from #43), and consolidate the 4 near-identical full-screen error screens into a checkin-local CheckinErrorScreen. Loading skeletons stay content-aware/page-local; signage stays as-is (polling). Auth untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The shared useApiResource gains a backward-compatible reload({ background })
(stale-while-revalidate); history's 更新 and admin's refresh/mutation
refetch opt in to avoid the skeleton flash.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ource
reload({ background: true }) keeps current data visible during refetch
instead of flipping to loading, for flicker-free refresh buttons.
Backward compatible: default is the existing loading behavior.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rors Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… refresh) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…refetch Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The prune useEffect depended on presentIdSet, which is recreated every render while state != ok (sessions = data?.sessions ?? [] makes a fresh [] each render), so the effect ran every render and setSelectedIds (ids.filter always returns a new array) re-rendered forever — "Maximum update depth exceeded" on the loading screen. The effect was also redundant: selectedPresentIds already filters selectedIds by presentIdSet at use-time, and every consumer (count, checkbox state, checkout) reads the present-filtered value, so stale stored selections are inert. Deleting the effect fixes the loop with no behavioral change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
@copilot This is MAJOR UPDATE, right? please CONFIRM that there is NO fatal bug. ok? |
Contributor
現時点の検証では fatal bug は検出されていません。根拠として、 |
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.
概要
checkin の手書き fetch ステートマシン 5 箇所を共有
useApiResourceに統合し、ほぼ同一だった全画面エラー 4 箇所を checkin-local のCheckinErrorScreenに集約。あわせて共有フックに 後方互換のreload({ background })(stale-while-revalidate)を追加し、history の「更新」と admin の更新/ミューテーション後再取得のスケルトンちらつきを解消した。挙動・エンドポイント・debounce・motion・キオスク UX・表示文言は不変。signage と認証は対象外。設計:
docs/superpowers/specs/2026-06-02-checkin-data-layer-propagation-design.md計画:
docs/superpowers/plans/2026-06-02-checkin-data-layer-propagation.md変更内容
packages/ui:useApiResourceにreload({ background })を追加(既存呼び出しは引数なしのため挙動不変)。apps/checkin: 新規CheckinErrorScreen/5 ページ移行(first-time・history・reception/[id]・manual・guideline)。AbortController・cache:'no-store'・fetch 用type Stateを撤去。複合ステート(reception=Action/guideline=MutationState)は取得状態と分離。apps/admin: dashboard 更新 + mentors/pre-registrations のミューテーション後再取得(計 6 箇所)をreload({ background: true })に。検証
pnpm --filter @tecnova/ui --filter checkin --filter admin type-checkgreen、pnpm biome check(85 files)clean。マージ順
単独 PR(スタックしない)。
develop直接。🤖 Generated with Claude Code