Skip to content

Commit e99ceed

Browse files
authored
Replace TanChat’s Lucide icons with Phosphor (#1538)
1 parent 0a7d36b commit e99ceed

64 files changed

Lines changed: 651 additions & 561 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎harness-tests/core/composer-references.test.ts‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import {
2+
BookOpenIcon,
3+
PackageIcon,
4+
PlugIcon,
5+
WrenchIcon,
6+
type Icon,
7+
} from '@phosphor-icons/react'
18
import { createElement } from 'react'
29
import { renderToStaticMarkup } from 'react-dom/server'
310
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
@@ -28,6 +35,12 @@ import {
2835
parseReferenceCatalog,
2936
} from '../../src/chat/components/ComposerReferences'
3037

38+
function iconMarkup(Icon: Icon, size: number) {
39+
return renderToStaticMarkup(
40+
createElement(Icon, { size, 'aria-hidden': true }),
41+
)
42+
}
43+
3144
const conversation: MessageReference = {
3245
kind: 'conversation',
3346
botId: 'one',
@@ -493,7 +506,7 @@ describe('tool reference catalog presentation', () => {
493506
)
494507
expect(transcript).toContain('Alpha connection')
495508
expect(transcript).toContain('Beta connection')
496-
expect(transcript.match(/lucide-wrench/g)).toHaveLength(2)
509+
expect(transcript.split(iconMarkup(WrenchIcon, 14))).toHaveLength(3)
497510
expect(transcript).not.toContain('<a ')
498511
const html = renderToStaticMarkup(
499512
createElement(QueryClientProvider, {
@@ -575,12 +588,16 @@ describe('plugin reference presentation', () => {
575588
}),
576589
}),
577590
)
578-
for (const html of [transcript, details, composer]) {
591+
for (const [html, size] of [
592+
[transcript, 14],
593+
[details, 17],
594+
[composer, 15],
595+
] as const) {
579596
expect(html).toContain('Weekly planning')
580597
expect(html).toContain('<small>Installed v1</small>')
581598
expect(html).toContain('<small>Installed v3</small>')
582-
expect(html.match(/lucide-package/g)).toHaveLength(2)
583-
expect(html).not.toContain('lucide-plug ')
599+
expect(html.split(iconMarkup(PackageIcon, size))).toHaveLength(3)
600+
expect(html).not.toContain(iconMarkup(PlugIcon, size))
584601
expect(html).not.toContain('Activate')
585602
expect(html).not.toContain(plugin.installationId)
586603
}
@@ -772,6 +789,6 @@ it('renders selected skill identity and exact version without treating it as a c
772789
)
773790
expect(html).toContain('weekly-update')
774791
expect(html).toContain('Personal · v1')
775-
expect(html).toContain('lucide-book-open')
776-
expect(html).not.toContain('lucide-plug')
792+
expect(html).toContain(iconMarkup(BookOpenIcon, 14))
793+
expect(html).not.toContain(iconMarkup(PlugIcon, 14))
777794
})

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@
159159
"jszip": "^3.10.1",
160160
"linkify-it": "^6.1.0",
161161
"lru-cache": "^11.2.7",
162-
"lucide-react": "^1.49.0",
163162
"match-sorter": "^8.3.0",
164163
"mermaid": "^11.14.0",
165164
"motion": "^13.4.6",

‎pnpm-lock.yaml‎

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/chat/components/App.tsx‎

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@ import {
4545
} from './bootstrap-onboarding'
4646
import type { Onboarding as OnboardingSnapshot } from '../core/onboarding'
4747
import {
48-
Settings,
49-
ChevronLeft,
50-
ChevronRight,
51-
ChevronDown,
52-
Check,
53-
PanelLeft,
54-
PanelRight,
55-
LogOut,
56-
Bookmark,
57-
Copy,
58-
} from 'lucide-react'
48+
BookmarkSimpleIcon,
49+
CaretDownIcon,
50+
CaretLeftIcon,
51+
CaretRightIcon,
52+
CheckIcon,
53+
CopyIcon,
54+
GearIcon,
55+
SidebarSimpleIcon,
56+
SignOutIcon,
57+
} from '@phosphor-icons/react'
5958
import { useNavigate, useParams } from '@tanstack/react-router'
6059
import { WorkspaceApiProvider, useWorkspaceApi, ApiError } from './WorkspaceApi'
6160

@@ -730,7 +729,7 @@ function WorkspaceApp({
730729
else setDesktopSidebarOpen(true)
731730
}}
732731
>
733-
<PanelLeft size={20} aria-hidden />
732+
<SidebarSimpleIcon size={20} aria-hidden />
734733
</IconButton>
735734
)}
736735
<ConversationNavigatorToggle />
@@ -745,14 +744,14 @@ function WorkspaceApp({
745744
aria-label={parentName}
746745
onClick={() => selectBot(parentId)}
747746
>
748-
<ChevronLeft
747+
<CaretLeftIcon
749748
className="breadcrumb-parent-icon"
750749
size={14}
751750
aria-hidden
752751
/>
753752
<span className="breadcrumb-parent-name">{parentName}</span>
754753
</Button>
755-
<ChevronRight
754+
<CaretRightIcon
756755
className="breadcrumb-separator"
757756
size={15}
758757
aria-hidden
@@ -790,7 +789,11 @@ function WorkspaceApp({
790789
})
791790
}
792791
>
793-
<PanelRight size={17} aria-hidden />
792+
<SidebarSimpleIcon
793+
style={{ transform: 'scaleX(-1)' }}
794+
size={17}
795+
aria-hidden
796+
/>
794797
</IconButton>
795798
)}
796799
{selected && (
@@ -860,7 +863,7 @@ function WorkspaceApp({
860863
ref={sidebarTrigger}
861864
onClick={() => setDesktopSidebarOpen((open) => !open)}
862865
>
863-
<PanelLeft size={20} aria-hidden />
866+
<SidebarSimpleIcon size={20} aria-hidden />
864867
</IconButton>
865868
{workspaceShortcuts}
866869
<IconButton
@@ -869,7 +872,7 @@ function WorkspaceApp({
869872
label="Settings"
870873
onClick={() => setSettings('general')}
871874
>
872-
<Settings size={20} aria-hidden />
875+
<GearIcon size={20} aria-hidden />
873876
</IconButton>
874877
</aside>
875878
)}
@@ -927,7 +930,7 @@ function WorkspaceApp({
927930
aria-label={`Switch workspace: ${data.workspace.name}`}
928931
>
929932
<strong>TanChat</strong>
930-
<ChevronDown size={15} aria-hidden />
933+
<CaretDownIcon size={15} aria-hidden />
931934
</Menu.Trigger>
932935
<Menu.Portal>
933936
<Menu.Positioner
@@ -951,7 +954,10 @@ function WorkspaceApp({
951954
>
952955
{item.name}
953956
{item.id === data.workspace.id && (
954-
<Check size={15} aria-label="Current workspace" />
957+
<CheckIcon
958+
size={15}
959+
aria-label="Current workspace"
960+
/>
955961
)}
956962
</Menu.Item>
957963
))}
@@ -973,7 +979,7 @@ function WorkspaceApp({
973979
aria-controls="workspace-sidebar"
974980
onClick={closeSidebar}
975981
>
976-
<PanelLeft size={20} aria-hidden />
982+
<SidebarSimpleIcon size={20} aria-hidden />
977983
</IconButton>
978984
)}
979985
</div>
@@ -1091,7 +1097,7 @@ function WorkspaceApp({
10911097
className="settings-button"
10921098
onClick={() => setSettings('general')}
10931099
>
1094-
<Settings size={18} />
1100+
<GearIcon size={18} />
10951101
<span>Settings</span>
10961102
<span className="user-avatar">
10971103
{data.user.username.slice(0, 1).toUpperCase()}
@@ -1697,7 +1703,7 @@ function SettingsDialog({
16971703
}}
16981704
>
16991705
<Button type="submit" variant="secondary">
1700-
<LogOut size={15} />
1706+
<SignOutIcon size={15} />
17011707
Sign out
17021708
</Button>
17031709
</form>
@@ -2011,7 +2017,7 @@ function SettingsDialog({
20112017
</p>
20122018
{data.recipes.map((r) => (
20132019
<div className="saved-action" key={r.id}>
2014-
<Bookmark size={18} />
2020+
<BookmarkSimpleIcon size={18} />
20152021
<div>
20162022
<strong>{r.title}</strong>
20172023
<p>{r.description}</p>
@@ -2025,7 +2031,7 @@ function SettingsDialog({
20252031
.then(() => setNotice('Command copied'))
20262032
}
20272033
>
2028-
<Copy size={14} />
2034+
<CopyIcon size={14} />
20292035
Copy command
20302036
</Button>
20312037
</div>
@@ -2094,7 +2100,7 @@ function SettingsDialog({
20942100
)}
20952101
{notice && (
20962102
<p className="success" role="status">
2097-
<Check size={15} />
2103+
<CheckIcon size={15} />
20982104
{notice}
20992105
</p>
21002106
)}

0 commit comments

Comments
 (0)