Skip to content

feat(admin): instant interactive shell + render-crash boundaries#42

Merged
ut42tech merged 3 commits into
refactor/admin-data-layerfrom
feat/admin-resilience-shell
Jun 2, 2026
Merged

feat(admin): instant interactive shell + render-crash boundaries#42
ut42tech merged 3 commits into
refactor/admin-data-layerfrom
feat/admin-resilience-shell

Conversation

@ut42tech
Copy link
Copy Markdown
Owner

@ut42tech ut42tech commented Jun 2, 2026

Sub-project 2(耐障害性+即時インタラクティブシェル)。コールドロードでサイドバー等のクロームを即描画し、ロール依存部だけスケルトンにする。

変更

  • 共有 MeProvider を分離: 状態のみの MeProvider(/api/me 取得・401 遷移・常に children 描画・状態提供)+ ゲートを担う MeGate(ok のときだけ children、それ以外は loading/forbidden/error)。useMe() は non-null のまま(ゲート内専用)、新規 useMeState() がクローム用。後方互換(contract 変更は atomic)。
  • checkin / signage: content を <MeGate> で包むだけ(props を移送)=挙動不変。
  • admin 即時シェル: AppShell をゲートの外で描画。sidebar/bottom-nav/mobile-top-baruseMeState() を読み、/api/me 解決まではスケルトンのナビ/アカウント、解決後に実ロール別ナビ。本文は MeGate でゲート。
  • (authed)/error.tsx + root error.tsx(描画時 throw を捕捉、DataError+再試行)。(authed)/loading.tsx(シェル永続によりナビ時のコンテンツスケルトンが有効)。

検証

  • type-check: ui/admin/signage green(checkin の失敗は gitignore 済み生成物 .next/.../validator.ts のみ=起動中 dev サーバの typegen 由来でソース無関係)。Biome green(60ファイル)。
  • Playwright(admin): ローディング中にサイドバー+ブランド+スケルトンナビ(デスクトップ/モバイル両方)、ok で実ナビ+アカウント、403 で MeGate forbidden。checkin/signage は移設後のゲートでモジュール/描画エラーなしを smoke 確認。

stacked PR

refactor/admin-data-layer#41)の上に積んでいる。マージ順: #40#41 → 本PR(各マージで develop へ自動リターゲット)。

🤖 Generated with Claude Code

ut42tech and others added 3 commits June 2, 2026 19:53
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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tecnova-platform-admin Ready Ready Preview, Comment Jun 2, 2026 11:16am
tecnova-platform-checkin Ready Ready Preview, Comment Jun 2, 2026 11:16am
tecnova-platform-signage Ready Ready Preview, Comment Jun 2, 2026 11:16am

@ut42tech ut42tech merged commit 57c18a1 into refactor/admin-data-layer Jun 2, 2026
5 checks passed
@ut42tech ut42tech deleted the feat/admin-resilience-shell branch June 2, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant