refactor(renderer): route all Phosphor icon imports through ui/icons barrel
Create src/renderer/components/ui/icons.ts as the single re-export point
for every Phosphor icon the renderer touches, then rewrite the 95 files
that previously imported directly from "@phosphor-icons/react" to pull
from the relative-path-to-barrel instead. The TitleBar commit earlier
in this series already used ui/icons; this commit extends the pattern
to the rest of the renderer.
Benefits now wired in:
- one location where bundle tree-shaking can be reasoned about,
- typos like Briefcase vs BriefCase show up against a finite list,
- re-theming or swapping icon sets is a one-file edit,
- a lint rule that flags raw @phosphor-icons/react imports can be
added later without mass-rewriting call sites.
The barrel also re-exports the `Icon` type so call sites that type
icon props against the Phosphor component type work unchanged.
Test count stays at 363 passing; typecheck stays at 156 errors.
This commit is contained in:
1 parent
364f1683e3
commit
75022f82c5
95 files changed
+424
-94
No files matched your search
@@ -6,7 +6,7 @@ import {
|
||||
Target,
|
||||
TerminalWindow,
|
||||
UsersThree,
|
||||
} from "@phosphor-icons/react";
|
||||
} from "../components/ui/icons";
|
||||
import type { AgentRecord, GoalRecord, ProjectRecord, RunRecord, SectionId, TaskRecord } from "@shared/types";
|
||||
import { ListFrame, ListRow, StatusPill } from "../components/ui";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMemo } from "react";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { FolderOpen, TerminalWindow, X } from "@phosphor-icons/react";
|
||||
import { FolderOpen, TerminalWindow, X } from "../components/ui/icons";
|
||||
import type { RunRecord } from "@shared/types";
|
||||
import { ActionButton, Select, StatusPill } from "../components/ui";
|
||||
import { formatMoney, formatTime } from "../lib/formatters";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { WarningCircle } from "@phosphor-icons/react";
|
||||
import { WarningCircle } from "../components/ui/icons";
|
||||
import type { SectionId } from "@shared/types";
|
||||
import { ErrorBoundary } from "../components/ui";
|
||||
import { OrganizationSections } from "./sections/OrganizationSections";
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
Plus,
|
||||
SidebarSimple,
|
||||
Trash,
|
||||
} from "@phosphor-icons/react";
|
||||
} from "../components/ui/icons";
|
||||
import type { CompanyRecord, ProfileSnapshot, SectionId } from "@shared/types";
|
||||
import { SectionButton } from "../components/ui";
|
||||
import { NEW_ENTITY_ID } from "../lib/constants";
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
Kanban,
|
||||
ListChecks,
|
||||
Target,
|
||||
} from "@phosphor-icons/react";
|
||||
} from "../../components/ui/icons";
|
||||
import { ConnectorEditor } from "../../components/connectors";
|
||||
import { KanbanBoard } from "../../components/dashboard";
|
||||
import { TwoPaneLayout } from "../../components/TwoPaneLayout";
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
Target,
|
||||
UserPlus,
|
||||
Kanban,
|
||||
} from "@phosphor-icons/react";
|
||||
} from "../../components/ui/icons";
|
||||
import {
|
||||
AgentCreator,
|
||||
AgentEditor,
|
||||
|
||||
Reference in new issue
Block a user