feat: add global loading, error, not-found states and reusable Logo component - #140
Merged
codebestia merged 3 commits intoJul 31, 2026
Conversation
Add the three App Router global route-state conventions and a shared brand mark component. - src/components/logo.tsx: reusable Logo with sm/md/lg size prop, optional wordmark, and explicit image dimensions to avoid layout shift - src/app/loading.tsx: centered Loader2 spinner route fallback - src/app/error.tsx: client error boundary implementing the error/reset contract, themed with the existing card and destructive-alert styles - src/app/not-found.tsx: themed 404 with links to /dashboard and /sign-in - src/lib/lucide-react.tsx: add RotateCcw, Compass and LogIn icons to the vendored icon shim that tsconfig maps lucide-react onto Closes ShadeProtocol#106 Closes ShadeProtocol#107 Closes ShadeProtocol#108 Closes ShadeProtocol#109
|
@Johnalex-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
The build's lint gate failed on four files unrelated to this PR's feature work, which kept CI red. All four are no-op fixes. - payment/[id]/page.tsx: drop unused Promise reject param - InvoiceRowActions.test.tsx: drop unused waitFor import - ProfileDetailsForm.test.tsx: @ts-ignore -> @ts-expect-error - ui/api-key-reveal.tsx: use optional catch binding for unused error npm run build now completes; vitest passes 27/27.
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.
Summary
Adds the three global Next.js App Router route-state conventions and a reusable brand
Logocomponent. None of these existed insrc/app/before, so unmatched routes, slow navigations, and render errors all fell back to Next's default unstyled UI.All four screens reuse the existing centered full-screen layout pattern from
sign-in-client.tsx(bg-background/max-w-md/rounded-lg border bg-card p-6 shadow-sm) so they read as part of the app.Issues
Closes #106
Closes #107
Closes #108
Closes #109
Changes
src/components/logo.tsx(#109)Reusable brand mark rendering
/shade_logo_transparent.pngalongside the "Shade" wordmark.sizeprop —sm(24px),md(28px, default),lg(32px). Themdandlgvalues match the sizes already hardcoded inSidebar.tsx/MobileNav.tsx(28px) andPublicPaymentLayout.tsx(32px), so it is a drop-in for all existing call sites.next/imagereceives explicitwidth/heightper size and the wordmark uses a fixed text size, so the box is reserved before the image loads.showWordmark={false}renders the mark alone for tight spaces (mobile nav, future public payment header).aria-hiddenwith an emptyaltto avoid announcing "Shade" twice; mark-only mode carriesalt="Shade".className/wordmarkClassName(merged viacn) so contexts like the sidebar can applytext-sidebar-foreground.src/app/loading.tsx(#106)Centered
Loader2+animate-spinfallback matching the spinner pattern insign-in-client.tsxandregister-client.tsx. Markedrole="status"/aria-live="polite"with ansr-only"Loading" label.src/app/error.tsx(#107)Client component implementing Next's error boundary contract (
error,reset).useEffect.error.digestwhen present for support correlation.Buttonwired toreset().src/app/not-found.tsx(#108)Themed 404. Offers both a primary "Go to dashboard" link and an outline "Sign in" link — as a server component it cannot read the client-side wallet session, so it exposes both paths rather than guessing auth state.
src/lib/lucide-react.tsx(supporting)tsconfig.jsonmapslucide-reactto this vendored shim, which only exports a hand-maintained subset of icons. AddedRotateCcw,Compass, andLogInin the existingIconBasestyle to support the new screens.Verification
npm run typecheck— passes cleannpm run lint— no errors (2 pre-existing<img>warnings remain, non-blocking)npx prettier --checkon all touched files — passesnpm run build— completes successfully, all 16 routes generated including/_not-foundnpx vitest run— 27/27 tests passing across 7 filesTesting notes
/does-not-exist) — themed 404 renders.<Logo size="sm" />is rendered at the foot of both the 404 and error screens.Note on the extra commit
The build's lint gate was already failing on
mainfor four files unrelated to this feature work, which kept CI red. Since this PR could not otherwise go green, those are fixed here in a separate commit (fix: resolve pre-existing lint errors blocking the build). All four are no-op changes:src/app/payment/[id]/page.tsx— dropped unusedrejectparamsrc/components/invoices/InvoiceRowActions.test.tsx— dropped unusedwaitForimportsrc/components/profile/ProfileDetailsForm.test.tsx—@ts-ignore→@ts-expect-errorsrc/components/ui/api-key-reveal.tsx— optional catch binding for unusederrorHappy to split these into their own PR if you'd rather keep this one scoped strictly to #106–#109.