Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat: replace loading indicators with a new LoadingSkeleton component for improved UI consistency

Andrej Acevskid4c7069da5ef
diff --git a/apps/web/src/components/providers/auth-provider/index.tsx b/apps/web/src/components/providers/auth-provider/index.tsx
index f930bb185..0aa647cc2 100644
--- a/apps/web/src/components/providers/auth-provider/index.tsx
+++ b/apps/web/src/components/providers/auth-provider/index.tsx
@@ -1,6 +1,5 @@
import useGetMe from "@/hooks/queries/use-get-me";
import type { LoggedInUser } from "@/types/user";
-import { LayoutGrid } from "lucide-react";
import {
type Dispatch,
type PropsWithChildren,
@@ -11,6 +10,7 @@ import {
useState,
} from "react";
import { ErrorDisplay } from "../../ui/error-display";
+import { LoadingSkeleton } from "../../ui/loading-skeleton";
export const AuthContext = createContext<{
user: LoggedInUser | null | undefined;
@@ -51,13 +51,7 @@ function AuthProvider({ children }: PropsWithChildren) {
}
if (isFetching || user === undefined) {
- return (
- <div className="flex w-full items-center justify-center h-screen flex-col md:flex-row bg-zinc-50 dark:bg-zinc-950">
- <div className="p-1.5 bg-linear-to-br from-indigo-500 to-purple-500 rounded-lg shadow-xs animate-spin">
- <LayoutGrid className="w-5 h-5 text-white" />
- </div>
- </div>
- );
+ return <LoadingSkeleton />;
}
return (
diff --git a/apps/web/src/components/ui/loading-skeleton.tsx b/apps/web/src/components/ui/loading-skeleton.tsx
new file mode 100644
index 000000000..46ee578e9
--- /dev/null
+++ b/apps/web/src/components/ui/loading-skeleton.tsx
@@ -0,0 +1,91 @@
+import { cn } from "@/lib/cn";
+
+interface LoadingSkeletonProps {
+ className?: string;
+}
+
+export function LoadingSkeleton({ className }: LoadingSkeletonProps) {
+ return (
+ <div className={cn("flex w-full h-svh bg-sidebar", className)}>
+ <div className="w-64 bg-sidebar border-r border-border flex flex-col">
+ <div className="p-3 border-b border-border">
+ <div className="flex items-center gap-2">
+ <div className="w-8 h-8 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ <div className="flex-1">
+ <div className="w-20 h-4 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ </div>
+ </div>
+ </div>
+
+ <div className="flex-1 p-3 space-y-6">
+ <div className="space-y-2">
+ <div className="flex items-center gap-2">
+ <div className="w-6 h-6 bg-zinc-200 dark:bg-zinc-800 rounded-full animate-pulse" />
+ <div className="flex-1">
+ <div className="w-16 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ </div>
+ </div>
+ </div>
+
+ <div className="space-y-1">
+ {["dashboard", "projects", "settings"].map((item) => (
+ <div
+ key={`nav-item-${item}`}
+ className="flex items-center gap-2 p-2 rounded"
+ >
+ <div className="w-4 h-4 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ <div className="w-20 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ </div>
+ ))}
+ </div>
+
+ <div className="space-y-2">
+ <div className="flex items-center gap-2">
+ <div className="w-3 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ <div className="w-16 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ </div>
+ <div className="ml-4 space-y-1">
+ {["issues", "projects", "views", "settings"].map((item) => (
+ <div
+ key={`workspace-item-${item}`}
+ className="flex items-center gap-2 p-1"
+ >
+ <div className="w-4 h-4 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ <div className="w-16 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ </div>
+ ))}
+ </div>
+ </div>
+ </div>
+
+ <div className="p-3 border-t border-border">
+ <div className="flex items-center gap-2">
+ <div className="w-6 h-6 bg-zinc-200 dark:bg-zinc-800 rounded-full animate-pulse" />
+ <div className="flex-1">
+ <div className="w-20 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div className="flex-1 flex flex-col bg-card border border-border rounded-md m-2">
+ <div className="h-12 border-b border-border flex items-center px-4">
+ <div className="flex items-center gap-2">
+ <div className="w-6 h-6 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ <div className="w-32 h-4 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse" />
+ </div>
+ </div>
+
+ <div className="flex-1 flex items-center justify-center">
+ <div className="text-center space-y-4">
+ <div className="w-16 h-16 bg-zinc-200 dark:bg-zinc-800 rounded-lg animate-pulse mx-auto" />
+ <div className="space-y-2">
+ <div className="w-48 h-4 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse mx-auto" />
+ <div className="w-64 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse mx-auto" />
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx
index 5ea9da56c..fb098a0e5 100644
--- a/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx
@@ -516,7 +516,13 @@ function RouteComponent() {
<BacklogListView project={filteredProject} />
) : (
<div className="flex h-full items-center justify-center">
- <div className="h-8 w-8 animate-spin rounded-full border-2 border-zinc-300 border-t-zinc-600 dark:border-zinc-700 dark:border-t-zinc-300" />
+ <div className="text-center space-y-4">
+ <div className="w-16 h-16 bg-zinc-200 dark:bg-zinc-800 rounded-lg animate-pulse mx-auto" />
+ <div className="space-y-2">
+ <div className="w-48 h-4 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse mx-auto" />
+ <div className="w-64 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse mx-auto" />
+ </div>
+ </div>
</div>
)}
</div>
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx
index f90ca8d67..d8fc4b4d1 100644
--- a/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx
@@ -6,12 +6,13 @@ import TaskDescription from "@/components/task/task-description";
import TaskInfo from "@/components/task/task-info";
import TaskTimeTracking from "@/components/task/task-time-tracking";
import TaskTitle from "@/components/task/task-title";
+import { LoadingSkeleton } from "@/components/ui/loading-skeleton";
import useGetTask from "@/hooks/queries/task/use-get-task";
import useGetTasks from "@/hooks/queries/task/use-get-tasks";
import useProjectStore from "@/store/project";
import { createFileRoute, useRouter } from "@tanstack/react-router";
import { motion } from "framer-motion";
-import { LayoutGrid, X } from "lucide-react";
+import { X } from "lucide-react";
import { useEffect, useState } from "react";
export const Route = createFileRoute(
@@ -35,13 +36,7 @@ function TaskEditPage() {
}, [project, setProject]);
if (isLoading) {
- return (
- <div className="flex w-full items-center justify-center h-screen flex-col md:flex-row bg-zinc-50 dark:bg-zinc-950">
- <div className="p-1.5 bg-linear-to-br from-indigo-500 to-purple-500 rounded-lg shadow-xs animate-spin">
- <LayoutGrid className="w-5 h-5 text-white" />
- </div>
- </div>
- );
+ return <LoadingSkeleton />;
}
return (
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId/search.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId/search.tsx
index ea3174464..30cf92fae 100644
--- a/apps/web/src/routes/dashboard/workspace/$workspaceId/search.tsx
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId/search.tsx
@@ -75,9 +75,12 @@ function SearchComponent() {
{isSearching ? (
<div className="flex items-center justify-center py-12">
- <div className="text-center">
- <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4" />
- <p className="text-muted-foreground">Searching...</p>
+ <div className="text-center space-y-4">
+ <div className="w-16 h-16 bg-zinc-200 dark:bg-zinc-800 rounded-lg animate-pulse mx-auto" />
+ <div className="space-y-2">
+ <div className="w-48 h-4 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse mx-auto" />
+ <div className="w-64 h-3 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse mx-auto" />
+ </div>
</div>
</div>
) : (