From 96d73a85708dbdaafa96dc7ad3d7d50c08e9d106 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Thu, 6 Nov 2025 09:20:51 -0800 Subject: [PATCH] Remove the application title from the header bar --- .../window/title-bar/TitleBar.svelte | 66 +++++++------------ .../window/title-bar/WindowButtonsMac.svelte | 47 ------------- .../window/title-bar/WindowButtonsWeb.svelte | 16 ++--- .../window/title-bar/WindowTitle.svelte | 19 ------ frontend/src/messages.ts | 9 +-- node-graph/gmath-nodes/src/lib.rs | 8 +-- 6 files changed, 33 insertions(+), 132 deletions(-) delete mode 100644 frontend/src/components/window/title-bar/WindowButtonsMac.svelte delete mode 100644 frontend/src/components/window/title-bar/WindowTitle.svelte diff --git a/frontend/src/components/window/title-bar/TitleBar.svelte b/frontend/src/components/window/title-bar/TitleBar.svelte index eb246269..e9d4d8ac 100644 --- a/frontend/src/components/window/title-bar/TitleBar.svelte +++ b/frontend/src/components/window/title-bar/TitleBar.svelte @@ -3,22 +3,18 @@ import type { Editor } from "@graphite/editor"; import { type KeyRaw, type LayoutKeysGroup, type MenuBarEntry, type MenuListEntry, type AppWindowPlatform, UpdateMenuBarLayout } from "@graphite/messages"; - import type { PortfolioState } from "@graphite/state-providers/portfolio"; import { platformIsMac } from "@graphite/utility-functions/platform"; import LayoutRow from "@graphite/components/layout/LayoutRow.svelte"; import TextButton from "@graphite/components/widgets/buttons/TextButton.svelte"; import WindowButtonsLinux from "@graphite/components/window/title-bar/WindowButtonsLinux.svelte"; - import WindowButtonsMac from "@graphite/components/window/title-bar/WindowButtonsMac.svelte"; import WindowButtonsWeb from "@graphite/components/window/title-bar/WindowButtonsWeb.svelte"; import WindowButtonsWindows from "@graphite/components/window/title-bar/WindowButtonsWindows.svelte"; - import WindowTitle from "@graphite/components/window/title-bar/WindowTitle.svelte"; export let platform: AppWindowPlatform; export let maximized: boolean; const editor = getContext("editor"); - const portfolio = getContext("portfolio"); // TODO: Apparently, Safari does not support the Keyboard.lock() API but does relax its authority over certain keyboard shortcuts in fullscreen mode, which we should take advantage of const ACCEL_KEY = platformIsMac() ? "Command" : "Control"; @@ -32,10 +28,6 @@ let entries: MenuListEntry[] = []; - $: docIndex = $portfolio.activeDocumentIndex; - $: displayName = $portfolio.documents[docIndex]?.displayName || ""; - $: windowTitle = `${displayName}${displayName && " - "}Graphite`; - onMount(() => { const arraysEqual = (a: KeyRaw[], b: KeyRaw[]): boolean => a.length === b.length && a.every((aValue, i) => aValue === b[i]); const shortcutRequiresLock = (shortcut: LayoutKeysGroup): boolean => { @@ -67,32 +59,26 @@ - - - {#if platform === "Mac"} - - {:else} + {#if platform !== "Mac"} + + {#each entries as entry} {/each} - {/if} - editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()} /> - - - editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()}> - - - - - editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()} /> - {#if platform === "Windows"} - - {:else if platform === "Linux"} - - {:else if platform === "Web"} - - {/if} - + + + editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()} /> + + + {#if platform === "Web"} + + {:else if platform === "Windows"} + + {:else if platform === "Linux"} + + {/if} + + {/if} diff --git a/frontend/src/components/window/title-bar/WindowButtonsMac.svelte b/frontend/src/components/window/title-bar/WindowButtonsMac.svelte deleted file mode 100644 index 574c1eab..00000000 --- a/frontend/src/components/window/title-bar/WindowButtonsMac.svelte +++ /dev/null @@ -1,47 +0,0 @@ - - - -
editor.handle.appWindowClose()} /> -
editor.handle.appWindowMinimize()} /> -
editor.handle.appWindowMaximize()} /> - - - diff --git a/frontend/src/components/window/title-bar/WindowButtonsWeb.svelte b/frontend/src/components/window/title-bar/WindowButtonsWeb.svelte index c24c372f..8e069e52 100644 --- a/frontend/src/components/window/title-bar/WindowButtonsWeb.svelte +++ b/frontend/src/components/window/title-bar/WindowButtonsWeb.svelte @@ -5,7 +5,6 @@ import LayoutRow from "@graphite/components/layout/LayoutRow.svelte"; import IconLabel from "@graphite/components/widgets/labels/IconLabel.svelte"; - import TextLabel from "@graphite/components/widgets/labels/TextLabel.svelte"; const fullscreen = getContext("fullscreen"); @@ -17,10 +16,12 @@ } - - {#if requestFullscreenHotkeys} - Go fullscreen to access all hotkeys - {/if} + @@ -34,13 +35,8 @@ fill: var(--color-e-nearwhite); } - .text-label { - margin-right: 8px; - } - &:hover { background: var(--color-6-lowergray); - color: var(--color-f-white); svg { fill: var(--color-f-white); diff --git a/frontend/src/components/window/title-bar/WindowTitle.svelte b/frontend/src/components/window/title-bar/WindowTitle.svelte deleted file mode 100644 index f0af261c..00000000 --- a/frontend/src/components/window/title-bar/WindowTitle.svelte +++ /dev/null @@ -1,19 +0,0 @@ - - - - {text} - - - diff --git a/frontend/src/messages.ts b/frontend/src/messages.ts index fae16e6e..45253cb2 100644 --- a/frontend/src/messages.ts +++ b/frontend/src/messages.ts @@ -139,12 +139,9 @@ export class UpdateWirePathInProgress extends JsMessage { export class OpenDocument { readonly id!: bigint; + @Type(() => DocumentDetails) readonly details!: DocumentDetails; - - get displayName(): string { - return this.details.displayName; - } } export class DocumentDetails { @@ -153,10 +150,6 @@ export class DocumentDetails { readonly isAutoSaved!: boolean; readonly isSaved!: boolean; - - get displayName(): string { - return `${this.name}${this.isSaved ? "" : "*"}`; - } } export class Box { diff --git a/node-graph/gmath-nodes/src/lib.rs b/node-graph/gmath-nodes/src/lib.rs index 4c6c421a..f46794ea 100644 --- a/node-graph/gmath-nodes/src/lib.rs +++ b/node-graph/gmath-nodes/src/lib.rs @@ -579,10 +579,10 @@ fn binary_gcd + std::ops: fn equals>( _: impl Ctx, /// One of the two numbers to compare for equality. - #[implementations(f64, f32, u32, DVec2, &str, String)] + #[implementations(f64, f32, u32, DVec2, bool, &str, String)] value: T, /// The other of the two numbers to compare for equality. - #[implementations(f64, f32, u32, DVec2, &str, String)] + #[implementations(f64, f32, u32, DVec2, bool, &str, String)] other_value: T, ) -> bool { other_value == value @@ -593,10 +593,10 @@ fn equals>( fn not_equals>( _: impl Ctx, /// One of the two numbers to compare for inequality. - #[implementations(f64, f32, u32, DVec2, &str)] + #[implementations(f64, f32, u32, DVec2, bool, &str)] value: T, /// The other of the two numbers to compare for inequality. - #[implementations(f64, f32, u32, DVec2, &str)] + #[implementations(f64, f32, u32, DVec2, bool, &str)] other_value: T, ) -> bool { other_value != value