Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

feat(ui): Add a better content fetching loading state in the bookmark preview

Mohamed Bassembe090270bf50
diff --git a/apps/web/components/dashboard/preview/BookmarkPreview.tsx b/apps/web/components/dashboard/preview/BookmarkPreview.tsx
index 719cdff8..f1ed039c 100644
--- a/apps/web/components/dashboard/preview/BookmarkPreview.tsx
+++ b/apps/web/components/dashboard/preview/BookmarkPreview.tsx
@@ -5,7 +5,6 @@ import Link from "next/link";
import { BookmarkTagsEditor } from "@/components/dashboard/bookmarks/BookmarkTagsEditor";
import { FullPageSpinner } from "@/components/ui/full-page-spinner";
import { Separator } from "@/components/ui/separator";
-import { Skeleton } from "@/components/ui/skeleton";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -17,7 +16,13 @@ import { useSession } from "@/lib/auth/client";
import useRelativeTime from "@/lib/hooks/relative-time";
import { useTranslation } from "@/lib/i18n/client";
import { useQuery } from "@tanstack/react-query";
-import { Building, CalendarDays, ExternalLink, User } from "lucide-react";
+import {
+ Building,
+ CalendarDays,
+ ExternalLink,
+ Globe,
+ User,
+} from "lucide-react";
import { useTRPC } from "@karakeep/shared-react/trpc";
import { BookmarkTypes, ZBookmark } from "@karakeep/shared/types/bookmarks";
@@ -38,11 +43,13 @@ import { NoteEditor } from "./NoteEditor";
import { TextContentSection } from "./TextContentSection";
function ContentLoading() {
+ const { t } = useTranslation();
return (
- <div className="flex w-full flex-col gap-2">
- <Skeleton className="h-4" />
- <Skeleton className="h-4" />
- <Skeleton className="h-4" />
+ <div className="flex h-full w-full flex-col items-center justify-center gap-4">
+ <Globe className="h-12 w-12 animate-bounce text-muted-foreground" />
+ <p className="text-sm text-muted-foreground">
+ {t("preview.crawling_in_progress")}
+ </p>
</div>
);
}
diff --git a/apps/web/lib/i18n/locales/en/translation.json b/apps/web/lib/i18n/locales/en/translation.json
index 1fd6bd91..12d7a082 100644
--- a/apps/web/lib/i18n/locales/en/translation.json
+++ b/apps/web/lib/i18n/locales/en/translation.json
@@ -833,6 +833,7 @@
"archive_info": "Archives may not render correctly inline if they require Javascript. For best results, <1>download it and open in your browser</1>.",
"fetch_error_title": "Content Unavailable",
"fetch_error_description": "We couldn't fetch the content for this link. The page may be protected, require authentication, or be temporarily unavailable.",
+ "crawling_in_progress": "Fetching page content…",
"tabs": {
"content": "Content",
"details": "Details"