-
Notifications
You must be signed in to change notification settings - Fork 4k
feat(shell): rebuild the app shell as chrome + an inset content card #5442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
310f8ee
57644a2
459a435
01dd34f
dbedf5e
e9520b4
95fd9d0
dc038ba
8705ee5
57a1475
787e7bd
aeb17cc
0ba99cf
2a97b24
a20d919
a69b210
35f6203
13459e7
8eb89ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,7 +147,12 @@ export default function ChatNewWindowHero() { | |
| the app background. */} | ||
| <div | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace // comments inside the JSX tag with {/ /} or remove them The diff inserts [RULE] JSX syntax · |
||
| data-walkthrough="home-card" | ||
| className="animate-fade-up rounded-2xl border border-line/80 bg-surface/80 p-6 shadow-soft backdrop-blur-sm dark:border-line/80"> | ||
| // `surface-muted`, not `surface/80`: the translucent fill only read as a | ||
| // card while the chat page painted a darker tint beneath it. The page is | ||
| // the card surface now, so surface/80 over surface would flatten to the | ||
| // same colour and leave only the border. This is the same lift token the | ||
| // message bubbles use. | ||
| className="animate-fade-up rounded-2xl border border-line/80 bg-surface-muted p-6 shadow-soft dark:border-line/80"> | ||
| {/* Animated greeting */} | ||
| <h1 className="min-h-[3.5rem] text-2xl text-center font-bold text-content"> | ||
| {typedWelcome} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { cleanup, render, screen } from '@testing-library/react'; | ||
| import { afterEach, describe, expect, it } from 'vitest'; | ||
|
|
||
| import ContentSurface from './ContentSurface'; | ||
|
|
||
| describe('ContentSurface', () => { | ||
| afterEach(cleanup); | ||
|
|
||
| it('renders children', () => { | ||
| render( | ||
| <ContentSurface> | ||
| <p>routed page</p> | ||
| </ContentSurface> | ||
| ); | ||
| expect(screen.getByText('routed page')).toBeTruthy(); | ||
| }); | ||
|
|
||
| it('frames the surface as an inset rounded card by default', () => { | ||
| render(<ContentSurface>body</ContentSurface>); | ||
| const surface = screen.getByTestId('app-content-surface'); | ||
| expect(surface.className).toContain('rounded-2xl'); | ||
| expect(surface.className).toContain('shadow-content-edge'); | ||
| // Even inset on all four sides so the chrome frames the card. | ||
| expect(surface.className).toContain('m-3'); | ||
| expect(surface.dataset.unframed).toBeUndefined(); | ||
| }); | ||
|
|
||
| it('drops the radius, insets and seam when unframed', () => { | ||
| render(<ContentSurface unframed>body</ContentSurface>); | ||
| const surface = screen.getByTestId('app-content-surface'); | ||
| // The compositing constraint this exists for: content drawn above the HTML | ||
| // layer as a plain rectangle would leave four square corners poking through | ||
| // a rounded card. | ||
| expect(surface.className).not.toContain('rounded-2xl'); | ||
| expect(surface.className).not.toContain('shadow-content-edge'); | ||
| expect(surface.className).not.toContain('m-3'); | ||
| expect(surface.dataset.unframed).toBe('true'); | ||
| }); | ||
|
|
||
| it('keeps the bounded flex column in both modes so the page owns the scroll', () => { | ||
| const { rerender } = render(<ContentSurface>body</ContentSurface>); | ||
| expect(screen.getByTestId('app-content-surface').className).toContain('min-h-0'); | ||
| rerender(<ContentSurface unframed>body</ContentSurface>); | ||
| const surface = screen.getByTestId('app-content-surface'); | ||
| expect(surface.className).toContain('min-h-0'); | ||
| expect(surface.className).toContain('flex-1'); | ||
| expect(surface.className).toContain('bg-surface'); | ||
| }); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.