Skip to content

Commit 8973348

Browse files
committed
improvement(emcn): normalize the chevron geometry and consolidate consumers
The sidebar folder arrow read as much larger than the icons beside it. It was measurably so: `ChevronRight` was a triple outlier in the icon set. | | ChevronRight | house standard | |---|---|---| | viewBox | `0 0 6 10` | 24-based — 149 of 173 icons | | glyph fill | 80% of the box | 54% median | | strokeWidth | 1.2 | 1.55 — 153 of 173 | | cap/join | square/miter | round/round — 175/177 | Because the box was tight-cropped, a square `size-[16px]` scaled the glyph to 12.8px tall where a standard icon shows ~8.6px — about 50% larger, with a relatively ~85% heavier stroke. The lucide icon it replaced was a 24-box at 50% fill, which is why this only appeared after the migration. `chevron-down`, `chevron-right` and `chevron-left` are rebuilt as the exact mirror and transpose of `chevron-up`, which already sets the house standard, so their optical weight is identical to that sibling by construction rather than by eye. Changing the viewBox is not safe on its own: 36 call sites sized these to the old tight aspect (`h-[7px] w-[9px]`, `h-[6px] w-[10px]`, ...), which would letterbox against a square box. All of them move to `size-[14px]`, the documented default and the app's dominant size (212 uses). Every one of the 94 chevron call sites is now square-sized. Two of those were only reachable through indirection and would have regressed silently: `STYLES.chevron` in the terminal's structured output, and the sidebar-section chevron inside a multi-line `cn()`. The dropdown submenu chevron carried no size at all and was relying on the icon's intrinsic 6x10 — it would have jumped to 24x24. Also unifies `folder-input`, which carried both 1.55 and 2 within one icon. Docs consolidation, same theme — it was forking shared components: - `SidebarChevron` was a private inline copy of the old 6x10 chevron; it now wraps the shared `ChevronRight`. - `ThemeToggle` inlined lucide's sun and moon at strokeWidth 1.5; both now come from `@sim/emcn/icons` at the house 1.55. Docs inline `<svg>` files drop from 9 to 7; the remainder are the brand icon set, the logo, OG-image generation and bespoke hand-positioned shapes. Left alone: 16 icons whose stroke or box still differs. They are fill-based glyphs and brand marks (`sim`, `wordmark`, `folder`, `more-horizontal`, ...) where changing the stroke means redrawing the icon — that wants visual review, not a sweep. Verified: 23/23 type-check (--force), biome, api-validation, 18361 tests, and production builds of both apps.
1 parent 63faeb5 commit 8973348

36 files changed

Lines changed: 76 additions & 143 deletions

File tree

apps/docs/components/docs-layout/sidebar-components.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client'
22

33
import { type ReactNode, useState } from 'react'
4+
import { ChevronRight } from '@sim/emcn/icons'
45
import type { Folder, Item, Separator } from 'fumadocs-core/page-tree'
56
import { useSidebar } from 'fumadocs-ui/components/sidebar/base'
67
import Link from 'next/link'
@@ -10,25 +11,13 @@ import { cn } from '@/lib/utils'
1011

1112
function SidebarChevron({ open, className }: { open: boolean; className?: string }) {
1213
return (
13-
<svg
14-
width='5'
15-
height='8'
16-
viewBox='0 0 6 10'
17-
fill='none'
14+
<ChevronRight
1815
className={cn(
19-
'flex-shrink-0 transition-transform duration-200',
16+
'size-[14px] flex-shrink-0 transition-transform duration-200',
2017
open && 'rotate-90',
2118
className
2219
)}
23-
>
24-
<path
25-
d='M1 1L5 5L1 9'
26-
stroke='currentColor'
27-
strokeWidth='1.33'
28-
strokeLinecap='square'
29-
strokeLinejoin='miter'
30-
/>
31-
</svg>
20+
/>
3221
)
3322
}
3423

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,8 @@
11
'use client'
22

3-
import type { SVGProps } from 'react'
3+
import { Moon, Sun } from '@sim/emcn/icons'
44
import { useTheme } from 'next-themes'
55

6-
function SunIcon(props: SVGProps<SVGSVGElement>) {
7-
return (
8-
<svg
9-
xmlns='http://www.w3.org/2000/svg'
10-
width='16'
11-
height='16'
12-
viewBox='0 0 24 24'
13-
fill='none'
14-
stroke='currentColor'
15-
strokeWidth='1.5'
16-
strokeLinecap='round'
17-
strokeLinejoin='round'
18-
{...props}
19-
>
20-
<circle cx='12' cy='12' r='4' />
21-
<path d='M12 2v2' />
22-
<path d='M12 20v2' />
23-
<path d='m4.93 4.93 1.41 1.41' />
24-
<path d='m17.66 17.66 1.41 1.41' />
25-
<path d='M2 12h2' />
26-
<path d='M20 12h2' />
27-
<path d='m6.34 17.66-1.41 1.41' />
28-
<path d='m19.07 4.93-1.41 1.41' />
29-
</svg>
30-
)
31-
}
32-
33-
function MoonIcon(props: SVGProps<SVGSVGElement>) {
34-
return (
35-
<svg
36-
xmlns='http://www.w3.org/2000/svg'
37-
width='16'
38-
height='16'
39-
viewBox='0 0 24 24'
40-
fill='none'
41-
stroke='currentColor'
42-
strokeWidth='1.5'
43-
strokeLinecap='round'
44-
strokeLinejoin='round'
45-
{...props}
46-
>
47-
<path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z' />
48-
</svg>
49-
)
50-
}
51-
526
export function ThemeToggle() {
537
const { resolvedTheme, setTheme } = useTheme()
548

@@ -59,8 +13,8 @@ export function ThemeToggle() {
5913
className='flex size-[30px] cursor-pointer items-center justify-center rounded-lg text-[var(--text-icon)] transition-colors hover:bg-[var(--surface-active)]'
6014
aria-label='Toggle theme'
6115
>
62-
<SunIcon className='block size-[14px] dark:hidden' />
63-
<MoonIcon className='hidden size-[14px] dark:block' />
16+
<Sun className='block size-[14px] dark:hidden' />
17+
<Moon className='hidden size-[14px] dark:block' />
6418
</button>
6519
)
6620
}

apps/docs/components/workflow-preview/output-bundle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function TreeNode({ node, depth = 0 }: { node: OutputNode; depth?: number }) {
7171
</span>
7272
<TypeBadge type={type} />
7373
<ChevronDown
74-
className='h-[7px] w-[9px] flex-shrink-0 text-[var(--text-muted)]'
74+
className='size-[14px] flex-shrink-0 text-[var(--text-muted)]'
7575
style={expanded ? undefined : { transform: 'rotate(-90deg)' }}
7676
/>
7777
</div>

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-chat/chat-title-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function LandingPreviewChatTitleBar({
3131
</span>
3232
<span aria-hidden='true' className='w-px self-stretch bg-[var(--surface-2)]' />
3333
<span className='flex items-center rounded-r-lg px-1 transition-colors hover-hover:bg-[var(--surface-active)]'>
34-
<ChevronDown className='h-[6px] w-[10px] flex-shrink-0 text-[var(--text-icon)]' />
34+
<ChevronDown className='size-[14px] flex-shrink-0 text-[var(--text-icon)]' />
3535
</span>
3636
</span>
3737
{showClose && (

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-home/landing-preview-home.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const LandingPreviewHome = memo(function LandingPreviewHome({
200200
</div>
201201
<span className='text-[var(--text-body)] text-sm'>Sim</span>
202202
<ChevronDown
203-
className='h-[7px] w-[9px] text-[var(--text-icon)] transition-transform duration-150'
203+
className='size-[14px] text-[var(--text-icon)] transition-transform duration-150'
204204
style={{
205205
transform: toolsExpanded ? 'rotate(0deg)' : 'rotate(-90deg)',
206206
}}
@@ -298,7 +298,7 @@ export const LandingPreviewHome = memo(function LandingPreviewHome({
298298
<div className='flex items-center justify-between'>
299299
<div className='flex items-center gap-2'>
300300
<span className='text-[var(--text-muted)] text-small'>Suggested actions</span>
301-
<ChevronDown className='h-[7px] w-[9px] text-[var(--text-muted)]' />
301+
<ChevronDown className='size-[14px] text-[var(--text-muted)]' />
302302
</div>
303303
<div className='-mr-2 flex items-center gap-1.5 rounded-lg px-2 py-1'>
304304
<span className='-mt-px text-[var(--text-muted)] text-small'>Shuffle</span>
@@ -411,7 +411,7 @@ function MiniTablePanel() {
411411
<span className='font-medium text-[11px] text-[var(--text-primary)]'>
412412
{col.label}
413413
</span>
414-
<ChevronDown className='ml-auto h-[6px] w-[8px] text-[var(--text-muted)]' />
414+
<ChevronDown className='ml-auto size-[14px] text-[var(--text-muted)]' />
415415
</div>
416416
</th>
417417
)

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-sidebar/landing-preview-sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function LandingPreviewSidebar({
9797
<span className='min-w-0 flex-1 truncate text-left font-medium text-[13px] text-[var(--text-primary)]'>
9898
Superark
9999
</span>
100-
<ChevronDown className='h-[8px] w-[10px] flex-shrink-0 text-[var(--text-icon)]' />
100+
<ChevronDown className='size-[14px] flex-shrink-0 text-[var(--text-icon)]' />
101101
</div>
102102
</div>
103103

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-tables/landing-preview-tables.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ function SpreadsheetView({ tableId, tableName, onBack }: SpreadsheetViewProps) {
444444
<span className='select-none text-[var(--text-icon)] text-sm'>/</span>
445445
<span className='inline-flex items-center px-2 py-1 font-medium text-[var(--text-body)] text-sm'>
446446
{tableName}
447-
<ChevronDown className='ml-2 h-[7px] w-[9px] shrink-0 text-[var(--text-muted)]' />
447+
<ChevronDown className='ml-2 size-[14px] shrink-0 text-[var(--text-muted)]' />
448448
</span>
449449
</div>
450450
</div>
@@ -470,7 +470,7 @@ function SpreadsheetView({ tableId, tableName, onBack }: SpreadsheetViewProps) {
470470
<span className='ml-1.5 min-w-0 overflow-clip text-ellipsis whitespace-nowrap font-medium text-[var(--text-primary)] text-small'>
471471
{col.label}
472472
</span>
473-
<ChevronDown className='ml-auto h-[7px] w-[9px] shrink-0 text-[var(--text-muted)]' />
473+
<ChevronDown className='ml-auto size-[14px] shrink-0 text-[var(--text-muted)]' />
474474
</div>
475475
</th>
476476
)

apps/sim/app/(landing)/enterprise/components/enterprise-platform-loop/enterprise-home-stage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export function EnterpriseHomeStage({
217217
<div className='flex items-center justify-between'>
218218
<span className='flex items-center gap-2'>
219219
<span className='text-[13px] text-[var(--text-muted)]'>Suggested actions</span>
220-
<ChevronDown className='h-[7px] w-[9px] text-[var(--text-muted)]' />
220+
<ChevronDown className='size-[14px] text-[var(--text-muted)]' />
221221
</span>
222222
<span className='flex items-center gap-1.5'>
223223
<span className='text-[13px] text-[var(--text-muted)]'>Shuffle</span>

apps/sim/app/(landing)/enterprise/components/enterprise-platform-loop/enterprise-sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const EnterpriseSidebar = memo(function EnterpriseSidebar({
126126
className='size-[16px] flex-shrink-0 rounded-sm'
127127
/>
128128
<span className='min-w-0 truncate text-[var(--text-body)] text-sm'>{workspaceName}</span>
129-
<ChevronDown className='h-[6px] w-[10px] flex-shrink-0 text-[var(--text-icon)]' />
129+
<ChevronDown className='size-[14px] flex-shrink-0 text-[var(--text-icon)]' />
130130
</div>
131131
<PanelLeft className='mr-1.5 size-[16px] flex-shrink-0 text-[var(--text-icon)]' />
132132
</div>

apps/sim/app/(landing)/tables/components/tables-hero-loop.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ function TablesGridPane({ rowCount, filledCount }: TablesGridPaneProps) {
294294
<span className='select-none text-[var(--text-icon)] text-sm'>/</span>
295295
<span className='inline-flex items-center px-2 py-1 font-medium text-[var(--text-body)] text-sm'>
296296
Leads
297-
<ChevronDown className='ml-2 h-[7px] w-[9px] shrink-0 text-[var(--text-muted)]' />
297+
<ChevronDown className='ml-2 size-[14px] shrink-0 text-[var(--text-muted)]' />
298298
</span>
299299
</div>
300300
</div>
@@ -319,7 +319,7 @@ function TablesGridPane({ rowCount, filledCount }: TablesGridPaneProps) {
319319
<span className='ml-1.5 min-w-0 overflow-clip text-ellipsis whitespace-nowrap font-medium text-[var(--text-primary)] text-small'>
320320
{column.label}
321321
</span>
322-
<ChevronDown className='ml-auto h-[7px] w-[9px] shrink-0 text-[var(--text-muted)]' />
322+
<ChevronDown className='ml-auto size-[14px] shrink-0 text-[var(--text-muted)]' />
323323
</div>
324324
</th>
325325
)

0 commit comments

Comments
 (0)