Skip to content

Commit dd314de

Browse files
committed
update docs styling, add delete confirmation on inbox
1 parent 5ba7a7e commit dd314de

File tree

4 files changed

+110
-51
lines changed

4 files changed

+110
-51
lines changed

apps/docs/app/global.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ html {
3232
:root {
3333
--fd-border: transparent !important;
3434
--fd-border-sidebar: transparent !important;
35-
--fd-nav-height: 65px; /* Custom navbar height (h-16 = 64px + 1px border) */
35+
--fd-nav-height: 94px; /* Custom navbar height (52px top + 42px tabs) */
3636
/* Content container width used to center main content */
3737
--spacing-fd-container: 1400px;
3838
/* Edge gutter = leftover space on each side of centered container */
@@ -97,7 +97,7 @@ aside#nd-sidebar {
9797
display: none !important;
9898
}
9999

100-
/* Mobile only: Reduce gap between navbar and content */
100+
/* Mobile only: Reduce gap between navbar and content (custom navbar hidden on mobile) */
101101
@media (max-width: 1023px) {
102102
#nd-docs-layout {
103103
margin-top: -25px;
@@ -121,11 +121,11 @@ aside#nd-sidebar {
121121
/* On mobile, let fumadocs handle the layout natively */
122122
@media (min-width: 1024px) {
123123
:root {
124-
--fd-banner-height: 65px !important; /* 64px navbar + 1px border */
124+
--fd-banner-height: 94px !important; /* 52px top + 42px tabs */
125125
}
126126

127127
#nd-docs-layout {
128-
--fd-docs-height: calc(100dvh - 65px) !important; /* 64px navbar + 1px border */
128+
--fd-docs-height: calc(100dvh - 94px) !important; /* 52px top + 42px tabs */
129129
--fd-sidebar-width: 300px !important;
130130
margin-left: var(--sidebar-offset) !important;
131131
margin-right: var(--toc-offset) !important;

apps/docs/components/navbar/navbar.tsx

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,88 @@ import { SimLogoFull } from '@/components/ui/sim-logo'
88
import { ThemeToggle } from '@/components/ui/theme-toggle'
99
import { cn } from '@/lib/utils'
1010

11+
const NAV_TABS = [
12+
{
13+
label: 'Documentation',
14+
href: '/introduction',
15+
match: (p: string) => !p.includes('/api-reference'),
16+
external: false,
17+
},
18+
{
19+
label: 'API Reference',
20+
href: '/api-reference/getting-started',
21+
match: (p: string) => p.includes('/api-reference'),
22+
external: false,
23+
},
24+
{ label: 'Mothership', href: 'https://sim.ai', external: true },
25+
] as const
26+
1127
export function Navbar() {
1228
const pathname = usePathname()
13-
const isApiReference = pathname.includes('/api-reference')
1429

1530
return (
16-
<nav className='sticky top-0 z-50 border-border/50 border-b bg-background/80 backdrop-blur-md backdrop-saturate-150'>
17-
{/* Desktop: Single row layout */}
18-
<div className='hidden h-16 w-full items-center lg:flex'>
31+
<nav className='sticky top-0 z-50 bg-background/80 backdrop-blur-md backdrop-saturate-150'>
32+
<div className='hidden w-full flex-col lg:flex'>
33+
{/* Top row: logo, search, controls */}
1934
<div
20-
className='relative flex w-full items-center justify-between'
35+
className='flex h-[52px] w-full items-center justify-between'
2136
style={{
2237
paddingLeft: 'calc(var(--sidebar-offset) + 32px)',
2338
paddingRight: 'calc(var(--toc-offset) + 60px)',
2439
}}
2540
>
26-
{/* Left cluster: logo */}
27-
<div className='flex items-center'>
28-
<Link href='/' className='flex min-w-[100px] items-center'>
29-
<SimLogoFull className='h-7 w-auto' />
30-
</Link>
31-
</div>
41+
<Link href='/' className='flex min-w-[100px] items-center'>
42+
<SimLogoFull className='h-7 w-auto' />
43+
</Link>
3244

33-
{/* Center cluster: search - absolutely positioned to center */}
3445
<div className='-translate-x-1/2 absolute left-1/2 flex items-center justify-center'>
3546
<SearchTrigger />
3647
</div>
3748

38-
{/* Right cluster aligns with TOC edge */}
3949
<div className='flex items-center gap-1'>
40-
<Link
41-
href='/introduction'
42-
className={cn(
43-
'rounded-xl px-3 py-2 font-normal text-[0.9375rem] leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground',
44-
!isApiReference ? 'text-foreground' : 'text-foreground/60'
45-
)}
46-
>
47-
Documentation
48-
</Link>
49-
<Link
50-
href='/api-reference/getting-started'
51-
className={cn(
52-
'rounded-xl px-3 py-2 font-normal text-[0.9375rem] leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground',
53-
isApiReference ? 'text-foreground' : 'text-foreground/60'
54-
)}
55-
>
56-
API
57-
</Link>
58-
<Link
59-
href='https://sim.ai'
60-
target='_blank'
61-
rel='noopener noreferrer'
62-
className='rounded-xl px-3 py-2 font-normal text-[0.9375rem] text-foreground/60 leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground'
63-
>
64-
Platform
65-
</Link>
6650
<LanguageDropdown />
6751
<ThemeToggle />
6852
</div>
6953
</div>
54+
55+
{/* Divider — only spans content width */}
56+
<div
57+
className='border-b'
58+
style={{
59+
marginLeft: 'calc(var(--sidebar-offset) + 32px)',
60+
marginRight: 'calc(var(--toc-offset) + 60px)',
61+
borderColor: 'rgba(128, 128, 128, 0.1)',
62+
}}
63+
/>
64+
65+
{/* Bottom row: navigation tabs — border on row, tabs overlap it */}
66+
<div
67+
className='flex h-[42px] items-stretch gap-6 border-border/20 border-b'
68+
style={{
69+
paddingLeft: 'calc(var(--sidebar-offset) + 32px)',
70+
}}
71+
>
72+
{NAV_TABS.map((tab) => {
73+
const isActive = !tab.external && tab.match(pathname)
74+
return (
75+
<Link
76+
key={tab.label}
77+
href={tab.href}
78+
{...(tab.external ? { target: '_blank', rel: 'noopener noreferrer' } : {})}
79+
className={cn(
80+
'-mb-px relative flex items-center border-b text-[14px] tracking-[-0.01em] transition-colors',
81+
isActive
82+
? 'border-neutral-400 font-[550] text-neutral-800 dark:border-neutral-500 dark:text-neutral-200'
83+
: 'border-transparent font-medium text-fd-muted-foreground hover:border-neutral-300 hover:text-neutral-600 dark:hover:border-neutral-600 dark:hover:text-neutral-400'
84+
)}
85+
>
86+
{/* Invisible bold text reserves width to prevent layout shift */}
87+
<span className='invisible font-[550]'>{tab.label}</span>
88+
<span className='absolute'>{tab.label}</span>
89+
</Link>
90+
)
91+
})}
92+
</div>
7093
</div>
7194
</nav>
7295
)

apps/docs/components/ui/search-trigger.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export function SearchTrigger() {
2727
<Search className='h-4 w-4' />
2828
<span>Search...</span>
2929
<kbd
30-
className='ml-auto flex items-center gap-0.5 font-medium'
30+
className='ml-auto flex items-center font-medium'
3131
style={{ color: 'rgba(255, 255, 255, 0.6)' }}
3232
>
33-
<span style={{ fontSize: '15px', lineHeight: '1' }}></span>
34-
<span style={{ fontSize: '13px', lineHeight: '1' }}>K</span>
33+
<span className='text-[16px]'></span>
34+
<span className='text-[13px]'>K</span>
3535
</kbd>
3636
</button>
3737
)

apps/sim/app/workspace/[workspaceId]/settings/components/inbox/inbox-enable-toggle.tsx

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function InboxEnableToggle() {
2525
const toggleInbox = useToggleInbox()
2626

2727
const [isEnableOpen, setIsEnableOpen] = useState(false)
28+
const [isDisableOpen, setIsDisableOpen] = useState(false)
2829
const [enableUsername, setEnableUsername] = useState('')
2930

3031
const handleToggle = useCallback(
@@ -33,15 +34,20 @@ export function InboxEnableToggle() {
3334
setIsEnableOpen(true)
3435
return
3536
}
36-
try {
37-
await toggleInbox.mutateAsync({ workspaceId, enabled: false })
38-
} catch (error) {
39-
logger.error('Failed to disable inbox', { error })
40-
}
37+
setIsDisableOpen(true)
4138
},
4239
[workspaceId]
4340
)
4441

42+
const handleDisable = useCallback(async () => {
43+
try {
44+
await toggleInbox.mutateAsync({ workspaceId, enabled: false })
45+
setIsDisableOpen(false)
46+
} catch (error) {
47+
logger.error('Failed to disable inbox', { error })
48+
}
49+
}, [workspaceId])
50+
4551
const handleEnable = useCallback(async () => {
4652
try {
4753
await toggleInbox.mutateAsync({
@@ -108,6 +114,36 @@ export function InboxEnableToggle() {
108114
</ModalFooter>
109115
</ModalContent>
110116
</Modal>
117+
118+
<Modal open={isDisableOpen} onOpenChange={setIsDisableOpen}>
119+
<ModalContent size='sm'>
120+
<ModalHeader>Disable email inbox</ModalHeader>
121+
<ModalBody>
122+
<p className='text-[var(--text-secondary)]'>
123+
Are you sure you want to disable the inbox
124+
{config?.address && (
125+
<>
126+
{' '}
127+
<span className='font-medium text-[var(--text-primary)]'>{config.address}</span>
128+
</>
129+
)}
130+
? Any emails sent to this address after disabling will not be delivered.{' '}
131+
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
132+
</p>
133+
<p className='mt-[8px] text-[var(--text-secondary)]'>
134+
Your existing conversations and task history will be preserved.
135+
</p>
136+
</ModalBody>
137+
<ModalFooter>
138+
<Button variant='default' onClick={() => setIsDisableOpen(false)}>
139+
Cancel
140+
</Button>
141+
<Button variant='destructive' onClick={handleDisable} disabled={toggleInbox.isPending}>
142+
{toggleInbox.isPending ? 'Disabling...' : 'Disable inbox'}
143+
</Button>
144+
</ModalFooter>
145+
</ModalContent>
146+
</Modal>
111147
</>
112148
)
113149
}

0 commit comments

Comments
 (0)