Update the intro #28
fuko merged thisd5e0120
fuko closed this
- @@ -1,14 +1,13 @@11 import { useNavigate } from "@tanstack/react-router";22 import { ArrowRightIcon, DatabaseZap } from "lucide-react";33 import { AnimatePresence, motion } from "motion/react";4-import { useCallback, useState } from "react";4+import { useCallback, useState, type ReactNode } from "react";55 import { cn } from "@/lib/utils";66 import { Button } from "./ui/button";77 import {88 Card,99 CardContent,10- CardDescription,1110 CardFooter,1211 CardHeader,1312 CardTitle,1413 } from "./ui/card";src/components/HomeIntro.tsx lines 97 to 98Outdated@@ -106,8 +86,13 @@106- </li>107- ))}108- </ul>109- <p>110- Follow the guide, inspect the requests, check the source code,111- have fun!112- </p>113- </div>86+ </a>{" "}87+ is a library that makes it really easy to build ⚡blazing fast⚡88+ front-ends.89+ </p>90+ <WavyLine />91+ <ul className="pl-4">92+ <FeatureItem>93+ <Bold>user actions feel instant</Bold> – updates show94+ immediately while sync happens in the background95+ </FeatureItem>96+ <FeatureItem>97+ <Bold>fetch data once, use everywhere</Bold> – Tanstack DB98+ keeps it up to datesrc/routes/__root.tsx lines 116 to 117Outdated@@ -60,5 +97,21 @@97+ return (98+ <ClientOnly>99+ <Button100+ className="w-fit mx-auto"101+ variant="destructive"102+ onClick={removeDB}103+ >104+ <RotateCwIcon /> Reset the db105+ </Button>106+ <p className="text-destructive font-bold text-center">{errorMessage}</p>107+ </ClientOnly>108+ );109+}110+60111 function ErrorComponent({ error }: { error: unknown }) {61112 const isServiceWorkerError =62113 error instanceof Error &&63114 error.message.includes("navigator.serviceWorker.addEventListener");64115116+ const isDbQueryError =117+ error instanceof Error && error.message.startsWith("Failed query: ");
Sign in to join this conversation.
Caution
Review failed#
The pull request is closed.
Walkthrough#
Refactored HomeIntro UI and modal styling, added a new exported
idbNamein DB module, introduced an IndexedDB reset flow (RemoveDB) wired into the root ErrorComponent for database-query failures, and renamed the HomeIntro prop fromshow_home_introtointro.Changes#
src/components/HomeIntro.tsxBold,FeatureItem,WavyLine), migrated to CardHeader/CardContent structure, updated modal backdrop blur, badge text/color changes, simplified copy, changed primary action to "Get started", and added avatar border.src/routes/_tutorial.tsxshow_home_intro={intro}tointro={intro}(prop rename usage only).src/db/index.tsidbName = \/pglite/${dbName.replace("idb://", "")}`` with JSDoc; no runtime behavior change.src/routes/__root.tsxRemoveDBcomponent and client-only UI to delete IndexedDB, wired into ErrorComponent to detect "Failed query:" errors, render recovery UI with icon/button, manage loading/error states, and reload on success; updated SEO description and error header styling.Sequence Diagram(s)#
Estimated code review effort#
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs#
#27: Adjusts HomeIntro prop usage fromshow_home_introtointroinsrc/routes/_tutorial.tsx(same line changed).#26: Related renaming/route handling for tutorial intro flag aligning withintroprop semantics.Pre-merge checks and finishing touches#
❌ Failed checks (1 warning, 1 inconclusive)
@coderabbitai generate docstringsto improve docstring coverage.✅ Passed checks (1 passed)
📜 Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 37e71bc6cae2638a53ef2f8f4b2a761443717de9 and 05a40ffb96eaffe9ba07406a56d4545f424e2ce7.
📒 Files selected for processing (2)
src/components/HomeIntro.tsxsrc/db/index.tsComment `@coderabbitai help` to get the list of available commands and usage tips.