Show entity 404s inside the dashboard shell

オープン
#5,304 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript
領域
frontend, testing

調査の方向性

Read packages/client/src/router/config.tsx to trace the dashboard layout and its errorElement, then use packages/client/src/router/__tests__/tax-category-route.test.tsx as the router-level test harness. Reproduce a loader 404 or error on an entity detail route and add an error boundary so the dashboard shell stays mounted. Done when the test confirms the sidebar and header remain visible while the error appears in the content area.

索引モデルが issue の本文から書いたものです。

説明

Problem

When an entity detail page's loader throws (an unknown id gives a 404, or a network failure), the router renders ErrorBoundary from the dashboard route's errorElement in packages/client/src/router/config.tsx. React Router replaces that route's whole element with the error element. So a "Page Not Found" for a bad business or tax category id shows without the dashboard shell: no sidebar, no navigation.

This applies to every detail route under the dashboard (/businesses/:id, /tax-categories/:id, charges and others), and predates the tax category work. It is only rarer now, because a tax category id opened as a business redirects instead of failing.

Proposal

Render loader errors inside the shell. Add an errorElement on a pathless layout route below the dashboard layout, or on the detail routes themselves, so the sidebar and header stay mounted and only the content area shows the error. Keep the root-level boundary for errors in the layout itself.

The router-level test harness in packages/client/src/router/__tests__/tax-category-route.test.tsx (real routes, createMemoryRouter, stubbed layouts) is a good base for a test.

Done when

A loader 404 or error on an entity detail page shows the error inside the dashboard shell, with a router-level test asserting the shell stays mounted.

主要言語
TypeScript
スター
30
フォーク
10
平均マージ
2日 12時間
マージ済み PR(30日)
276

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Urigo/accounter-fullstack のほかの issue

Urigo/accounter-fullstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。