Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

chore(web): remove unused Spinner, LoadingIndicator, and ThemeToggle

Naiyuan Qing1dd8ca86c389
diff --git a/apps/web/components/loading-indicator.tsx b/apps/web/components/loading-indicator.tsx
deleted file mode 100644
index 541f3783ae..0000000000
--- a/apps/web/components/loading-indicator.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-"use client";
-
-import { Spinner } from "@/components/spinner";
-import { cn } from "@multica/ui/lib/utils";
-
-export type LoadingVariant = "generating" | "streaming";
-
-interface LoadingIndicatorProps {
- variant: LoadingVariant;
- className?: string;
-}
-
-const VARIANT_TEXT: Record<LoadingVariant, string> = {
- generating: "Generating...",
- streaming: "Streaming...",
-};
-
-/**
- * Unified loading indicator for chat.
- * Use "generating" when waiting for AI response (no content yet).
- * Use "streaming" when content is actively being received.
- */
-export function LoadingIndicator({ variant, className }: LoadingIndicatorProps) {
- return (
- <div className={cn("flex items-center gap-2 py-1 text-muted-foreground", className)}>
- <Spinner className="text-xs" />
- <span className="text-xs">{VARIANT_TEXT[variant]}</span>
- </div>
- );
-}
diff --git a/apps/web/components/spinner.tsx b/apps/web/components/spinner.tsx
deleted file mode 100644
index 9328784ea9..0000000000
--- a/apps/web/components/spinner.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Spinner — 3x3 grid pulse for **active processing / execution** states.
- *
- * Use when the system is actively doing work or waiting for human action
- * (streaming content, generating responses, awaiting approval).
- * For passive content-loading states, use `<Loading />` instead.
- *
- * Inherits color from `currentColor` (use Tailwind `text-*`).
- * Scales with font-size (use Tailwind `text-*` for size).
- */
-import { cn } from "@multica/ui/lib/utils"
-
-export interface SpinnerProps {
- /** Additional className for styling (color via text-*, size via Tailwind text-*) */
- className?: string
-}
-
-const DELAYS = [0.2, 0.3, 0.4, 0.1, 0.2, 0.3, 0, 0.1, 0.2]
-
-const cubeStyle: React.CSSProperties = {
- backgroundColor: "currentColor",
- animation: "spinner-grid 1.3s infinite ease-in-out",
- transform: "scale3d(0.5, 0.5, 1)",
-}
-
-export function Spinner({ className }: SpinnerProps) {
- return (
- <span
- className={cn(className)}
- role="status"
- aria-label="Loading"
- style={{
- display: "inline-grid",
- gridTemplateColumns: "repeat(3, 1fr)",
- width: "1em",
- height: "1em",
- gap: "0.08em",
- }}
- >
- {DELAYS.map((delay, i) => (
- <span key={i} style={{ ...cubeStyle, animationDelay: `${delay}s` }} />
- ))}
-
- <style>{`@keyframes spinner-grid{0%,70%,100%{transform:scale3d(.5,.5,1)}35%{transform:scale3d(0,0,1)}}`}</style>
- </span>
- )
-}
diff --git a/apps/web/components/theme-toggle.tsx b/apps/web/components/theme-toggle.tsx
deleted file mode 100644
index 865269ac61..0000000000
--- a/apps/web/components/theme-toggle.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-"use client"
-
-import { useTheme } from "next-themes"
-import { Sun, Moon, Monitor } from "lucide-react"
-import {
- DropdownMenu,
- DropdownMenuTrigger,
- DropdownMenuContent,
- DropdownMenuItem,
-} from "@multica/ui/components/ui/dropdown-menu"
-import { SidebarMenuButton } from "@multica/ui/components/ui/sidebar"
-
-export function ThemeToggle() {
- const { setTheme } = useTheme()
-
- return (
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <SidebarMenuButton>
- <Sun className="dark:hidden" />
- <Moon className="hidden dark:block" />
- <span>Theme</span>
- </SidebarMenuButton>
- }
- />
- <DropdownMenuContent side="top" align="start">
- <DropdownMenuItem onClick={() => setTheme("light")}>
- <Sun /> Light
- </DropdownMenuItem>
- <DropdownMenuItem onClick={() => setTheme("dark")}>
- <Moon /> Dark
- </DropdownMenuItem>
- <DropdownMenuItem onClick={() => setTheme("system")}>
- <Monitor /> System
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- )
-}