Skip to content

Commit 771341a

Browse files
committed
refactor(web): remove icon morphing
Toggle and copy icons swap instantly through lucide-react again. Drops the MorphIcon wrapper plus the morphicons and vanilla lucide dependencies that only it used.
1 parent 8ee7183 commit 771341a

36 files changed

Lines changed: 264 additions & 242 deletions

‎apps/web/package.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@
6868
"jsonc-parser": "3.3.1",
6969
"jszip": "3.10.1",
7070
"katex": "^0.18.2",
71-
"lucide": "^0.564.0",
7271
"lucide-react": "^0.564.0",
7372
"mdast-util-from-markdown": "^2.0.3",
7473
"micromark-util-combine-extensions": "^2.0.1",
75-
"morphicons": "^1.7.1",
7674
"pdfjs-dist": "6.4.299",
7775
"pele": "catalog:",
7876
"react": "catalog:",

‎apps/web/src/components/CommandBlock.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { Check, Copy } from "lucide";
1+
import { CheckIcon, CopyIcon } from "lucide-react";
22

3-
import { MorphIcon } from "~/components/MorphIcon";
43
import { useCopyToClipboard } from "~/hooks/useCopyToClipboard";
54
import { cn } from "~/lib/utils";
65

@@ -37,7 +36,7 @@ export function CommandBlock({
3736
aria-label="Copy command"
3837
onClick={() => copyToClipboard(command, undefined)}
3938
>
40-
<MorphIcon className="size-3.5" icon={isCopied ? Check : Copy} />
39+
{isCopied ? <CheckIcon className="size-3.5" /> : <CopyIcon className="size-3.5" />}
4140
</Button>
4241
</div>
4342
);

‎apps/web/src/components/DiffFilePathCopyButton.tsx‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { Check, Copy } from "lucide";
1+
import { CheckIcon, CopyIcon } from "lucide-react";
22
import { useRef } from "react";
33
import { useCopyToClipboard } from "../hooks/useCopyToClipboard";
4-
import { cn } from "../lib/utils";
54
import {
65
ANCHORED_COPY_TOAST_TIMEOUT_MS,
76
showAnchoredCopyErrorToast,
87
showAnchoredCopySuccessToast,
98
} from "./ui/anchoredCopyToast";
109
import { Button } from "./ui/button";
11-
import { MorphIcon } from "~/components/MorphIcon";
1210
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
1311

1412
export function DiffFilePathCopyButton({ filePath }: { filePath: string }) {
@@ -32,10 +30,7 @@ export function DiffFilePathCopyButton({ filePath }: { filePath: string }) {
3230
/>
3331
}
3432
>
35-
<MorphIcon
36-
className={cn("size-3", isCopied && "text-success")}
37-
icon={isCopied ? Check : Copy}
38-
/>
33+
{isCopied ? <CheckIcon className="size-3 text-success" /> : <CopyIcon className="size-3" />}
3934
</TooltipTrigger>
4035
<TooltipPopup>
4136
<p>{isCopied ? "Copied" : "Copy path"}</p>

‎apps/web/src/components/DiffPanel.tsx‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ import {
1717
PilcrowIcon,
1818
Rows3Icon,
1919
TextWrapIcon,
20+
ChevronRightIcon,
21+
ChevronsDownUpIcon,
22+
ChevronsUpDownIcon,
2023
} from "lucide-react";
21-
import { ChevronDown, ChevronRight, ChevronsDownUp, ChevronsUpDown } from "lucide";
2224
import * as Schema from "effect/Schema";
2325
import { type MouseEvent, useEffect, useRef, useState } from "react";
2426
import { useCodeViewFileReveal } from "./diffs/useCodeViewFileReveal";
@@ -70,7 +72,6 @@ import { DiffFileTree } from "./diffs/DiffFileTree";
7072
import { FileExplorerPane } from "./files/FileExplorerPane";
7173
import { diffFileTreeEntries } from "./diffs/diffFileTree.logic";
7274
import { Button } from "./ui/button";
73-
import { MorphIcon } from "~/components/MorphIcon";
7475
import { ToggleGroup, Toggle } from "./ui/toggle-group";
7576
import { Switch } from "./ui/switch";
7677
import {
@@ -172,10 +173,11 @@ function DiffFileCollapseToggle({
172173
/>
173174
}
174175
>
175-
<MorphIcon
176-
className="size-4 text-muted-foreground/80"
177-
icon={collapsed ? ChevronRight : ChevronDown}
178-
/>
176+
{collapsed ? (
177+
<ChevronRightIcon className="size-4 text-muted-foreground/80" />
178+
) : (
179+
<ChevronDownIcon className="size-4 text-muted-foreground/80" />
180+
)}
179181
</TooltipTrigger>
180182
<TooltipPopup side="top">{collapsed ? "Expand diff" : "Collapse diff"}</TooltipPopup>
181183
</Tooltip>
@@ -1159,10 +1161,11 @@ export default function DiffPanel({
11591161
/>
11601162
}
11611163
>
1162-
<MorphIcon
1163-
className="size-3.5"
1164-
icon={allDiffFilesCollapsed ? ChevronsUpDown : ChevronsDownUp}
1165-
/>
1164+
{allDiffFilesCollapsed ? (
1165+
<ChevronsUpDownIcon className="size-3.5" />
1166+
) : (
1167+
<ChevronsDownUpIcon className="size-3.5" />
1168+
)}
11661169
</TooltipTrigger>
11671170
<TooltipPopup side="top">
11681171
{allDiffFilesCollapsed ? "Expand all files" : "Collapse all files"}

‎apps/web/src/components/MorphIcon.tsx‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎apps/web/src/components/RightPanelTabs.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ import {
4646
MessagesSquare,
4747
Plus,
4848
TerminalSquare,
49+
Volume2Icon,
50+
VolumeOffIcon,
4951
} from "lucide-react";
50-
import { Volume2, VolumeOff } from "lucide";
5152
import {
5253
type KeyboardEvent as ReactKeyboardEvent,
5354
type MouseEvent as ReactMouseEvent,
@@ -67,7 +68,6 @@ import { resolveShortcutCommand, type ShortcutMatchContext } from "~/keybindings
6768
import { readLocalApi } from "~/localApi";
6869
import { useStableCallback } from "~/hooks/useStableCallback";
6970
import { Button } from "~/components/ui/button";
70-
import { MorphIcon } from "~/components/MorphIcon";
7171
import { AndroidIcon, AppleIcon } from "~/components/Icons";
7272
import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip";
7373
import { Kbd } from "~/components/ui/kbd";
@@ -940,7 +940,11 @@ function RightPanelTab(
940940
.catch(() => undefined);
941941
}}
942942
>
943-
<MorphIcon className="size-3" icon={audio === "muted" ? VolumeOff : Volume2} />
943+
{audio === "muted" ? (
944+
<VolumeOffIcon className="size-3" />
945+
) : (
946+
<Volume2Icon className="size-3" />
947+
)}
944948
</button>
945949
}
946950
/>

‎apps/web/src/components/chat/ChangedFilesTree.tsx‎

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ import { type OrchestrationV2CheckpointFileTotals, type RunId } from "@t3tools/c
33
import { type MouseEvent, type ReactNode, memo, useLayoutEffect, useRef, useState } from "react";
44
import { type TurnDiffFileChange } from "../../types";
55
import { buildTurnDiffTree, type TurnDiffTreeNode } from "../../lib/turnDiffTree";
6-
import { ChevronRightIcon, FileDiffIcon } from "lucide-react";
7-
import { ChevronsDownUp, ChevronsUpDown, Folder, FolderClosed } from "lucide";
6+
import {
7+
ChevronRightIcon,
8+
FileDiffIcon,
9+
ChevronsDownUpIcon,
10+
ChevronsUpDownIcon,
11+
FolderClosedIcon,
12+
FolderIcon,
13+
} from "lucide-react";
814
import { cn } from "~/lib/utils";
915
import { DiffStatLabel, hasNonZeroStat } from "./DiffStatLabel";
1016
import { PierreEntryIcon } from "./PierreEntryIcon";
1117
import { Button } from "../ui/button";
1218
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
1319
import { MiddleTruncate } from "../ui/middle-truncate";
14-
import { MorphIcon } from "~/components/MorphIcon";
1520
import { observeResize } from "~/lib/observeResize";
1621

1722
const EMPTY_DIRECTORY_OVERRIDES: Record<string, boolean> = {};
@@ -92,10 +97,11 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
9297
/>
9398
}
9499
>
95-
<MorphIcon
96-
className="size-3"
97-
icon={allDirectoriesExpanded ? ChevronsDownUp : ChevronsUpDown}
98-
/>
100+
{allDirectoriesExpanded ? (
101+
<ChevronsDownUpIcon className="size-3" />
102+
) : (
103+
<ChevronsUpDownIcon className="size-3" />
104+
)}
99105
</TooltipTrigger>
100106
<TooltipPopup side="top">
101107
{allDirectoriesExpanded ? "Collapse all folders" : "Expand all folders"}
@@ -211,10 +217,11 @@ const ChangedFilesTree = memo(function ChangedFilesTree(props: {
211217
isExpanded && "rotate-90",
212218
)}
213219
/>
214-
<MorphIcon
215-
className="size-3.5 shrink-0 text-muted-foreground/75"
216-
icon={isExpanded ? Folder : FolderClosed}
217-
/>
220+
{isExpanded ? (
221+
<FolderIcon className="size-3.5 shrink-0 text-muted-foreground/75" />
222+
) : (
223+
<FolderClosedIcon className="size-3.5 shrink-0 text-muted-foreground/75" />
224+
)}
218225
<span className="truncate font-mono text-2xs text-muted-foreground/90 group-hover:text-foreground/90">
219226
{node.name}
220227
</span>

‎apps/web/src/components/chat/ComposerPrimaryActions.tsx‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { memo, type MouseEventHandler, type PointerEventHandler, type ReactNode } from "react";
2-
import { CheckIcon, ChevronLeftIcon, Minimize2Icon, PlayIcon } from "lucide-react";
3-
import { CornerUpRight, ListPlus } from "lucide";
4-
import { MorphIcon } from "~/components/MorphIcon";
2+
import {
3+
CheckIcon,
4+
ChevronLeftIcon,
5+
Minimize2Icon,
6+
PlayIcon,
7+
CornerUpRightIcon,
8+
ListPlusIcon,
9+
} from "lucide-react";
510
import { useEnvironmentIdentificationMode } from "~/hooks/useSettings";
611
import { formatContextWindowTokens } from "~/lib/contextWindow";
712
import { cn, isMacPlatform } from "~/lib/utils";
@@ -280,8 +285,10 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
280285
<PlayIcon className="size-4 fill-current" aria-hidden="true" />
281286
) : isEditingQueuedMessage ? (
282287
<CheckIcon className="size-4" aria-hidden="true" />
288+
) : isRunning && isQueuing ? (
289+
<ListPlusIcon className="size-4" aria-hidden="true" />
283290
) : isRunning ? (
284-
<MorphIcon className="size-4" icon={isQueuing ? ListPlus : CornerUpRight} />
291+
<CornerUpRightIcon className="size-4" aria-hidden="true" />
285292
) : (
286293
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">
287294
<path

‎apps/web/src/components/chat/ExpandedImageDialog.tsx‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { memo, useRef, useState, type ReactNode, type KeyboardEvent } from "react";
22
import { flushSync } from "react-dom";
3-
import { ChevronLeftIcon, ChevronRightIcon, XIcon } from "lucide-react";
4-
import { Image as ImageGlyph, Text as TextGlyph } from "lucide";
3+
import { ChevronLeftIcon, ChevronRightIcon, XIcon, ImageIcon, TextIcon } from "lucide-react";
54
import { Button } from "../ui/button";
6-
import { MorphIcon } from "~/components/MorphIcon";
75
import { Dialog, DialogPopup, DialogTitle } from "../ui/dialog";
86
import type { ExpandedImageItem, ExpandedImagePreview } from "./ExpandedImagePreview";
97
import { resolveExternalWebLinkHost } from "./externalLinkContextMenu";
@@ -258,11 +256,11 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({
258256
/>
259257
}
260258
>
261-
<MorphIcon
262-
className="size-3"
263-
aria-hidden="true"
264-
icon={showingAccessibilityDetails ? ImageGlyph : TextGlyph}
265-
/>
259+
{showingAccessibilityDetails ? (
260+
<ImageIcon className="size-3" aria-hidden="true" />
261+
) : (
262+
<TextIcon className="size-3" aria-hidden="true" />
263+
)}
266264
</TooltipTrigger>
267265
<TooltipPopup side="top">{contentsLabel}</TooltipPopup>
268266
</Tooltip>

‎apps/web/src/components/chat/MarkdownCodeBlock.tsx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Check, Copy } from "lucide";
2-
import { PlayIcon, WrapTextIcon } from "lucide-react";
1+
import { PlayIcon, WrapTextIcon, CheckIcon, CopyIcon } from "lucide-react";
32
import { toHtml } from "hast-util-to-html";
43
import React, { use, useEffect, useState, type ReactNode } from "react";
54

@@ -17,7 +16,6 @@ import {
1716
hasSpecificPierreIconForFileName,
1817
syntheticFileNameForLanguageId,
1918
} from "../../pierre-icons";
20-
import { MorphIcon } from "../MorphIcon";
2119
import { Button } from "../ui/button";
2220
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
2321
import { HighlightedCodeLines } from "./HighlightedCodeLines";
@@ -193,7 +191,7 @@ export function MarkdownCodeBlock({
193191
/>
194192
}
195193
>
196-
<MorphIcon className="size-3" icon={copied ? Check : Copy} />
194+
{copied ? <CheckIcon className="size-3" /> : <CopyIcon className="size-3" />}
197195
</TooltipTrigger>
198196
<TooltipPopup side="top">{copyLabel}</TooltipPopup>
199197
</Tooltip>

0 commit comments

Comments
 (0)