From db8c50c663f4703bef4d5caf1b095e34826e25fb Mon Sep 17 00:00:00 2001 From: Justin Middler Date: Thu, 30 Jul 2026 14:29:54 +1000 Subject: [PATCH 1/2] refactor(web): delete unreachable legacy chat and search UI ADR 0006 removed chat and room UI from the product surface. The pages at app/rooms/, app/rooms/admin/, app/rooms/[slug]/ and app/search/ call redirect("/") unconditionally with no env gate, so their entire component trees have been unreachable since that change. Deleted (verified by grep to have no remaining importers): - components/room-view.tsx (2895 lines) - no importers - components/room-composer.tsx (983 lines) - imported only by room-view - components/rooms-browser.tsx (795 lines) - no importers - components/app-shell.tsx (597 lines) - imported only by the four dead views - components/room-admin-view.tsx (243 lines) - no importers - components/search-view.tsx (225 lines) - no importers - components/command-palette.tsx (169 lines) - imported only by app-shell - components/operations-chart.tsx (36 lines) - no importers Pruned 722 lines of lib/demo-data.ts whose only consumers were the deleted components: demoOrganisation, demoPeople, demoAgents, demoRooms, demoDirectRooms, roomIdBySlug, demoAlerts, roomTimeline, needsAttention, activeIncidents, investigationQueue, platformHealth, operationsTrend and searchResults. Deliberately kept: - The four redirect page files. Removing them would turn a working redirect into a 404 for anyone holding an old /rooms or /search bookmark. - components/investigation-view.tsx, components/integration-view.tsx and components/workflows-view.tsx. These are reachable when MUSTER_DEMO_MODE=true and are a deliberate demo surface, not dead code. - lib/demo-data.ts exports activeInvestigation, integrationData, workflows, workflowYaml and the Severity type, still consumed by those demo views, plus the starterIds/demoIds tables that mirror packages/database/src/seed-data.ts. - components/severity.tsx, still imported by investigation-view.tsx. No behaviour change: typecheck, lint, test and build are clean, and the /rooms, /rooms/[slug], /rooms/admin and /search routes still build and still redirect to /. Co-Authored-By: Claude Opus 5 (1M context) --- apps/web/components/app-shell.tsx | 597 ----- apps/web/components/command-palette.tsx | 169 -- apps/web/components/operations-chart.tsx | 36 - apps/web/components/room-admin-view.tsx | 243 -- apps/web/components/room-composer.tsx | 983 -------- apps/web/components/room-view.tsx | 2895 ---------------------- apps/web/components/rooms-browser.tsx | 795 ------ apps/web/components/search-view.tsx | 225 -- apps/web/lib/demo-data.ts | 722 ------ 9 files changed, 6665 deletions(-) delete mode 100644 apps/web/components/app-shell.tsx delete mode 100644 apps/web/components/command-palette.tsx delete mode 100644 apps/web/components/operations-chart.tsx delete mode 100644 apps/web/components/room-admin-view.tsx delete mode 100644 apps/web/components/room-composer.tsx delete mode 100644 apps/web/components/room-view.tsx delete mode 100644 apps/web/components/rooms-browser.tsx delete mode 100644 apps/web/components/search-view.tsx diff --git a/apps/web/components/app-shell.tsx b/apps/web/components/app-shell.tsx deleted file mode 100644 index b0cd9f7..0000000 --- a/apps/web/components/app-shell.tsx +++ /dev/null @@ -1,597 +0,0 @@ -"use client"; - -import Image from "next/image"; -import Link from "next/link"; -import { usePathname, useRouter } from "next/navigation"; -import { useEffect, useState, type ReactNode } from "react"; -import { - Bell, - Bookmark, - ChevronDown, - ChevronLeft, - ChevronRight, - CircleCheck, - Hash, - House, - ListTodo, - LogOut, - Menu, - Moon, - PanelRightOpen, - Search, - Settings, - SquarePen, - Sun, - X, -} from "lucide-react"; -import { authClient } from "@muster/auth/client"; -import { Avatar } from "@/components/ui/avatar"; -import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; -import { CommandPalette } from "@/components/command-palette"; -import { - demoDirectRooms, - demoMode, - demoOrganisation, - demoRooms, -} from "@/lib/demo-data"; -import { cn } from "@/lib/utils"; - -type NavigationRoom = { - id: string; - slug: string; - displayName: string; - topic: string; - roomType: string; - favourite: boolean | null; - muted: boolean | null; - sidebarPosition: number | null; - sidebarGroup: string | null; - unreadCount?: number; - mentionCount?: number; -}; - -const initialNavigationRooms: NavigationRoom[] = [ - ...demoRooms.map((room) => ({ - id: roomIdFromSlug(room.slug), - slug: room.slug, - displayName: room.name, - topic: room.topic, - roomType: "operations", - favourite: room.favourite, - muted: false, - sidebarPosition: 0, - sidebarGroup: null, - unreadCount: room.unread, - mentionCount: room.mentions, - })), - ...demoDirectRooms.map((room) => ({ - id: roomIdFromSlug(room.slug), - slug: room.slug, - displayName: room.name, - topic: room.topic, - roomType: "direct", - favourite: false, - muted: false, - sidebarPosition: 0, - sidebarGroup: null, - unreadCount: 0, - mentionCount: 0, - })), -]; - -function roomIdFromSlug(slug: string) { - return `demo:${slug}`; -} - -function initials(name: string) { - return name - .split(/\s+/) - .slice(0, 2) - .map((part) => part[0] ?? "") - .join("") - .toUpperCase(); -} - -function NavGroup({ label, children }: { label: string; children: ReactNode }) { - const [expanded, setExpanded] = useState(true); - return ( -
- - {expanded &&
{children}
} -
- ); -} - -function ChannelLink({ - room, - onNavigate, -}: { - room: NavigationRoom; - onNavigate: (() => void) | undefined; -}) { - const pathname = usePathname(); - const active = pathname === `/rooms/${room.slug}`; - return ( - -