Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chg(splits): add small bento-fication for multi split case (#6593)

Seamus48a9608f3627
diff --git a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx
index 3e4ba2ee85..8f3aa25cab 100644
--- a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx
+++ b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx
@@ -52,7 +52,10 @@ export const SidebarRail = () => {
<div
{...hotkeyScopeNeutralAttribute}
data-ui="sidebar-rail"
- class="relative flex h-full w-14 shrink-0 flex-col items-center gap-2 overflow-hidden border-r border-edge-muted bg-surface px-2.5 pb-3 pt-3"
+ classList={{
+ 'border-r': (globalSplitManager()?.splits().length ?? 1) <= 1,
+ }}
+ class="relative flex h-full w-14 shrink-0 flex-col items-center gap-2 overflow-hidden border-edge-muted bg-surface px-2.5 pb-3 pt-3"
>
<SidebarRailCreateButton />
<SearchRailButton />
diff --git a/apps/web/src/components/app/split-layout/SplitLayout.tsx b/apps/web/src/components/app/split-layout/SplitLayout.tsx
index cca159325d..65e24f9bff 100644
--- a/apps/web/src/components/app/split-layout/SplitLayout.tsx
+++ b/apps/web/src/components/app/split-layout/SplitLayout.tsx
@@ -70,6 +70,7 @@ export function SplitLayoutContainer(props: SplitLayoutContainerProps) {
const panelRefs = new Map<SplitId, HTMLDivElement>();
const splits = createMemo(splitManager.splits);
+ const useBentoLayout = () => !isTouchDevice() && splits().length > 1;
// Drop refs for departed splits by reconciling against the live list:
// batched mutations can remove several splits in one flush (e.g. closing
@@ -109,16 +110,15 @@ export function SplitLayoutContainer(props: SplitLayoutContainerProps) {
return (
<SplitLayoutContext.Provider value={{ manager: splitManager }}>
- {/* Desktop panes are flush with the window and each other: the resize
- gutter between them is the 1px divider. Touch keeps its own layout. */}
- <div class="size-full">
+ <div class="size-full" classList={{ 'py-1.5 pr-1.5': useBentoLayout() }}>
<Show
when={isNativeMobilePlatform() && mobileSwipeLayout}
fallback={
// Desktop: side-by-side resizable splits.
<Resize.Zone
direction="horizontal"
- gutter={1}
+ gutter={useBentoLayout() ? 6 : 1}
+ showDividers={!useBentoLayout()}
captureResizeCtx={splitManager.setResizeContext}
>
<For each={ids()}>
diff --git a/apps/web/src/components/app/split-layout/components/SplitPanel.tsx b/apps/web/src/components/app/split-layout/components/SplitPanel.tsx
index b02abd1d38..a27979e3d9 100644
--- a/apps/web/src/components/app/split-layout/components/SplitPanel.tsx
+++ b/apps/web/src/components/app/split-layout/components/SplitPanel.tsx
@@ -172,22 +172,6 @@ export function SplitPanel(props: SplitPanelProps) {
const splitUnfocusedStyling = () =>
!isTouchDevice() && !props.active && multipleSplits();
- const gutterSize = () =>
- globalSplitManager()?.resizeContext()?.gutterSize() ?? 0;
-
- /**
- * This split is a Viewer sitting immediately right of its Controller: the
- * pane slides left across the gutter so it sits flush against the
- * Controller, reading as tucked behind it.
- */
- const tuckedBehindController = createMemo(() => {
- return (
- !isTouchDevice() &&
- !props.handle.isSpotLight() &&
- props.handle.isViewerSplit()
- );
- });
-
const usesComposableLayout = () =>
props.split.mount.kind === 'component' &&
props.split.mount.meta.splitPanelLayout === 'composable';
@@ -284,14 +268,6 @@ export function SplitPanel(props: SplitPanelProps) {
// mobile/tablet: status bar + floating header strip.
'--mobile-content-inset-top':
'calc(var(--safe-top, 0px) + var(--split-header-height, 0px))',
- // Slide the preview pane left across the gutter so it sits
- // flush against the controller, keeping its right edge in
- // place. The gutter's drag hit-area still paints (and
- // hit-tests) above this extension, so resizing works.
- ...(tuckedBehindController() && {
- 'margin-left': `-${gutterSize()}px`,
- width: `calc(100% + ${gutterSize()}px)`,
- }),
}}
ref={(ref) => {
setPanelRef(ref);
@@ -306,7 +282,11 @@ export function SplitPanel(props: SplitPanelProps) {
<Panel
class={cn(
'touch:rounded-none touch:after:hidden touch:border-0! bg-panel transition-none',
- props.handle.isSpotLight() ? 'rounded-xl' : 'rounded-none',
+ props.handle.isSpotLight()
+ ? 'rounded-xl'
+ : multipleSplits()
+ ? 'rounded-md'
+ : 'rounded-none',
splitUnfocusedStyling() && 'split-panel-inactive',
{
'shadow-sm shadow-drop-shadow/50': splitUnfocusedStyling(),
@@ -314,7 +294,7 @@ export function SplitPanel(props: SplitPanelProps) {
}
)}
depth={isTouchDevice() ? 0 : 1}
- hideBorder={!props.handle.isSpotLight()}
+ hideBorder={!props.handle.isSpotLight() && !multipleSplits()}
>
<Show when={!usesComposableLayout()}>
<Panel.Header
diff --git a/apps/web/src/lib/core/component/Resize/Resize.tsx b/apps/web/src/lib/core/component/Resize/Resize.tsx
index 66a2848f94..a24b0eeda5 100644
--- a/apps/web/src/lib/core/component/Resize/Resize.tsx
+++ b/apps/web/src/lib/core/component/Resize/Resize.tsx
@@ -34,6 +34,8 @@ export const ResizeZoneContext = createContext<ResizeZoneCtx>();
type ZoneProps = {
direction: 'horizontal' | 'vertical';
gutter?: number;
+ /** Paint a divider in each gutter. Defaults to true. */
+ showDividers?: boolean;
minSize?: number;
class?: string;
id?: string;
@@ -219,6 +221,7 @@ function Zone(props: ParentProps<ZoneProps>) {
offset={panel().offset + panel().size}
index={actualIndex}
resizable={gutterEnabled()}
+ showDivider={props.showDividers ?? true}
nudge={solver.moveHandle}
onChangeStart={beginResizeChange}
onChangeEnd={endResizeChange}
@@ -412,6 +415,7 @@ function Panel(props: ParentProps<PanelProps>) {
* @property nudge - Function to call when the gutter is moved, with index and movement amount
*/
type GutterProps = {
+ showDivider: boolean;
offset: number;
index: number;
/** Draggable and keyboard-focusable; otherwise a static divider. */
@@ -561,15 +565,16 @@ function Gutter(props: GutterProps) {
onPointerDown={props.resizable ? onPointerDown : undefined}
onKeyDown={props.resizable ? onKeyDown : undefined}
>
- {/* The always-on 1px divider between the two panels. Touch layouts keep
- their own spacing and do not draw it. */}
- <div
- class={cn(
- 'absolute border-edge-muted touch:hidden',
- horizontal() ? 'border-l-[1px]' : 'border-t-[1px]'
- )}
- style={barStyle('1px')}
- />
+ {/* Spaced panels can omit the divider while retaining resize feedback. */}
+ <Show when={props.showDivider}>
+ <div
+ class={cn(
+ 'absolute border-edge-muted touch:hidden',
+ horizontal() ? 'border-l-[1px]' : 'border-t-[1px]'
+ )}
+ style={barStyle('1px')}
+ />
+ </Show>
{/* Hover, focus and drag feedback paints over the divider. */}
<Show when={props.resizable}>
<div
diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.md
index 7b0f2bd55c..6dcf5cdeb6 100644
--- a/docs/AGENT_GUIDE/navigation.md
+++ b/docs/AGENT_GUIDE/navigation.md
@@ -73,6 +73,11 @@ its existing navigation controls. Block detail panels (including Calendar) have
**Hide side panel** in their own header and a hamburger **Show side panel** beside
the main title when hidden, with separate preferences per block type.
+Multiple desktop splits appear as individually bordered, medium-rounded panels with
+6px top, right, and bottom insets and 6px resizable gaps, including preview pairs.
+The leftmost panel sits flush against the app rail, whose divider is hidden while
+multiple splits are open. A single split stays edge to edge. Touch layouts keep their existing presentation.
+
Split focus mode (`Shift+Esc`) floats the active split in a rounded, bordered
panel over the same glass scrim as dialogs. Click the scrim or use the shortcut
again to restore the split layout.