feat(admin): instant interactive shell + render-crash boundaries#42
Merged
Merged
Conversation
MeProvider split into state-only MeProvider + MeGate (backward-compatible: checkin/signage wrap content in MeGate, behavior unchanged). admin renders the shell chrome outside the gate (skeleton nav/account until /api/me), plus (authed)/error.tsx + root error.tsx + (authed)/loading.tsx. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Split the shared MeProvider into a state-only MeProvider (fetches /api/me, handles 401, always renders children + provides state) and a MeGate that does the gating (renders content only when ok, else loading/forbidden/error). useMe() keeps its non-null signature (safe inside a gate); new useMeState() feeds the shell. This is an atomic contract change, so all consumers move together: - checkin / signage: wrap content in <MeGate> (props moved over) — behavior unchanged (the gate logic is the same code, just relocated). - admin: AppShell renders OUTSIDE the gate so the sidebar/top-bar chrome + brand logo paint immediately; sidebar/bottom-nav/mobile-top-bar use useMeState() and show skeleton nav/account until /api/me resolves, then the real role-filtered nav. Page content stays gated by <MeGate>. Verified: admin shows the shell + skeleton nav during loading (desktop & mobile), real nav/account on ok, MeGate forbidden on 403; checkin/signage render through the relocated gate with no module/render errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- (authed)/error.tsx and root error.tsx ('use client') catch render-time
throws that the per-page try/catch can't, reusing DataError + a reset button.
- (authed)/loading.tsx renders a content skeleton during soft navigation;
meaningful now that the shell persists across navigations.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Sub-project 2(耐障害性+即時インタラクティブシェル)。コールドロードでサイドバー等のクロームを即描画し、ロール依存部だけスケルトンにする。
変更
MeProviderを分離: 状態のみのMeProvider(/api/me 取得・401 遷移・常に children 描画・状態提供)+ ゲートを担うMeGate(ok のときだけ children、それ以外は loading/forbidden/error)。useMe()は non-null のまま(ゲート内専用)、新規useMeState()がクローム用。後方互換(contract 変更は atomic)。<MeGate>で包むだけ(props を移送)=挙動不変。AppShellをゲートの外で描画。sidebar/bottom-nav/mobile-top-barはuseMeState()を読み、/api/me 解決まではスケルトンのナビ/アカウント、解決後に実ロール別ナビ。本文はMeGateでゲート。(authed)/error.tsx+ rooterror.tsx(描画時 throw を捕捉、DataError+再試行)。(authed)/loading.tsx(シェル永続によりナビ時のコンテンツスケルトンが有効)。検証
.next/.../validator.tsのみ=起動中 dev サーバの typegen 由来でソース無関係)。Biome green(60ファイル)。MeGateforbidden。checkin/signage は移設後のゲートでモジュール/描画エラーなしを smoke 確認。stacked PR
refactor/admin-data-layer(#41)の上に積んでいる。マージ順: #40 → #41 → 本PR(各マージで develop へ自動リターゲット)。🤖 Generated with Claude Code