Skip to content

Commit 75eccb9

Browse files
committed
fix(desktop): size the peek card to its content, soften the overlay shadow
The floating sidebar pinned both its top and bottom edges, so it always drew at full window height. On a short surface — the settings list — that left a tall empty slab of card hanging below the last entry. The card now hugs its content and caps at the pane height less the traffic-light lane and the bottom gutter. Dropping the bottom pin is most of it: the four `h-full` rules down the chain resolve against an auto-height parent and collapse to content on their own. But nothing would then bound the sidebar's own `flex-1 overflow-y-auto` region, so a long workflow list would be clipped by the card's `overflow-hidden` instead of scrolling. The card is therefore a capped flex column, and the shell is allowed to shrink inside it, which restores a definite height for the chain to resolve against. That rule is scoped to `[data-peek]` and is inert while docked, where the shell is not a flex item. Also eases `--shadow-overlay` in both themes (alpha ~27% lighter, bloom pulled in from 48px to 30px), keeping it clearly above `--shadow-medium` so the scale still reads in order. The peek card drops the shadow entirely and separates on the same `--border` hairline the content pane beside it uses.
1 parent d5b1606 commit 75eccb9

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ describe('desktop title-bar surface audit', () => {
8888
expect(workspaceChrome).toContain('data-content-fullscreen={isFullscreen || undefined}')
8989
})
9090

91+
it('sizes the peek card to its content, capped against the lane', () => {
92+
// Pinning both edges made the card full height, so a short list (settings) left a
93+
// tall empty slab over the content. It now hugs its content and caps at the pane
94+
// height less the lane and the bottom gutter, so a long list still scrolls.
95+
expect(workspaceChrome).toContain('max-h-[calc(100%-var(--desktop-title-bar-height)-8px)]')
96+
expect(workspaceChrome).not.toMatch(/PEEK_CARD_CHROME[\s\S]{0,240}?bottom-2/)
97+
})
98+
9199
it('clears the lane for panels that embed pages away from the lights', () => {
92100
// The mothership panel is the right half of the pane and embeds whole pages
93101
// (KnowledgeBase et al) whose header bars reserve the lane. It inherits the

apps/sim/app/_styles/globals.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
/* Shadow scale */
4545
--shadow-subtle: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
4646
--shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
47-
--shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.15);
47+
--shadow-overlay: 0 10px 30px rgba(0, 0, 0, 0.11);
4848
--shadow-kbd: 0 4px 0 0 rgba(48, 48, 48, 1);
4949
--shadow-kbd-sm: 0 2px 0 0 rgba(48, 48, 48, 1);
5050
--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
@@ -173,6 +173,14 @@ html[data-sim-desktop-title-bar="inset"]
173173
transition: none;
174174
}
175175

176+
/* The card is a flex column sized to its content, so the shell must be allowed to
177+
shrink for the sidebar's own scroll region to bound itself once the card hits its
178+
max height. Docked, this element is not a flex item and the rule is inert. */
179+
.sidebar-shell-outer[data-peek] .sidebar-shell-inner {
180+
min-height: 0;
181+
flex-shrink: 1;
182+
}
183+
176184
.sidebar-container span,
177185
.sidebar-container .text-small {
178186
transition: opacity 120ms ease;
@@ -583,7 +591,7 @@ html.sidebar-booting .sidebar-shell-inner {
583591
--scrollbar-thumb-hover-color: #6a6a6a;
584592

585593
/* Shadow scale - dark */
586-
--shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.4);
594+
--shadow-overlay: 0 10px 30px rgba(0, 0, 0, 0.3);
587595
}
588596
}
589597

apps/sim/app/workspace/[workspaceId]/components/workspace-chrome/workspace-chrome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const SLIDE_TRANSITION =
3232
* card widens as it appears and leaves a shrinking ghost on retract.
3333
*/
3434
const PEEK_CARD_CHROME =
35-
'absolute top-[var(--desktop-title-bar-height)] bottom-2 left-2 z-[var(--z-modal)] w-auto origin-top-left rounded-lg border border-[var(--border)] shadow-overlay'
35+
'absolute top-[var(--desktop-title-bar-height)] left-2 z-[var(--z-modal)] flex max-h-[calc(100%-var(--desktop-title-bar-height)-8px)] w-auto flex-col origin-top-left rounded-lg border border-[var(--border)]'
3636

3737
/**
3838
* Peek card enter/exit — the popper idiom rather than a slide, since the card is

0 commit comments

Comments
 (0)