From 49e8bf788523e2486340cfab139edf9fd1f9f316 Mon Sep 17 00:00:00 2001 From: piexel Date: Wed, 11 Nov 2026 01:15:31 +0100 Subject: [PATCH] Lay the studio out as IntelliJ's islands: a view stripe, icon tools and a tinted frame --- .../src/renderer/src/components/ui/dialog.tsx | 2 +- .../src/renderer/src/studio/ConnectScreen.tsx | 2 +- studio/src/renderer/src/studio/MapStudio.tsx | 4 +- .../renderer/src/studio/RegionPreviewList.tsx | 2 +- studio/src/renderer/src/studio/Sidebar.tsx | 5 +- .../src/renderer/src/studio/StudioToolbar.tsx | 12 ++-- studio/src/renderer/src/studio/ViewList.tsx | 57 ++++++++++++------- studio/src/renderer/src/styles.css | 13 ++++- 8 files changed, 60 insertions(+), 37 deletions(-) diff --git a/studio/src/renderer/src/components/ui/dialog.tsx b/studio/src/renderer/src/components/ui/dialog.tsx index c711324fb..c024d32ea 100644 --- a/studio/src/renderer/src/components/ui/dialog.tsx +++ b/studio/src/renderer/src/components/ui/dialog.tsx @@ -61,7 +61,7 @@ function DialogContent({ +

Open a world

diff --git a/studio/src/renderer/src/studio/MapStudio.tsx b/studio/src/renderer/src/studio/MapStudio.tsx index ffe7b2d8c..59d89ffa6 100644 --- a/studio/src/renderer/src/studio/MapStudio.tsx +++ b/studio/src/renderer/src/studio/MapStudio.tsx @@ -212,10 +212,10 @@ export function MapStudio({ client, world, theme, onDisconnect }: MapStudioProps ) return ( -

+
setHelpOpen(true)} onSettings={() => setSettingsOpen(true)} onDisconnect={onDisconnect} /> -
+
{viewId === 'regions' && regions.length > 1 && ( diff --git a/studio/src/renderer/src/studio/RegionPreviewList.tsx b/studio/src/renderer/src/studio/RegionPreviewList.tsx index d3b1e1d2b..d578fcbee 100644 --- a/studio/src/renderer/src/studio/RegionPreviewList.tsx +++ b/studio/src/renderer/src/studio/RegionPreviewList.tsx @@ -21,7 +21,7 @@ export function RegionPreviewList({ regions, current, onSelect }: RegionPreviewL const shown = wanted === '' ? regions : regions.filter((region) => `${region.name} ${region.key}`.toLowerCase().includes(wanted)) return (
-

Preview a region

+

Preview a region

{regions.length >= SEARCHABLE_FROM_REGIONS && ( {children}
, slot) } -/** One choice of a switch in an island's header: plain until chosen, like the header's other buttons. */ -export const HEADER_CHOICE = 'h-7 flex-none rounded-md! px-2.5 text-[12.5px] font-normal hover:bg-accent hover:text-foreground data-[state=on]:bg-selection data-[state=on]:text-foreground' +/** One choice of a switch in an island's header: plain until chosen and outlined then, as IntelliJ's tabs are. */ +export const HEADER_CHOICE = + 'h-7 flex-none rounded-md! border border-transparent px-2.5 text-[12.5px] font-normal hover:bg-accent hover:text-foreground data-[state=on]:border-input data-[state=on]:bg-transparent data-[state=on]:text-foreground' interface StepperProps { /** Where the steps are now: "Variant 2 of 5". */ diff --git a/studio/src/renderer/src/studio/StudioToolbar.tsx b/studio/src/renderer/src/studio/StudioToolbar.tsx index 8692cec14..5d4e88f56 100644 --- a/studio/src/renderer/src/studio/StudioToolbar.tsx +++ b/studio/src/renderer/src/studio/StudioToolbar.tsx @@ -66,20 +66,20 @@ export function MapTools({ toggles, hasPlayers, onToggle, onRefresh, onResetZoom return ( <> onToggle('grid')}> - Grid + onToggle('regionBorders')}> - Borders + onToggle('shading')}> - Shading + onToggle('entities')}> - Entities + onToggle('follow')}> - Follow + @@ -134,7 +134,7 @@ function ToolToggle({ action, hint, pressed, disabled, onPressed, children }: To pressed={pressed} disabled={disabled} onPressedChange={onPressed} - className="h-7 gap-1.5 px-2 text-[12.5px] font-normal hover:bg-accent hover:text-foreground data-[state=on]:bg-selection data-[state=on]:text-foreground [&_svg:not([class*='size-'])]:size-3.5" + className="size-7 min-w-7 p-0 hover:bg-accent hover:text-foreground data-[state=on]:bg-selection data-[state=on]:text-foreground [&_svg:not([class*='size-'])]:size-3.5" > {children} diff --git a/studio/src/renderer/src/studio/ViewList.tsx b/studio/src/renderer/src/studio/ViewList.tsx index 8a639699c..9423eb563 100644 --- a/studio/src/renderer/src/studio/ViewList.tsx +++ b/studio/src/renderer/src/studio/ViewList.tsx @@ -1,5 +1,7 @@ +import { Fragment } from 'react' import { IdeIcon, type IdeIconName } from '@/components/IdeIcon' import { Kbd } from '@/components/ui/kbd' +import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/utils' import type { ViewInfo } from '../bridge/types' import { viewShortcutId } from './shortcuts' @@ -25,43 +27,56 @@ interface ViewListProps { views: ViewInfo[] current: string onSelect(view: string): void - /** Receives the element the shown view fills with its own lists, under the views. */ + /** Receives the element the shown view fills with its own lists, beside the views. */ slotRef(element: HTMLElement | null): void } -/** The left island: the views the server offers in their groups, then the shown view's own lists. */ +/** + * The views the server offers, as a stripe of buttons on the window's edge in their groups, and beside it the island + * the shown view fills with its own lists, which is not there for a view without any (IntelliJ's tool window stripe). + */ export function ViewList({ views, current, onSelect, slotRef }: ViewListProps): React.JSX.Element { const groups = [...new Set(views.map((view) => view.groupLabel))] return ( -
- -
-
+
+ ) } -function ViewRow({ view, selected, onSelect }: { view: ViewInfo; selected: boolean; onSelect(): void }): React.JSX.Element { +function ViewButton({ view, selected, onSelect }: { view: ViewInfo; selected: boolean; onSelect(): void }): React.JSX.Element { const keyText = useKeyText()(viewShortcutId(view.id)) return ( - + + + + + + + {view.label} + {keyText !== '' && {keyText}} + + {view.description} + + ) } diff --git a/studio/src/renderer/src/styles.css b/studio/src/renderer/src/styles.css index 141e4985a..219763905 100644 --- a/studio/src/renderer/src/styles.css +++ b/studio/src/renderer/src/styles.css @@ -4,7 +4,7 @@ /* The studio's colours, taken from the Swing studio (StudioTheme) so both look alike. */ :root { - --background: #ffffff; + --background: #dfe2e8; --foreground: #000000; --card: #f7f8fa; --card-foreground: #000000; @@ -28,7 +28,7 @@ --input: #c9ccd6; --ring: #3574f0; --overlay-border: #dfe1e5; - --map-background: #e4e6eb; + --map-background: #eceef2; --radius: 10px; } @@ -57,7 +57,7 @@ --input: #4e5157; --ring: #3574f0; --overlay-border: #43454a; - --map-background: #16171a; + --map-background: #25272a; } @theme inline { @@ -109,3 +109,10 @@ @apply bg-background text-foreground text-[13px] antialiased select-none; } } + +/* The window around the islands: its colour, tinted with the accent from the top left corner as IntelliJ's islands theme does. */ +.window-frame { + background: + radial-gradient(ellipse 55% 45% at 0% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent), + var(--background); +}