From b128df472028ab668d67832130e06dc1a818e5df Mon Sep 17 00:00:00 2001 From: piexel Date: Wed, 25 Nov 2026 15:22:43 +0100 Subject: [PATCH] Restyle the studio after IntelliJ's Islands theme - Take the colours from Islands Light and Islands Dark: islands on a frame in the main window colour, without the accent glow - Draw generic actions with IntelliJ's new UI icons, vendored with their Apache 2.0 license and notice - Draw the remaining icons at IntelliJ's stroke and icon colour - Give the stripe and main toolbar IntelliJ's 30 px buttons with 20 px icons - Show the chosen entry as a muted subtitle in island headers and drop the repeated view icon - Turn outlined switches into segments with the chosen one filled - Use crisp focus edges, flat popups and 28 px controls - Show server memory as IntelliJ's memory indicator --- .../src/renderer/src/components/ui/button.tsx | 22 +- .../src/components/ui/context-menu.tsx | 20 +- .../src/renderer/src/components/ui/dialog.tsx | 8 +- .../src/components/ui/dropdown-menu.tsx | 10 +- .../src/renderer/src/components/ui/input.tsx | 4 +- .../renderer/src/components/ui/popover.tsx | 2 +- .../src/components/ui/scroll-area.tsx | 2 +- .../src/components/ui/toggle-group.tsx | 4 +- .../src/renderer/src/components/ui/toggle.tsx | 4 +- .../renderer/src/components/ui/tooltip.tsx | 2 +- .../renderer/src/icons/intellij/LICENSE.txt | 201 ++++++++++++++++++ .../renderer/src/icons/intellij/NOTICE.txt | 3 + .../src/renderer/src/icons/intellij/README.md | 1 + .../icons/intellij/actions/checked_dark.svg | 4 + .../icons/intellij/actions/stopWatch_dark.svg | 6 + .../icons/intellij/general/add@20x20_dark.svg | 4 + .../src/icons/intellij/general/add_dark.svg | 4 + .../intellij/general/chevronDown_dark.svg | 4 + .../intellij/general/chevronLeft_dark.svg | 4 + .../intellij/general/chevronRight_dark.svg | 4 + .../src/icons/intellij/general/close_dark.svg | 4 + .../icons/intellij/general/delete_dark.svg | 4 + .../icons/intellij/general/locate_dark.svg | 4 + .../icons/intellij/general/locked_dark.svg | 4 + .../general/moreHorizontal@20x20_dark.svg | 6 + .../intellij/general/moreHorizontal_dark.svg | 6 + .../intellij/general/questionMark_dark.svg | 6 + .../src/icons/intellij/general/redo_dark.svg | 4 + .../icons/intellij/general/refresh_dark.svg | 7 + .../src/icons/intellij/general/reset_dark.svg | 4 + .../intellij/general/search@20x20_dark.svg | 4 + .../icons/intellij/general/search_dark.svg | 5 + .../intellij/general/settings@20x20_dark.svg | 4 + .../icons/intellij/general/settings_dark.svg | 4 + .../src/icons/intellij/general/undo_dark.svg | 4 + .../icons/intellij/image/actualZoom_dark.svg | 4 + .../src/icons/intellij/image/grid_dark.svg | 7 + .../intellij/toolwindows/web@20x20_dark.svg | 4 + .../icons/intellij/toolwindows/web_dark.svg | 4 + studio/src/renderer/src/main.tsx | 2 +- studio/src/renderer/src/studio/BakeMeter.tsx | 4 +- .../src/renderer/src/studio/ConnectScreen.tsx | 12 +- .../src/renderer/src/studio/CurveEditor.tsx | 6 +- .../src/renderer/src/studio/EntryBrowser.tsx | 6 +- studio/src/renderer/src/studio/Glyph.tsx | 55 +++++ studio/src/renderer/src/studio/HoverCard.tsx | 2 +- .../renderer/src/studio/ImageMapStudio.tsx | 2 +- studio/src/renderer/src/studio/MapStudio.tsx | 15 +- studio/src/renderer/src/studio/NodeBox.tsx | 4 +- studio/src/renderer/src/studio/NodePane.tsx | 8 +- studio/src/renderer/src/studio/NodeRows.tsx | 4 +- .../renderer/src/studio/NodeSettingRow.tsx | 8 +- .../src/renderer/src/studio/NoiseStudio.tsx | 13 +- .../src/renderer/src/studio/PatternStudio.tsx | 9 +- .../src/renderer/src/studio/PickInspector.tsx | 13 +- .../renderer/src/studio/ProfileFormPanel.tsx | 4 +- .../renderer/src/studio/SavedWorldStudio.tsx | 9 +- .../src/renderer/src/studio/SceneStudio.tsx | 3 +- studio/src/renderer/src/studio/Sidebar.tsx | 34 ++- studio/src/renderer/src/studio/StatusBar.tsx | 42 ++-- .../src/renderer/src/studio/StudioToolbar.tsx | 56 +++-- .../renderer/src/studio/SuggestionInput.tsx | 2 +- studio/src/renderer/src/studio/ViewList.tsx | 24 +-- studio/src/renderer/src/studio/serverUsage.ts | 5 + studio/src/renderer/src/styles.css | 136 +++++++----- 65 files changed, 655 insertions(+), 225 deletions(-) create mode 100644 studio/src/renderer/src/icons/intellij/LICENSE.txt create mode 100644 studio/src/renderer/src/icons/intellij/NOTICE.txt create mode 100644 studio/src/renderer/src/icons/intellij/README.md create mode 100644 studio/src/renderer/src/icons/intellij/actions/checked_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/actions/stopWatch_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/add@20x20_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/add_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/chevronDown_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/chevronLeft_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/chevronRight_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/close_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/delete_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/locate_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/locked_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/moreHorizontal@20x20_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/moreHorizontal_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/questionMark_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/redo_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/refresh_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/reset_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/search@20x20_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/search_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/settings@20x20_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/settings_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/general/undo_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/image/actualZoom_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/image/grid_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/toolwindows/web@20x20_dark.svg create mode 100644 studio/src/renderer/src/icons/intellij/toolwindows/web_dark.svg create mode 100644 studio/src/renderer/src/studio/Glyph.tsx diff --git a/studio/src/renderer/src/components/ui/button.tsx b/studio/src/renderer/src/components/ui/button.tsx index 0d202d63f..4d0bc0c98 100644 --- a/studio/src/renderer/src/components/ui/button.tsx +++ b/studio/src/renderer/src/components/ui/button.tsx @@ -4,30 +4,30 @@ import { cn } from "@/lib/utils" import { Slot } from "radix-ui" const buttonVariants = cva( - "inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", + "inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-[13px] font-normal whitespace-nowrap outline-none focus-visible:focused disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", { variants: { variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", + default: "icon-tint bg-primary text-primary-foreground hover:bg-primary/90", destructive: - "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40", + "icon-tint bg-destructive text-white hover:bg-destructive/90", outline: - "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50", + "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: - "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", + "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", }, size: { - default: "h-9 px-4 py-2 has-[>svg]:px-3", + default: "h-7 px-3 has-[>svg]:px-2.5", xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3", - sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5", - lg: "h-10 rounded-md px-6 has-[>svg]:px-4", - icon: "size-9", + sm: "h-7 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2", + lg: "h-8 rounded-md px-4 has-[>svg]:px-3", + icon: "size-7", "icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3", - "icon-sm": "size-8", - "icon-lg": "size-10", + "icon-sm": "size-7", + "icon-lg": "size-8", }, }, defaultVariants: { diff --git a/studio/src/renderer/src/components/ui/context-menu.tsx b/studio/src/renderer/src/components/ui/context-menu.tsx index 3dbc666bb..99bd4f87e 100644 --- a/studio/src/renderer/src/components/ui/context-menu.tsx +++ b/studio/src/renderer/src/components/ui/context-menu.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { cn } from "@/lib/utils" -import { Check, ChevronRight } from "lucide-react" import { ContextMenu as ContextMenuPrimitive } from "radix-ui" +import { Glyph } from "@/studio/Glyph" function ContextMenu({ ...props @@ -63,14 +63,14 @@ function ContextMenuSubTrigger({ data-slot="context-menu-sub-trigger" data-inset={inset} className={cn( - "flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", + "flex cursor-default items-center rounded-md px-2 py-1 text-[13px] outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className )} {...props} > {children} - + ) @@ -86,7 +86,7 @@ function ContextMenuSubContent({ - + {children} @@ -171,7 +171,7 @@ function ContextMenuRadioItem({ - + Close )} diff --git a/studio/src/renderer/src/components/ui/dropdown-menu.tsx b/studio/src/renderer/src/components/ui/dropdown-menu.tsx index 56a8e372e..e76e4e2ff 100644 --- a/studio/src/renderer/src/components/ui/dropdown-menu.tsx +++ b/studio/src/renderer/src/components/ui/dropdown-menu.tsx @@ -1,12 +1,12 @@ import * as React from "react" import { cn } from "@/lib/utils" -import { ChevronRight } from "lucide-react" import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui" +import { Glyph } from "@/studio/Glyph" const MENU_SURFACE = - "z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md backdrop-blur-sm data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0" + "z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto popup p-1 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0" const MENU_ROW = - "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50" + "relative flex cursor-default items-center gap-2 rounded-md px-2 py-1 text-[13px] outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50" function DropdownMenu(props: React.ComponentProps) { return @@ -45,7 +45,7 @@ function DropdownMenuSubTrigger({ className, children, ...props }: React.Compone {...props} > {children} - + ) } @@ -53,7 +53,7 @@ function DropdownMenuSubTrigger({ className, children, ...props }: React.Compone function DropdownMenuSubContent({ className, ...props }: React.ComponentProps) { return ( - + ) } diff --git a/studio/src/renderer/src/components/ui/input.tsx b/studio/src/renderer/src/components/ui/input.tsx index 1e3b93289..98960205c 100644 --- a/studio/src/renderer/src/components/ui/input.tsx +++ b/studio/src/renderer/src/components/ui/input.tsx @@ -7,8 +7,8 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) { type={type} data-slot="input" className={cn( - "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", - "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", + "h-7 w-full min-w-0 rounded-md border border-input bg-transparent px-2 py-1 text-[13px] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", + "focus-visible:focused", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className )} diff --git a/studio/src/renderer/src/components/ui/popover.tsx b/studio/src/renderer/src/components/ui/popover.tsx index 7598a30a8..923393f97 100644 --- a/studio/src/renderer/src/components/ui/popover.tsx +++ b/studio/src/renderer/src/components/ui/popover.tsx @@ -18,7 +18,7 @@ function PopoverContent({ className, align = "start", sideOffset = 4, ...props } align={align} sideOffset={sideOffset} className={cn( - "z-50 rounded-md border bg-popover p-2 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", + "z-50 popup p-2 outline-hidden data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", className )} {...props} diff --git a/studio/src/renderer/src/components/ui/scroll-area.tsx b/studio/src/renderer/src/components/ui/scroll-area.tsx index b699a24ff..c0e27fd98 100644 --- a/studio/src/renderer/src/components/ui/scroll-area.tsx +++ b/studio/src/renderer/src/components/ui/scroll-area.tsx @@ -17,7 +17,7 @@ function ScrollArea({ > {children} diff --git a/studio/src/renderer/src/components/ui/toggle-group.tsx b/studio/src/renderer/src/components/ui/toggle-group.tsx index 54d3d9019..92425814d 100644 --- a/studio/src/renderer/src/components/ui/toggle-group.tsx +++ b/studio/src/renderer/src/components/ui/toggle-group.tsx @@ -24,7 +24,7 @@ function ToggleGroup({ data-variant={variant} data-size={size} className={cn( - "group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs", + "group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:h-7 data-[variant=outline]:border data-[variant=outline]:border-input data-[variant=outline]:bg-muted data-[variant=outline]:p-0.5", className )} {...props} @@ -56,7 +56,7 @@ function ToggleGroupItem({ variant: context.variant || variant, size: context.size || size, }), - "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l", + "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:h-[22px] data-[variant=outline]:min-w-[22px] data-[variant=outline]:rounded-[4px] data-[variant=outline]:border-0 data-[variant=outline]:px-2 data-[variant=outline]:text-[12px] data-[variant=outline]:text-muted-foreground data-[variant=outline]:hover:bg-transparent data-[variant=outline]:hover:text-foreground data-[variant=outline]:data-[state=on]:bg-secondary data-[variant=outline]:data-[state=on]:text-foreground", className )} {...props} diff --git a/studio/src/renderer/src/components/ui/toggle.tsx b/studio/src/renderer/src/components/ui/toggle.tsx index 137c38510..5b3abfbf8 100644 --- a/studio/src/renderer/src/components/ui/toggle.tsx +++ b/studio/src/renderer/src/components/ui/toggle.tsx @@ -4,13 +4,13 @@ import { cn } from "@/lib/utils" import { Toggle as TogglePrimitive } from "radix-ui" const toggleVariants = cva( - "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", + "inline-flex items-center justify-center gap-2 rounded-md text-[13px] font-normal whitespace-nowrap outline-none hover:bg-accent hover:text-accent-foreground focus-visible:focused disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", { variants: { variant: { default: "bg-transparent", outline: - "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground", + "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground", }, size: { default: "h-9 min-w-9 px-2", diff --git a/studio/src/renderer/src/components/ui/tooltip.tsx b/studio/src/renderer/src/components/ui/tooltip.tsx index ccc8fd335..dadc584f7 100644 --- a/studio/src/renderer/src/components/ui/tooltip.tsx +++ b/studio/src/renderer/src/components/ui/tooltip.tsx @@ -41,7 +41,7 @@ function TooltipContent({ data-slot="tooltip-content" sideOffset={sideOffset} className={cn( - "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md border border-overlay-border bg-popover px-2.5 py-1.5 text-xs text-balance text-popover-foreground shadow-md fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", + "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in popup px-2.5 py-1.5 text-xs text-balance fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", className )} {...props} diff --git a/studio/src/renderer/src/icons/intellij/LICENSE.txt b/studio/src/renderer/src/icons/intellij/LICENSE.txt new file mode 100644 index 000000000..f49a4e16e --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/studio/src/renderer/src/icons/intellij/NOTICE.txt b/studio/src/renderer/src/icons/intellij/NOTICE.txt new file mode 100644 index 000000000..a513913bb --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/NOTICE.txt @@ -0,0 +1,3 @@ +This software includes code from IntelliJ IDEA +Copyright (C) JetBrains s.r.o. +https://www.jetbrains.com/idea/ \ No newline at end of file diff --git a/studio/src/renderer/src/icons/intellij/README.md b/studio/src/renderer/src/icons/intellij/README.md new file mode 100644 index 000000000..5b1a533ee --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/README.md @@ -0,0 +1 @@ +Dark new-UI icons copied unchanged from JetBrains intellij-community, `platform/icons/src/expui`, under the Apache License 2.0 (LICENSE.txt). NOTICE.txt is that repository's notice. The folder layout matches the source. `Glyph` draws them in the current colour, so one copy serves both themes. diff --git a/studio/src/renderer/src/icons/intellij/actions/checked_dark.svg b/studio/src/renderer/src/icons/intellij/actions/checked_dark.svg new file mode 100644 index 000000000..3e1d9ecc3 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/actions/checked_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/actions/stopWatch_dark.svg b/studio/src/renderer/src/icons/intellij/actions/stopWatch_dark.svg new file mode 100644 index 000000000..10bec586b --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/actions/stopWatch_dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/add@20x20_dark.svg b/studio/src/renderer/src/icons/intellij/general/add@20x20_dark.svg new file mode 100644 index 000000000..5bf207330 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/add@20x20_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/add_dark.svg b/studio/src/renderer/src/icons/intellij/general/add_dark.svg new file mode 100644 index 000000000..397e9321b --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/add_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/chevronDown_dark.svg b/studio/src/renderer/src/icons/intellij/general/chevronDown_dark.svg new file mode 100644 index 000000000..375ab4dd8 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/chevronDown_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/chevronLeft_dark.svg b/studio/src/renderer/src/icons/intellij/general/chevronLeft_dark.svg new file mode 100644 index 000000000..d4284d234 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/chevronLeft_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/chevronRight_dark.svg b/studio/src/renderer/src/icons/intellij/general/chevronRight_dark.svg new file mode 100644 index 000000000..838142106 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/chevronRight_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/close_dark.svg b/studio/src/renderer/src/icons/intellij/general/close_dark.svg new file mode 100644 index 000000000..88693089a --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/close_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/delete_dark.svg b/studio/src/renderer/src/icons/intellij/general/delete_dark.svg new file mode 100644 index 000000000..03ff9f241 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/delete_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/locate_dark.svg b/studio/src/renderer/src/icons/intellij/general/locate_dark.svg new file mode 100644 index 000000000..a2ba607aa --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/locate_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/locked_dark.svg b/studio/src/renderer/src/icons/intellij/general/locked_dark.svg new file mode 100644 index 000000000..9658ca553 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/locked_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/moreHorizontal@20x20_dark.svg b/studio/src/renderer/src/icons/intellij/general/moreHorizontal@20x20_dark.svg new file mode 100644 index 000000000..6d7a22c02 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/moreHorizontal@20x20_dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/moreHorizontal_dark.svg b/studio/src/renderer/src/icons/intellij/general/moreHorizontal_dark.svg new file mode 100644 index 000000000..7b4ce2802 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/moreHorizontal_dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/questionMark_dark.svg b/studio/src/renderer/src/icons/intellij/general/questionMark_dark.svg new file mode 100644 index 000000000..96fea722f --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/questionMark_dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/redo_dark.svg b/studio/src/renderer/src/icons/intellij/general/redo_dark.svg new file mode 100644 index 000000000..a39093042 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/redo_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/refresh_dark.svg b/studio/src/renderer/src/icons/intellij/general/refresh_dark.svg new file mode 100644 index 000000000..3362992af --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/refresh_dark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/reset_dark.svg b/studio/src/renderer/src/icons/intellij/general/reset_dark.svg new file mode 100644 index 000000000..28d58e10e --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/reset_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/search@20x20_dark.svg b/studio/src/renderer/src/icons/intellij/general/search@20x20_dark.svg new file mode 100644 index 000000000..27f0332d1 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/search@20x20_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/search_dark.svg b/studio/src/renderer/src/icons/intellij/general/search_dark.svg new file mode 100644 index 000000000..d5a82d9c1 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/search_dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/settings@20x20_dark.svg b/studio/src/renderer/src/icons/intellij/general/settings@20x20_dark.svg new file mode 100644 index 000000000..cc6378305 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/settings@20x20_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/settings_dark.svg b/studio/src/renderer/src/icons/intellij/general/settings_dark.svg new file mode 100644 index 000000000..62f328167 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/settings_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/general/undo_dark.svg b/studio/src/renderer/src/icons/intellij/general/undo_dark.svg new file mode 100644 index 000000000..2fa3c0d42 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/general/undo_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/image/actualZoom_dark.svg b/studio/src/renderer/src/icons/intellij/image/actualZoom_dark.svg new file mode 100644 index 000000000..e497a8f70 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/image/actualZoom_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/image/grid_dark.svg b/studio/src/renderer/src/icons/intellij/image/grid_dark.svg new file mode 100644 index 000000000..98f561847 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/image/grid_dark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/studio/src/renderer/src/icons/intellij/toolwindows/web@20x20_dark.svg b/studio/src/renderer/src/icons/intellij/toolwindows/web@20x20_dark.svg new file mode 100644 index 000000000..6c5820aa2 --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/toolwindows/web@20x20_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/icons/intellij/toolwindows/web_dark.svg b/studio/src/renderer/src/icons/intellij/toolwindows/web_dark.svg new file mode 100644 index 000000000..0ca6194ab --- /dev/null +++ b/studio/src/renderer/src/icons/intellij/toolwindows/web_dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/studio/src/renderer/src/main.tsx b/studio/src/renderer/src/main.tsx index 4ba5fffc5..4ec4f4f88 100644 --- a/studio/src/renderer/src/main.tsx +++ b/studio/src/renderer/src/main.tsx @@ -6,7 +6,7 @@ import { App } from './App' import './styles.css' const ICON_SIZE_PX = 16 -const ICON_STROKE_PX = 1.5 +const ICON_STROKE_PX = 1.25 createRoot(document.getElementById('root')!).render( diff --git a/studio/src/renderer/src/studio/BakeMeter.tsx b/studio/src/renderer/src/studio/BakeMeter.tsx index d15544053..e0a7301e3 100644 --- a/studio/src/renderer/src/studio/BakeMeter.tsx +++ b/studio/src/renderer/src/studio/BakeMeter.tsx @@ -1,10 +1,10 @@ -import { Timer } from 'lucide-react' import { useEffect, useState } from 'react' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/utils' import type { BridgeClient } from '../bridge/BridgeClient' import type { BakeRun } from '../bridge/types' import { BAKE_RUN_COUNT, bakeWeightOf, formatMillis, measureBake, meterFill, runMillis, slowestStageIndex, weightScale } from '../scene/bakeTiming' +import { Glyph } from './Glyph' const MINIMUM_FILL = '4px' const MEASURING_LABEL = 'Timing' @@ -49,7 +49,7 @@ export function BakeMeter({ timing }: BakeMeterProps): React.JSX.Element {
- + {timing === null ? MEASURING_LABEL : weight.label} diff --git a/studio/src/renderer/src/studio/ConnectScreen.tsx b/studio/src/renderer/src/studio/ConnectScreen.tsx index b10381432..e4301f1b4 100644 --- a/studio/src/renderer/src/studio/ConnectScreen.tsx +++ b/studio/src/renderer/src/studio/ConnectScreen.tsx @@ -1,8 +1,8 @@ import { useEffect, useRef, useState } from 'react' -import { Globe, RefreshCw } from 'lucide-react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import type { BridgeConnection } from '../../../shared/bridge' +import { Glyph } from './Glyph' const BRIDGE_POLL_MILLIS = 2000 @@ -45,8 +45,8 @@ export function ConnectScreen({ connecting, error, onConnect, onLink }: ConnectS }, [onConnect]) return ( -
-
+
+

Open a world

Run /iris studio map in game or in the @@ -56,7 +56,7 @@ export function ConnectScreen({ connecting, error, onConnect, onLink }: ConnectS

{bridges.length === 0 ? (
- Waiting for a server on this machine + Waiting for a server on this machine
) : ( bridges.map((bridge) => ( @@ -66,7 +66,7 @@ export function ConnectScreen({ connecting, error, onConnect, onLink }: ConnectS onClick={() => onConnect(bridge)} className="flex items-center gap-3 rounded-md px-3 py-2 text-left hover:bg-accent disabled:opacity-60" > - + {bridge.world} port {bridge.port} @@ -83,7 +83,7 @@ export function ConnectScreen({ connecting, error, onConnect, onLink }: ConnectS > setLink(event.target.value)} placeholder="iris-studio://…" className="h-8" /> {error !== null &&

{error}

} diff --git a/studio/src/renderer/src/studio/CurveEditor.tsx b/studio/src/renderer/src/studio/CurveEditor.tsx index fbff016cf..c62462718 100644 --- a/studio/src/renderer/src/studio/CurveEditor.tsx +++ b/studio/src/renderer/src/studio/CurveEditor.tsx @@ -1,4 +1,3 @@ -import { Plus, Trash2 } from 'lucide-react' import { useRef, useState } from 'react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' @@ -19,6 +18,7 @@ import { withShape, type Keyframe } from '../editor/curves' +import { Glyph } from './Glyph' const PREVIEW_SAMPLES = 40 const PREVIEW_WIDTH = 100 @@ -192,12 +192,12 @@ function PointsForm({ keys, locked, onWrite }: { keys: Keyframe[]; locked: boole next !== undefined && onWrite(withKeyframe(keys, index, [next, value]))} /> next !== undefined && onWrite(withKeyframe(keys, index, [t, next]))} />
))}
) diff --git a/studio/src/renderer/src/studio/EntryBrowser.tsx b/studio/src/renderer/src/studio/EntryBrowser.tsx index a99928c76..bf198da45 100644 --- a/studio/src/renderer/src/studio/EntryBrowser.tsx +++ b/studio/src/renderer/src/studio/EntryBrowser.tsx @@ -1,4 +1,3 @@ -import { ChevronRight, Plus } from 'lucide-react' import { useEffect, useMemo, useState } from 'react' import { Button } from '@/components/ui/button' import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from '@/components/ui/context-menu' @@ -6,6 +5,7 @@ import { Input } from '@/components/ui/input' import { ScrollArea } from '@/components/ui/scroll-area' import { cn } from '@/lib/utils' import { folderPrefixOf } from '../editor/entryKeys' +import { Glyph } from './Glyph' const NUMBER = new Intl.NumberFormat('en-US') const DELETE_KEY = 'Delete' @@ -73,7 +73,7 @@ export function EntryBrowser({ title, entries, current, onSelect, fileActions, c

{title}

{fileActions !== undefined && ( )}
@@ -172,7 +172,7 @@ function FolderBranch({ folder, depth, context }: { folder: FolderNode; depth: n className="flex h-[26px] w-full items-center gap-1 rounded-md px-2 text-left hover:bg-accent" style={{ paddingLeft: indentOf(depth) }} > - + {folder.name} {NUMBER.format(folder.size)} diff --git a/studio/src/renderer/src/studio/Glyph.tsx b/studio/src/renderer/src/studio/Glyph.tsx new file mode 100644 index 000000000..e406f68e6 --- /dev/null +++ b/studio/src/renderer/src/studio/Glyph.tsx @@ -0,0 +1,55 @@ +import { cn } from '@/lib/utils' + +const ICON_MARKUP = import.meta.glob('../icons/intellij/**/*.svg', { eager: true, query: '?raw', import: 'default' }) as Record + +/** Each glyph's IntelliJ new-UI icon, by its path under `icons/intellij` without the `_dark.svg` ending. */ +const GLYPHS = { + add: 'general/add', + chevronDown: 'general/chevronDown', + chevronLeft: 'general/chevronLeft', + chevronRight: 'general/chevronRight', + close: 'general/close', + delete: 'general/delete', + help: 'general/questionMark', + locate: 'general/locate', + locked: 'general/locked', + more: 'general/moreHorizontal', + redo: 'general/redo', + undo: 'general/undo', + refresh: 'general/refresh', + reset: 'general/reset', + search: 'general/search', + settings: 'general/settings', + check: 'actions/checked', + stopWatch: 'actions/stopWatch', + actualZoom: 'image/actualZoom', + grid: 'image/grid', + web: 'toolwindows/web', +} + +export type GlyphName = keyof typeof GLYPHS + +const ICON_COLOUR = /#[0-9A-Fa-f]{6}\b/g + +/** The icon's markup drawn in the current colour, sized by its box, so it takes the theme's icon colour. */ +function markupOf(path: string): string { + return path.replace(ICON_COLOUR, 'currentColor').replace(' [path, markupOf(markup)])) + +/** + * An IntelliJ icon: 16 px, 12 px when small, or 20 px when large, as IntelliJ draws stripe and main toolbar icons. + * Large takes the icon's own 20 px drawing where IntelliJ has one. + */ +export function Glyph({ glyph, small, large, className }: { glyph: GlyphName; small?: boolean; large?: boolean; className?: string }): React.JSX.Element { + const path = `../icons/intellij/${GLYPHS[glyph]}` + const markup = (large && MARKUP.get(`${path}@20x20_dark.svg`)) || MARKUP.get(`${path}_dark.svg`) + return ( + + ) +} diff --git a/studio/src/renderer/src/studio/HoverCard.tsx b/studio/src/renderer/src/studio/HoverCard.tsx index d8b003e90..03e638835 100644 --- a/studio/src/renderer/src/studio/HoverCard.tsx +++ b/studio/src/renderer/src/studio/HoverCard.tsx @@ -52,7 +52,7 @@ export function HoverCard({ hover, point, viewId, previewing, detailed, minY }: return (
diff --git a/studio/src/renderer/src/studio/ImageMapStudio.tsx b/studio/src/renderer/src/studio/ImageMapStudio.tsx index 7b90f45e0..4294d4457 100644 --- a/studio/src/renderer/src/studio/ImageMapStudio.tsx +++ b/studio/src/renderer/src/studio/ImageMapStudio.tsx @@ -28,7 +28,7 @@ export function ImageMapStudio({ title, client, packRevision, onSummary, tell }: return ( <> - +
{picture !== null && {entry?.name} {entry === null &&

This pack has no image maps. Put them in the pack's imageMaps folder.

} diff --git a/studio/src/renderer/src/studio/MapStudio.tsx b/studio/src/renderer/src/studio/MapStudio.tsx index 03d599ab0..8da67c1ce 100644 --- a/studio/src/renderer/src/studio/MapStudio.tsx +++ b/studio/src/renderer/src/studio/MapStudio.tsx @@ -21,12 +21,12 @@ import { SceneStudio } from './SceneStudio' import { WorldStudio3D } from './WorldStudio3D' import { isTypingInto, shortcutRows, viewOfShortcutId, windowShortcutFor, type ShortcutAction } from './shortcuts' import { ShortcutSettings } from './ShortcutSettings' -import { Panel, ShownViewIcon, SidebarPanel, SidebarSlot, ViewIsland } from './Sidebar' +import { Panel, SidebarPanel, SidebarSlot, ViewIsland } from './Sidebar' import { StatusBar } from './StatusBar' import { MapTools, StudioToolbar } from './StudioToolbar' import { useBindings } from './useBindings' import { usePickInspection } from './usePickInspection' -import { ViewList, viewIcon } from './ViewList' +import { ViewList } from './ViewList' const KEYBOARD_ZOOM_FACTOR = 2 ** 0.25 const ENTITY_POLL_MILLIS = 2000 @@ -218,11 +218,10 @@ export function MapStudio({ client, world, theme, onDisconnect }: MapStudioProps ) return ( -
+
setHelpOpen(true)} onSettings={() => setSettingsOpen(true)} onDisconnect={onDisconnect} /> - -
+
{viewId === 'regions' && regions.length > 1 && ( @@ -246,7 +245,8 @@ export function MapStudio({ client, world, theme, onDisconnect }: MapStudioProps ) : ( <> -
+

Lost the connection to the server

- diff --git a/studio/src/renderer/src/studio/NodeBox.tsx b/studio/src/renderer/src/studio/NodeBox.tsx index 3b65ab23b..c5d5a04b6 100644 --- a/studio/src/renderer/src/studio/NodeBox.tsx +++ b/studio/src/renderer/src/studio/NodeBox.tsx @@ -35,7 +35,7 @@ export const NodeBox = memo(function NodeBox({ placed, rows, selected, dropTarge
diff --git a/studio/src/renderer/src/studio/NodePane.tsx b/studio/src/renderer/src/studio/NodePane.tsx index cdb5e20c9..3f4820507 100644 --- a/studio/src/renderer/src/studio/NodePane.tsx +++ b/studio/src/renderer/src/studio/NodePane.tsx @@ -1,10 +1,10 @@ -import { Lock, Redo2, Undo2 } from 'lucide-react' import { useEffect, useRef } from 'react' import { Button } from '@/components/ui/button' import type { GraphNode } from '../bridge/types' import { idOf } from '../editor/nodeLayout' import type { SuggestionStore } from '../editor/suggestionStore' import type { NodeEditor } from '../editor/useNodeEditor' +import { Glyph } from './Glyph' import { NodeCanvas } from './NodeCanvas' import { isInEntryBrowser, isTypingInto, nodeEditorActionFor, type NodeEditorAction } from './shortcuts' import { useBindings, useKeyText } from './useBindings' @@ -37,16 +37,16 @@ export function NodePane({ editor, entryKey, values, suggestions, selected, onSe {!locked && Right-click to add or delete · Drag a ring onto a node to regrow · {keyText('undo')} undoes} {state?.locked != null && ( - + Read only )} {editor.saving && Saving…}
diff --git a/studio/src/renderer/src/studio/NodeRows.tsx b/studio/src/renderer/src/studio/NodeRows.tsx index da625d8ea..f94109005 100644 --- a/studio/src/renderer/src/studio/NodeRows.tsx +++ b/studio/src/renderer/src/studio/NodeRows.tsx @@ -1,10 +1,10 @@ -import { ChevronRight } from 'lucide-react' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { cn } from '@/lib/utils' import type { SettingOption } from '../bridge/types' import { NODE_HEADING, NODE_ROW, type NodeRow } from '../editor/nodeRows' import { idOfFold, type SettingsFold } from '../editor/settingFolds' import { defaultLiteral, defaultText } from '../editor/settingText' +import { Glyph } from './Glyph' import { useNodeEditing } from './nodeEditing' import { keepFocusOnCanvas, NodeSettingRow, ROW_INDENT, RowButton } from './NodeSettingRow' @@ -51,7 +51,7 @@ function FoldRow({ fold, open, editable }: { fold: SettingsFold; open: boolean; style={{ paddingLeft: (fold.depth - 1) * ROW_INDENT }} onClick={() => onToggleFold(idOfFold(fold))} > - + {fold.kind === 'item' ? `#${fold.title}` : fold.title} {showsSummary && {fold.summary}} diff --git a/studio/src/renderer/src/studio/NodeSettingRow.tsx b/studio/src/renderer/src/studio/NodeSettingRow.tsx index 6b552555a..1d53133f5 100644 --- a/studio/src/renderer/src/studio/NodeSettingRow.tsx +++ b/studio/src/renderer/src/studio/NodeSettingRow.tsx @@ -1,4 +1,3 @@ -import { Check, ChevronDown } from 'lucide-react' import { useRef, useState } from 'react' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover' @@ -8,6 +7,7 @@ import { NODE_ROW } from '../editor/nodeRows' import { defaultText, isNumber, isStringList, literalOf, NOT_SET, problemWith, textOf } from '../editor/settingText' import { suggestionSourceOf } from '../editor/suggestions' import { CurveEditor, CurvePreview } from './CurveEditor' +import { Glyph } from './Glyph' import { useNodeEditing, type SettingRow } from './nodeEditing' import { SuggestionInput } from './SuggestionInput' @@ -114,7 +114,7 @@ function CheckValue({ row, editable }: SettingRowProps): React.JSX.Element { className={cn('flex size-3.5 items-center justify-center rounded-[4px] border', checked ? 'border-primary bg-primary' : 'border-input bg-muted', editable && 'hover:border-primary', row.value === undefined && 'opacity-60')} onClick={() => onEdit({ op: 'set', object: row.fold.path, key: row.option.name, literal: String(!checked) })} > - {checked && } + {checked && } ) } @@ -128,7 +128,7 @@ function ChoiceValue({ row, editable }: SettingRowProps): React.JSX.Element { @@ -258,7 +258,7 @@ function ValueInput({ row, onDone }: { row: SettingRow; onDone(): void }): React }} /> {shownProblem !== null && ( -

+

{shownProblem}

)} diff --git a/studio/src/renderer/src/studio/NoiseStudio.tsx b/studio/src/renderer/src/studio/NoiseStudio.tsx index 21e8243d6..43499c345 100644 --- a/studio/src/renderer/src/studio/NoiseStudio.tsx +++ b/studio/src/renderer/src/studio/NoiseStudio.tsx @@ -1,4 +1,3 @@ -import { RefreshCw, RotateCcw, Search } from 'lucide-react' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' @@ -12,6 +11,7 @@ import { NOISE_PALETTES, noiseScale, type NoisePaletteId, type NoiseScale } from import { NoiseTerrain } from '../noise/noiseTerrain' import { createNoiseView, noiseTileSource, type NoiseLayer, type NoiseStatus, type NoiseView } from '../noise/noiseTiles' import { focusAround, type TerrainStyle } from '../scene/terrainStream' +import { Glyph } from './Glyph' import { hexColor } from './colors' import { SceneViewport } from './SceneViewport' import { TiledCanvas } from './TiledCanvas' @@ -86,13 +86,14 @@ export function NoiseStudio({ title, client, packRevision, onSummary, tell }: No return ( <> {display === 'terrain' && source?.blockRange === null && } {display === 'flat' && ( - )} @@ -166,7 +167,7 @@ function SeedField({ seed, usesSeed, onChange }: { seed: string; usesSeed: boole onKeyDown={(event) => event.key === 'Enter' && commit()} />
{!usesSeed &&

Keeps the world's seed

} @@ -232,7 +233,7 @@ function SourceList({ sources, current, onSelect }: { sources: NoiseSource[]; cu
- + setFilter(event.target.value)} />
diff --git a/studio/src/renderer/src/studio/PatternStudio.tsx b/studio/src/renderer/src/studio/PatternStudio.tsx index f3f590b55..452eb6573 100644 --- a/studio/src/renderer/src/studio/PatternStudio.tsx +++ b/studio/src/renderer/src/studio/PatternStudio.tsx @@ -1,4 +1,3 @@ -import { RotateCcw } from 'lucide-react' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Button } from '@/components/ui/button' import { ScrollArea } from '@/components/ui/scroll-area' @@ -11,6 +10,7 @@ import { BlockModels } from '../scene/blockModels' import { BridgeAssets } from '../scene/BridgeAssets' import { BlockIcon } from './BlockIcon' import { EntryBrowser } from './EntryBrowser' +import { Glyph } from './Glyph' import { Panel, SidebarPanel, Stepper, ViewIsland } from './Sidebar' import { TiledCanvas } from './TiledCanvas' @@ -63,14 +63,15 @@ export function PatternStudio({ client, view, packRevision, onSummary, tell }: P return ( <> {entry !== null && entry.depths > 1 && ( chooseDepth(depth - 1)} onOn={() => chooseDepth(depth + 1)} /> )} - } diff --git a/studio/src/renderer/src/studio/PickInspector.tsx b/studio/src/renderer/src/studio/PickInspector.tsx index 923caae53..be59df832 100644 --- a/studio/src/renderer/src/studio/PickInspector.tsx +++ b/studio/src/renderer/src/studio/PickInspector.tsx @@ -1,14 +1,11 @@ -import { ChevronRight } from 'lucide-react' import { useState } from 'react' import { ScrollArea } from '@/components/ui/scroll-area' import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group' import type { PickDisplay, PickInspection, PickSection } from '../bridge/types' +import { Glyph } from './Glyph' import { hexColor } from './colors' import { NoiseChart, percent } from './NoiseChart' -// The chosen display reads like the toolbar's switched-on toggles. -const DISPLAY_ITEM = 'h-7 text-[12px] data-[state=on]:bg-selection data-[state=on]:text-foreground' - /** How the map draws the picks, for a view that recolours its tiles. */ export interface PickDisplayChoice { /** What the map shows when it draws the picks: "Regions" or "Biomes". */ @@ -45,13 +42,13 @@ export function PickInspector({ title, inspection, display }: PickInspectorProps value={display.value} onValueChange={(value) => value !== '' && display.onChange(value as PickDisplay)} > - + {display.picksLabel} - + Noise - + Both @@ -92,7 +89,7 @@ function RegionSection({ section, open, onToggle }: { section: PickSection; open return (
diff --git a/studio/src/renderer/src/studio/SavedWorldStudio.tsx b/studio/src/renderer/src/studio/SavedWorldStudio.tsx index 517261086..3a3fbc7be 100644 --- a/studio/src/renderer/src/studio/SavedWorldStudio.tsx +++ b/studio/src/renderer/src/studio/SavedWorldStudio.tsx @@ -1,4 +1,3 @@ -import { RefreshCw } from 'lucide-react' import { useEffect, useMemo, useRef, useState } from 'react' import { Button } from '@/components/ui/button' import { ScrollArea } from '@/components/ui/scroll-area' @@ -15,6 +14,7 @@ import { SavedTerrain, type ReadSavedTile, type SavedTerrainColoring } from '../ import { savedTileSource, type SavedLayer } from '../scene/savedTileSource' import { TerrainAtlas } from '../scene/terrainAtlas' import { focusAround, type TerrainStyle } from '../scene/terrainStream' +import { Glyph } from './Glyph' import { SceneViewport } from './SceneViewport' import { Separator } from '@/components/ui/separator' import { HEADER_CHOICE, SidebarPanel, ViewIsland } from './Sidebar' @@ -91,7 +91,8 @@ export function SavedWorldStudio({ title, client, world, onSummary, onProgress, return ( <> value !== '' && setColoring(value as SavedTerrainColoring)}> @@ -106,8 +107,8 @@ export function SavedWorldStudio({ title, client, world, onSummary, onProgress, - } diff --git a/studio/src/renderer/src/studio/SceneStudio.tsx b/studio/src/renderer/src/studio/SceneStudio.tsx index 5ce5bca74..2a0e99ddf 100644 --- a/studio/src/renderer/src/studio/SceneStudio.tsx +++ b/studio/src/renderer/src/studio/SceneStudio.tsx @@ -189,7 +189,8 @@ function SceneArea({ title, entry, variant, sizes, size, shown, status, onVarian return ( {sizes !== null && size !== null && } diff --git a/studio/src/renderer/src/studio/Sidebar.tsx b/studio/src/renderer/src/studio/Sidebar.tsx index 441bc1cdd..50cce167e 100644 --- a/studio/src/renderer/src/studio/Sidebar.tsx +++ b/studio/src/renderer/src/studio/Sidebar.tsx @@ -1,9 +1,9 @@ import { createContext, useContext } from 'react' import { createPortal } from 'react-dom' -import { ChevronLeft, ChevronRight, type LucideIcon } from 'lucide-react' import { Button } from '@/components/ui/button' import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group' import { cn } from '@/lib/utils' +import { Glyph } from './Glyph' /** Where a view puts its own lists: under the views in the left island. */ export const SidebarSlot = createContext(null) @@ -17,9 +17,9 @@ export function SidebarPanel({ className, children }: { className?: string; chil return createPortal(
{children}
, slot) } -/** One choice of a switch in an island's header: plain until chosen and outlined then, as IntelliJ's tabs are. */ +/** One choice of a switch in an island's header: plain until chosen and filled then. */ 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' + 'h-6 flex-none rounded-md! border border-transparent px-2 text-[12px] font-normal hover:bg-accent hover:text-foreground data-[state=on]:bg-secondary data-[state=on]:text-foreground' interface StepperProps { /** Where the steps are now: "Variant 2 of 5". */ @@ -34,12 +34,12 @@ interface StepperProps { export function Stepper({ label, backHint, onHint, onBack, onOn }: StepperProps): React.JSX.Element { return ( - {label} - ) @@ -67,23 +67,21 @@ export function SizeChoice({ sizes, size, onSize }: SizeChoiceProps): React.JSX. interface ViewIslandProps { title: string + /** What the view shows now, such as the chosen entry, after the title in the muted colour. */ + subtitle?: string /** The view's own buttons, at the right of its header. */ tools?: React.ReactNode className?: string children: React.ReactNode } -/** The shown view's icon in the stripe, which its island repeats beside its name so the two are learned together. */ -export const ShownViewIcon = createContext(null) - -/** The island a view draws in, under a header with the view's icon, its name and its tools, as an IntelliJ tool window has. */ -export function ViewIsland({ title, tools, className, children }: ViewIslandProps): React.JSX.Element { - const ViewIcon = useContext(ShownViewIcon) +/** The island a view draws in, under a header with its name and its tools, as an IntelliJ tool window has. */ +export function ViewIsland({ title, subtitle, tools, className, children }: ViewIslandProps): React.JSX.Element { return ( -
-
- {ViewIcon !== null && } -

{title}

+
+
+

{title}

+ {subtitle !== undefined && {subtitle}} {tools}
@@ -94,5 +92,5 @@ export function ViewIsland({ title, tools, className, children }: ViewIslandProp /** A card in the shell: the panels sit apart on the window background instead of sharing borders. */ export function Panel({ className, children }: { className?: string; children: React.ReactNode }): React.JSX.Element { - return + return } diff --git a/studio/src/renderer/src/studio/StatusBar.tsx b/studio/src/renderer/src/studio/StatusBar.tsx index 272b0155a..34ec5c205 100644 --- a/studio/src/renderer/src/studio/StatusBar.tsx +++ b/studio/src/renderer/src/studio/StatusBar.tsx @@ -1,9 +1,8 @@ -import { MemoryStick, Zap } from 'lucide-react' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/utils' import type { ServerUsage } from '../bridge/types' import type { MapStatus } from '../map/MapController' -import { cpuIsHigh, formatCpu, formatHeap, heapIsHigh } from './serverUsage' +import { cpuIsHigh, formatCpu, formatHeap, heapIsHigh, heapShare } from './serverUsage' interface StatusBarProps { viewLabel: string @@ -20,7 +19,7 @@ const NUMBER = new Intl.NumberFormat('en-US') export function StatusBar({ viewLabel, status, notice, usage, progress }: StatusBarProps): React.JSX.Element { const drawing = status !== null && status.tilesReady < status.tilesTotal return ( -