refactor(website): drop the fill mode superseded by compact + dead shell defaults
After compact landed, ProductVisual's fill only ever co-occurred with compact, which overrode everything fill did in the shell. Removed fill from AppPreviewFrame (and its crop branches) and from ShellScene; fill now solely drives StyledRoot filling the morph area. Also removed ShellScene's now-unreachable aspect-ratio / max-height defaults (every instance is bleed or compact, so height is constant).
This commit is contained in:
@@ -14,9 +14,8 @@ export type AppPreviewFrameMode = 'static' | 'windowed';
|
||||
const APP_PREVIEW_FRAME_MAX_WIDTH = 1040;
|
||||
const APP_PREVIEW_FRAME_ASPECT_RATIO = '1280 / 832';
|
||||
|
||||
const StaticFrameRoot = styled.div<{ $fill: boolean; $compact: boolean }>`
|
||||
align-items: ${({ $fill, $compact }) =>
|
||||
$fill && !$compact ? 'flex-start' : 'stretch'};
|
||||
const StaticFrameRoot = styled.div`
|
||||
align-items: stretch;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
@@ -25,7 +24,7 @@ const StaticFrameRoot = styled.div<{ $fill: boolean; $compact: boolean }>`
|
||||
|
||||
// compact fills the (fixed-height, fluid-width) scene box without aspect-ratio,
|
||||
// so the board reflows instead of the whole window scaling with width.
|
||||
const StaticShell = styled.div<{ $fill: boolean; $compact: boolean }>`
|
||||
const StaticShell = styled.div<{ $compact: boolean }>`
|
||||
aspect-ratio: ${({ $compact }) =>
|
||||
$compact ? 'auto' : APP_PREVIEW_FRAME_ASPECT_RATIO};
|
||||
background-color: ${VISUAL_TOKENS.background.primary};
|
||||
@@ -36,7 +35,7 @@ const StaticShell = styled.div<{ $fill: boolean; $compact: boolean }>`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: ${({ $compact }) => ($compact ? '100%' : 'auto')};
|
||||
max-height: ${({ $fill, $compact }) => ($fill || $compact ? 'none' : '100%')};
|
||||
max-height: ${({ $compact }) => ($compact ? 'none' : '100%')};
|
||||
max-width: ${({ $compact }) =>
|
||||
$compact ? 'none' : `${APP_PREVIEW_FRAME_MAX_WIDTH}px`};
|
||||
overflow: hidden;
|
||||
@@ -58,14 +57,12 @@ const StaticContent = styled.div`
|
||||
type AppPreviewFrameProps = {
|
||||
children: ReactNode;
|
||||
compact?: boolean;
|
||||
fill?: boolean;
|
||||
mode: AppPreviewFrameMode;
|
||||
};
|
||||
|
||||
export function AppPreviewFrame({
|
||||
children,
|
||||
compact = false,
|
||||
fill = false,
|
||||
mode,
|
||||
}: AppPreviewFrameProps) {
|
||||
if (mode === 'windowed') {
|
||||
@@ -73,8 +70,8 @@ export function AppPreviewFrame({
|
||||
}
|
||||
|
||||
return (
|
||||
<StaticFrameRoot $compact={compact} $fill={fill}>
|
||||
<StaticShell $compact={compact} $fill={fill}>
|
||||
<StaticFrameRoot>
|
||||
<StaticShell $compact={compact}>
|
||||
<MacWindowBar interactive={false} />
|
||||
<StaticContent>{children}</StaticContent>
|
||||
</StaticShell>
|
||||
|
||||
+4
-16
@@ -58,20 +58,13 @@ const PANEL_ONLY_WIDTH = 320;
|
||||
// stay legible — used by the morph so the AI panel never bleeds off-screen.
|
||||
// panelOnly: the compact window is capped to a fixed chat width.
|
||||
const ShellScene = styled.div<{
|
||||
$fill: boolean;
|
||||
$bleed: boolean;
|
||||
$compact: boolean;
|
||||
$panelOnly: boolean;
|
||||
}>`
|
||||
aspect-ratio: ${({ $fill, $bleed, $compact }) =>
|
||||
$fill || $bleed || $compact ? 'auto' : '1280 / 832'};
|
||||
flex: ${({ $fill, $bleed, $compact }) =>
|
||||
$fill && !$bleed && !$compact ? '1' : '0 0 auto'};
|
||||
height: ${({ $bleed, $compact }) =>
|
||||
$bleed || $compact ? `${WINDOW_HEIGHT}px` : 'auto'};
|
||||
flex: 0 0 auto;
|
||||
height: ${WINDOW_HEIGHT}px;
|
||||
margin: 0 auto;
|
||||
max-height: ${({ $fill, $bleed, $compact }) =>
|
||||
$fill || $bleed || $compact ? 'none' : '740px'};
|
||||
max-width: ${({ $compact, $panelOnly }) =>
|
||||
$panelOnly
|
||||
? `${PANEL_ONLY_WIDTH}px`
|
||||
@@ -500,7 +493,7 @@ export function ProductVisual({
|
||||
);
|
||||
|
||||
const previewShell = (
|
||||
<AppPreviewFrame compact={compact} fill={fill} mode={frameMode}>
|
||||
<AppPreviewFrame compact={compact} mode={frameMode}>
|
||||
<AppPreviewLayout
|
||||
activeItem={activeItem}
|
||||
activeItemId={activeItemId}
|
||||
@@ -638,12 +631,7 @@ export function ProductVisual({
|
||||
|
||||
return (
|
||||
<StyledRoot $fill={fill}>
|
||||
<ShellScene
|
||||
$bleed={bleed}
|
||||
$compact={compact}
|
||||
$fill={fill}
|
||||
$panelOnly={panelOnly}
|
||||
>
|
||||
<ShellScene $bleed={bleed} $compact={compact} $panelOnly={panelOnly}>
|
||||
{frameMode === 'windowed' ? (
|
||||
<WindowOrderProvider>{previewShell}</WindowOrderProvider>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user