Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Window frame: the sidebar back in the app's card, and the rail in the bar's colour (#4061)

Omkar Satputeccb66496fae2
diff --git a/scripts/verify-window-frame.ts b/scripts/verify-window-frame.ts
index d7460a7731..e83971773a 100644
--- a/scripts/verify-window-frame.ts
+++ b/scripts/verify-window-frame.ts
@@ -1,6 +1,6 @@
// The window's own frame in the real app, as the desktop window draws it on macOS and Windows: the top bar (the
// traffic lights or the caption buttons, the rail's button, the place on screen in its middle, an update, Settings),
-// the rail of places beside it, the sidebar on the frame's colour beside the app's card, the sidebar's edge dragged to
+// the rail of places beside it in the bar's colour, the sidebar and the chat in the app's card, the sidebar's edge dragged to
// its avatars and back, the same window with the frame turned off, and the rail's tiles up close. Against a disposable fake-engine server, with the desktop bridge
// of scripts/testing/rail-preview.tsx (the window's own rail drawn by its own page, in a frame).
// Run: node --experimental-strip-types scripts/verify-window-frame.ts --shots <dir> [--only <view,view>] [--skins all]
diff --git a/src/App.tsx b/src/App.tsx
index 8d90f392da..f1699dffaf 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -337,6 +337,13 @@ function Shell({ viewer }: { viewer: WelcomeViewer | null }) {
/>
)}
{!calendarFocus && <PlacesRail />}
+ {/* A framed window shows the app, its sidebar and the chat or page, in a rounded card on the frame beside the
+ window's rail: its top corners and its bottom-left corner are round, and it runs to the window's right and
+ bottom edges. */}
+ <div data-window-card={framed ? "" : undefined}
+ className={framed ? "relative flex min-w-0 flex-1 flex-col overflow-hidden rounded-t-[12px] rounded-bl-[12px] bg-app ring-1 ring-ink/[0.06]" : "contents"}>
+ {framed && strips}
+ <div className={framed ? "relative flex min-h-0 flex-1" : "contents"}>
{!calendarFocus && <Sidebar
collapseToIcons={collapseSidebar}
open={drawerOpen}
@@ -345,12 +352,6 @@ function Shell({ viewer }: { viewer: WelcomeViewer | null }) {
menuButtonRef.current?.focus();
}}
/>}
- {/* A framed window shows the chat or page in a rounded card, on the frame beside the sidebar: its top corners and
- its bottom-left corner are round, and it runs to the window's right and bottom edges. */}
- <div data-window-card={framed ? "" : undefined}
- className={framed ? "relative flex min-w-0 flex-1 flex-col overflow-hidden rounded-t-[12px] rounded-bl-[12px] bg-app ring-1 ring-ink/[0.06]" : "contents"}>
- {framed && strips}
- <div className={framed ? "relative flex min-h-0 flex-1" : "contents"}>
{state.activeView === "team-map" ? (
<TeamMapPage />
) : state.activeView === "files" ? (
diff --git a/src/components/DesktopCapabilities.tsx b/src/components/DesktopCapabilities.tsx
index 470c92a1a0..1bd7000592 100644
--- a/src/components/DesktopCapabilities.tsx
+++ b/src/components/DesktopCapabilities.tsx
@@ -65,8 +65,8 @@ export function windowFrameable(capabilities: Pick<DesktopCapabilities, "windowC
}
/** A window that draws its own frame: the top bar holding the traffic lights or the Windows caption buttons
- * (WindowFrameBar), the rail of places and the sidebar on the frame's colour, and the chat or page in a rounded card
- * beside them. Nothing under the bar makes room for the window's buttons. Off once the person turned the frame off. */
+ * (WindowFrameBar) and the rail of places in the frame's colour, and the app, its sidebar and the chat or page, in a
+ * rounded card beside them. Nothing under the bar makes room for the window's buttons. Off once the person turned the frame off. */
export function windowFramed(capabilities: Pick<DesktopCapabilities, "windowChrome" | "windowFrame"> | undefined): boolean {
return windowFrameable(capabilities) && capabilities?.windowFrame !== false;
}
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index c3f456294a..243ad53027 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -1250,16 +1250,13 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {
aria-label={t("sidebar.aria")}
data-native-view-overlay
data-sidebar
- data-framed={framed ? "" : undefined}
onClick={(event) => {
// The phone's list covers the whole screen: choosing the bot that is already open has to dismiss it too.
if (phone && open && event.target instanceof Element && !(event.target instanceof HTMLInputElement) && event.target.closest("[data-sidebar-bot-row], [data-sidebar-hero]")) onClose();
}}
style={{ "--sidebar-width": `${sizing.width}px` } as CSSProperties}
className={cn(
- "relative flex h-full shrink-0 flex-col max-md:[--scroll-fade-surface:var(--color-app)]",
- // Framed, the sidebar is the frame's: the window's frame colour shows through it, and the card's edge is its own.
- framed ? "[--scroll-fade-surface:var(--color-frame)]" : "border-r border-ink/[0.04] bg-panel",
+ "relative flex h-full shrink-0 flex-col border-r border-ink/[0.04] bg-panel max-md:[--scroll-fade-surface:var(--color-app)]",
sizing.resizing && !sizing.snapping ? "transition-none" : "transition-[width] duration-200 motion-reduce:transition-none",
density === "icons" ? rail ? "w-[92px]" : "w-[80px]" : advanced ? "w-[320px] md:w-[var(--sidebar-width)]" : "w-[280px] md:w-[var(--sidebar-width)]",
sidePanelOpen ? advanced ? "md:max-w-[320px]" : "md:max-w-[280px]" : "md:max-w-[calc(100vw-320px)]",
diff --git a/src/styles.css b/src/styles.css
index 2625670df5..4846f5f01d 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -162,8 +162,8 @@
there `raised` is pure white and a card is too. */
--color-control: #282828;
--color-hairline: #383838;
- /* the window's frame: its top bar, the rail of places and the sidebar,
- around the app's rounded card. The app's own colour a step darker, so it
+ /* the window's frame: its top bar and the rail of places, around the
+ app's rounded card (the sidebar and the chat). The app's own colour a step darker, so it
stays in the skin's family: --frame-shade of black. */
--color-frame: color-mix(in oklab, var(--color-app), black var(--frame-shade));
--color-ink: #f5f5f5;
@@ -1592,9 +1592,6 @@ body {
.place-banner img { --place-banner-strength: 0.26; filter: blur(1.5px) saturate(0.85) brightness(0.8); }
}
.place-tint[data-under-banner] { display: none; }
-/* In a framed window the sidebar sits on the frame, under the top bar and beside the rail: its colour or picture rounds
- its top-left corner where the two meet, as the card beside it does. */
-[data-sidebar][data-framed] :is(.place-tint, .place-banner) { border-top-left-radius: 12px; }
@media (prefers-reduced-transparency: reduce) {
.place-banner { display: none; }
.place-tint[data-under-banner] { display: block; }
@@ -2912,7 +2909,10 @@ button:disabled.bg-danger {
scripts/check-skin-contrast.mjs measures these as "<skin> (phone)", so the
AA pairs hold here exactly as on desktop. */
@media (max-width: 767.98px) {
+ /* The window's frame keeps the desktop ground at any width: the rail of places is a page 36px wide beside a full
+ page, and both draw the frame's top bar or rail in one colour. */
:is([data-skin="midnight"]) {
+ --color-frame: color-mix(in oklab, #121212, black var(--frame-shade));
--color-app: #141414;
--color-panel: #1c1c1e;
--color-raised: #2c2c2e;
@@ -2931,6 +2931,7 @@ button:disabled.bg-danger {
--radius-menu: 22px;
}
:is([data-skin="meadow"]) {
+ --color-frame: color-mix(in oklab, #ffffff, black var(--frame-shade));
--color-app: #f6f8f6;
--color-panel: #fcfdfc;
--color-card: #ffffff;