Skip to content

Commit 927c767

Browse files
committed
Merge branch 'staging-v4' of github.com:simstudioai/sim into staging-v4
2 parents 9c791c5 + 4510963 commit 927c767

27 files changed

Lines changed: 97 additions & 96 deletions

File tree

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
'use client'
2+
3+
import { usePathname } from 'next/navigation'
4+
import { DesktopTitleBarController } from '@/app/_shell/desktop-title-bar'
15
import { AuthShell } from '@/app/(auth)/components'
26

37
export default function AuthLayoutClient({ children }: { children: React.ReactNode }) {
4-
return <AuthShell>{children}</AuthShell>
8+
const isLogin = usePathname() === '/login'
9+
10+
return (
11+
<>
12+
{isLogin && <DesktopTitleBarController />}
13+
<AuthShell reserveDesktopTitleBar={isLogin}>{children}</AuthShell>
14+
</>
15+
)
516
}

apps/sim/app/(auth)/components/auth-shell.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { ReactNode } from 'react'
2+
import { cn } from '@sim/emcn'
23
import Link from 'next/link'
34
import { LogoMark, SimWordmark } from '@/app/(landing)/components/navbar/components'
45

@@ -7,6 +8,8 @@ interface AuthShellProps {
78
children: ReactNode
89
/** Optional element pinned to the bottom of the shell (e.g. the support footer). */
910
footer?: ReactNode
11+
/** Reserve the native macOS title-bar lane for the desktop login route. */
12+
reserveDesktopTitleBar?: boolean
1013
}
1114

1215
/**
@@ -19,9 +22,14 @@ interface AuthShellProps {
1922
* the landing {@link LogoMark} + {@link SimWordmark} at the same nav gutters. The
2023
* single content column is centered and capped for a calm single-form layout.
2124
*/
22-
export function AuthShell({ children, footer }: AuthShellProps) {
25+
export function AuthShell({ children, footer, reserveDesktopTitleBar = false }: AuthShellProps) {
2326
return (
24-
<div className='desktop-title-bar-page light relative flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
27+
<div
28+
className={cn(
29+
'light relative flex flex-col bg-[var(--bg)] text-[var(--text-primary)]',
30+
reserveDesktopTitleBar ? 'desktop-title-bar-page' : 'min-h-screen'
31+
)}
32+
>
2533
<header>
2634
<nav className='mx-auto flex w-full max-w-[1446px] items-center px-12 py-4 max-sm:px-5 max-lg:px-8'>
2735
<Link href='/' aria-label='Sim home' className='flex h-[30px] items-center'>

apps/sim/app/(interfaces)/chat/[identifier]/chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export default function ChatClient({ identifier }: { identifier: string }) {
426426
}
427427

428428
return (
429-
<div className='desktop-title-bar-fixed-page light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
429+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
430430
{/* Header component */}
431431
<ChatHeader chatConfig={chatConfig} starCount={starCount} />
432432

apps/sim/app/(interfaces)/chat/[identifier]/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Skeleton } from '@sim/emcn'
22

33
export default function ChatLoading() {
44
return (
5-
<div className='desktop-title-bar-fixed-page light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
5+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
66
<div className='border-[var(--border-1)] border-b px-4 py-3'>
77
<div className='mx-auto flex max-w-3xl items-center justify-between'>
88
<div className='flex items-center gap-[12px]'>

apps/sim/app/(interfaces)/chat/components/loading-state/loading-state.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Skeleton } from '@sim/emcn'
22

33
export function ChatLoadingState() {
44
return (
5-
<div className='desktop-title-bar-fixed-page light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)]'>
5+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)]'>
66
<div className='flex flex-1 items-center justify-center px-4'>
77
<div className='w-full max-w-[410px]'>
88
<div className='flex flex-col items-center justify-center'>

apps/sim/app/(interfaces)/chat/components/voice-interface/voice-interface.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ export function VoiceInterface({
524524
return (
525525
<div
526526
className={cn(
527-
'desktop-title-bar-fixed-page light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]',
527+
'light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]',
528528
className
529529
)}
530530
>

apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Skeleton } from '@sim/emcn'
22

33
export default function ResumeLoading() {
44
return (
5-
<div className='desktop-title-bar-page bg-background'>
5+
<div className='min-h-screen bg-background'>
66
<div className='border-b px-4 py-3'>
77
<div className='mx-auto flex max-w-[1200px] items-center justify-between'>
88
<Skeleton className='h-[24px] w-[80px] rounded-[4px]' />

apps/sim/app/(landing)/components/landing-shell/landing-shell.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import { SiteStructuredData } from '@/app/(landing)/components/site-structured-d
1515
* light-mode value regardless of the visitor's theme - the landing family is
1616
* always light, and uses the platform's own light-mode tokens (from
1717
* `globals.css`) with no separate palette.
18-
* - The page's traffic-light-safe scroll port (`desktop-title-bar-page-height`
19-
* + `overflow-y-auto` +
18+
* - The page's scroll port (`h-screen` + `overflow-y-auto` +
2019
* `overscroll-y-none`): the document body no longer overflows, so the viewport
2120
* can't rubber-band, and the container's own overscroll bounce is disabled -
2221
* without this the sticky navbar gets dragged past the top/bottom edges.
@@ -37,7 +36,7 @@ export async function LandingShell({ children }: LandingShellProps) {
3736
const stars = await getGitHubStars()
3837

3938
return (
40-
<div className='desktop-title-bar-page-height light overflow-y-auto overscroll-y-none bg-[var(--bg)] text-[var(--text-primary)]'>
39+
<div className='light h-screen overflow-y-auto overscroll-y-none bg-[var(--bg)] text-[var(--text-primary)]'>
4140
<SiteStructuredData />
4241
<a
4342
href='#main-content'

apps/sim/app/(landing)/components/logo-shell/logo-shell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface LogoShellProps {
2626

2727
export function LogoShell({ children, center = false, footer }: LogoShellProps) {
2828
return (
29-
<div className='desktop-title-bar-page light relative flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
29+
<div className='light relative flex min-h-screen flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
3030
<header>
3131
<nav className='mx-auto flex w-full max-w-[1460px] items-center px-20 py-4 max-sm:px-5 max-lg:px-8'>
3232
<Link href='/' aria-label='Sim home' className='flex h-[30px] items-center'>

apps/sim/app/_shell/desktop-title-bar-surfaces.test.ts

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,21 @@ import { readFileSync } from 'node:fs'
55
import { resolve } from 'node:path'
66
import { describe, expect, it } from 'vitest'
77

8-
const auditedSurfaces = {
9-
'desktop-title-bar-page': [
10-
'app/(auth)/components/auth-shell.tsx',
11-
'app/(interfaces)/resume/[workflowId]/[executionId]/loading.tsx',
12-
'app/(landing)/components/logo-shell/logo-shell.tsx',
13-
'app/desktop/auth/page.tsx',
14-
'app/desktop/connect/complete/page.tsx',
15-
'app/desktop/connect/connect-launcher.tsx',
16-
'app/desktop/connect/page.tsx',
17-
'app/f/[token]/public-file-view.tsx',
18-
'app/playground/page.tsx',
19-
'app/workspace/[workspaceId]/components/workspace-access-denied.tsx',
20-
],
21-
'desktop-title-bar-page-height': [
22-
'app/(landing)/components/landing-shell/landing-shell.tsx',
23-
'app/workspace/page.tsx',
24-
'components/settings/settings-unavailable.tsx',
25-
'components/settings/standalone-settings-shell.tsx',
26-
],
27-
'desktop-title-bar-fixed-page': [
28-
'app/(interfaces)/chat/[identifier]/chat.tsx',
29-
'app/(interfaces)/chat/[identifier]/loading.tsx',
30-
'app/(interfaces)/chat/components/loading-state/loading-state.tsx',
31-
'app/(interfaces)/chat/components/voice-interface/voice-interface.tsx',
32-
'app/workspace/[workspaceId]/components/impersonation-banner/impersonation-expired.tsx',
33-
'app/workspace/[workspaceId]/files/[fileId]/view/file-viewer.tsx',
34-
],
35-
} as const
36-
378
describe('desktop title-bar surface audit', () => {
38-
for (const [safeAreaClass, files] of Object.entries(auditedSurfaces)) {
39-
for (const file of files) {
40-
it(`${file} uses ${safeAreaClass}`, () => {
41-
expect(readFileSync(resolve(process.cwd(), file), 'utf8')).toContain(safeAreaClass)
42-
})
43-
}
44-
}
9+
it('applies the safe-area shell only when the auth route is login', () => {
10+
const authLayout = readFileSync(
11+
resolve(process.cwd(), 'app/(auth)/auth-layout-client.tsx'),
12+
'utf8'
13+
)
14+
const authShell = readFileSync(
15+
resolve(process.cwd(), 'app/(auth)/components/auth-shell.tsx'),
16+
'utf8'
17+
)
18+
19+
expect(authLayout).toContain("usePathname() === '/login'")
20+
expect(authLayout).toContain('reserveDesktopTitleBar={isLogin}')
21+
expect(authShell).toContain(
22+
"reserveDesktopTitleBar ? 'desktop-title-bar-page' : 'min-h-screen'"
23+
)
24+
})
4525
})

0 commit comments

Comments
 (0)