Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
7bea2f3
feat(windows): add custom Windows title bar and hide default
SilkePilon Jun 21, 2025
1831aa0
Merge pull request #2 from SilkePilon/feat-windows-custom-titlebar
SilkePilon Jun 23, 2025
188f5dd
Apply `cargo fmt` and auto-fix node lints
Byron Jun 23, 2025
8187f90
feat: add WindowsTitleBar component with app info and controls
SilkePilon Jun 23, 2025
129c157
Merge branch 'master' into feat-add-windows-titlebar-component
SilkePilon Jun 23, 2025
246c517
Merge pull request #3 from SilkePilon/feat-add-windows-titlebar-compo…
SilkePilon Jun 23, 2025
ed9722e
Merge branch 'master' into master
SilkePilon Jun 23, 2025
08abe9b
feat(windows-title-bar): add keyboard shortcuts and reactive project
SilkePilon Jun 23, 2025
c5ad4f3
Merge pull request #4 from SilkePilon/feat-add-windows-titlebar-compo…
SilkePilon Jun 23, 2025
b294960
feat(window): hide default title bar on Windows
SilkePilon Jun 23, 2025
7d9038d
Merge pull request #5 from SilkePilon/feat-add-windows-titlebar-compo…
SilkePilon Jun 23, 2025
537b015
feat(windows-title-bar): add editor badge to title bar
SilkePilon Jun 23, 2025
0492aa5
Merge pull request #6 from SilkePilon/feat/windows-title-bar-editor-b…
SilkePilon Jun 23, 2025
814132a
SilkePilon Jun 23, 2025
93522e9
refactor: move Windows title bar toggle to bottom of appearance settings
SilkePilon Jun 23, 2025
a54f238
Merge branch 'master' into add-custom-titlebar-setting
SilkePilon Jun 23, 2025
bc0f8cb
Merge pull request #7 from SilkePilon/add-custom-titlebar-setting
SilkePilon Jun 23, 2025
6221cce
Merge branch 'master' into master
SilkePilon Jun 24, 2025
c2f2059
fix(desktop): apply padding only with custom title bar on Windows
SilkePilon Jun 24, 2025
2ab80c1
Merge pull request #8 from SilkePilon/fix-windows-custom-titlebar-pad…
SilkePilon Jun 24, 2025
54e8acf
Merge branch 'master' into master
SilkePilon Jun 24, 2025
0aa1d8e
feat(ui,desktop): add borderRadius to Badge and improve title bar menus
SilkePilon Jun 24, 2025
ecec3fc
Merge pull request #9 from SilkePilon/feat-ui-borderradius-titlebar-m…
SilkePilon Jun 24, 2025
704aff2
Merge branch 'master' into master
SilkePilon Jun 24, 2025
70df29e
feat(windows): always use custom title bar and remove toggle
SilkePilon Jun 24, 2025
7a80706
style(desktop): adjust WindowsTitleBar menu button spacing
SilkePilon Jun 24, 2025
6329bcc
refactor: reorganize imports and streamline project state logic
SilkePilon Jun 24, 2025
db676b0
Merge pull request #10 from SilkePilon/windows-custom-titlebar-ui-ref…
SilkePilon Jun 24, 2025
d35fa4d
fix(desktop): remove extraneous closing braces in WindowsTitleBar
SilkePilon Jun 24, 2025
3d2a717
Merge pull request #11 from SilkePilon/fix-windows-titlebar-braces
SilkePilon Jun 24, 2025
30be9c4
refactor: improve window handling and code organization
SilkePilon Jun 24, 2025
7d27f90
Merge pull request #12 from SilkePilon/refactor-improve-window-handli…
SilkePilon Jun 24, 2025
cda86c0
refactor(ui): improve badge components and title bar UI
SilkePilon Jun 24, 2025
2a8b6cd
refactor: improve WindowsTitleBar component zoom handling
SilkePilon Jun 24, 2025
085d2ea
Merge pull request #13 from SilkePilon/refactor-badge-and-titlebar-co…
SilkePilon Jun 24, 2025
090c4ac
Merge branch 'master' into master
SilkePilon Jun 24, 2025
0f410aa
refactor: remove unused imports in AppearanceSettings.svelte
SilkePilon Jun 24, 2025
2147815
Merge pull request #14 from SilkePilon/refactor-remove-unused-imports…
SilkePilon Jun 24, 2025
ce9a5e2
Merge branch 'master' into master
SilkePilon Jun 24, 2025
c982a17
Merge branch 'master' into master
SilkePilon Jun 25, 2025
2789912
Merge branch 'master' into master
SilkePilon Jun 25, 2025
7c841ad
some style tweaks
PavelLaptev Jun 25, 2025
ea202ad
Refactor WindowsTitleBar badge and update styles
PavelLaptev Jun 25, 2025
a337322
ui fixes
PavelLaptev Jun 25, 2025
61366be
remove social net icons
PavelLaptev Jun 25, 2025
7b998e3
Merge branch 'master' into master
SilkePilon Jun 25, 2025
4aa7814
fix: simplify Badge component class logic
SilkePilon Jun 25, 2025
5fbbeaf
feat: add dropdown visibility tracking
SilkePilon Jun 25, 2025
18f0a0f
refactor: streamline dropdown management in WindowsTitleBar
SilkePilon Jun 25, 2025
65a3574
Merge pull request #15 from SilkePilon/sp-branch-2
SilkePilon Jun 25, 2025
848491e
remove extra platform check
PavelLaptev Jun 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
654 changes: 654 additions & 0 deletions apps/desktop/src/components/WindowsTitleBar.svelte

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
{/snippet}
<ThemeSelector {userSettings} />
</SectionCard>

<div class="stack-v">
<SectionCard centerAlign roundedBottom={false}>
{#snippet title()}
Expand Down
24 changes: 24 additions & 0 deletions apps/desktop/src/lib/backend/tauri.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
import { invoke as invokeIpc, listen as listenIpc } from '$lib/backend/ipc';
import { getVersion } from '@tauri-apps/api/app';
import { getCurrentWindow } from '@tauri-apps/api/window';
import { check } from '@tauri-apps/plugin-updater';

export class Tauri {
invoke = invokeIpc;
listen = listenIpc;
checkUpdate = check;
currentVersion = getVersion;

private window = getCurrentWindow();

async minimize() {
await this.window.minimize();
}

async toggleMaximize() {
const isMaximized = await this.window.isMaximized();
if (isMaximized) {
await this.window.unmaximize();
} else {
await this.window.maximize();
}
}

async close() {
await this.window.close();
}

async setDecorations(decorations: boolean) {
await this.window.setDecorations(decorations);
}
}
20 changes: 19 additions & 1 deletion apps/desktop/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import ShareIssueModal from '$components/ShareIssueModal.svelte';
import SwitchThemeMenuAction from '$components/SwitchThemeMenuAction.svelte';
import ToastController from '$components/ToastController.svelte';
import WindowsTitleBar from '$components/WindowsTitleBar.svelte';
import ZoomInOutMenuAction from '$components/ZoomInOutMenuAction.svelte';
import { ActionService } from '$lib/actions/actionService.svelte';
import { PromptService as AIPromptService } from '$lib/ai/promptService';
import { AIService } from '$lib/ai/service';
import { PostHogWrapper } from '$lib/analytics/posthog';
import { CommandService, invoke } from '$lib/backend/ipc';
import { Tauri } from '$lib/backend/tauri';
import BaseBranchService from '$lib/baseBranch/baseBranchService.svelte';
import { BranchService } from '$lib/branches/branchService.svelte';
import {
Expand Down Expand Up @@ -99,6 +101,7 @@
const gitLabClient = new GitLabClient();
setContext(GitHubClient, gitHubClient);
setContext(GitLabClient, gitLabClient);
setContext(Tauri, data.tauri);
const user = data.userService.user;
const accessToken = $derived($user?.github_access_token);
$effect(() => gitHubClient.setToken(accessToken));
Expand Down Expand Up @@ -264,6 +267,13 @@
let shareIssueModal: ShareIssueModal;

onMount(() => {
// Initialize window decorations for Windows
// Always use custom title bar on Windows, so hide default decorations
if (platformName === 'windows') {
// Decorations are inverted: true = show default title bar, false = hide default title bar
data.tauri.setDecorations(false);
}

return unsubscribe(
events.on('goto', async (path: string) => await goto(path)),
events.on('openSendIssueModal', () => shareIssueModal?.show())
Expand Down Expand Up @@ -302,10 +312,18 @@
onkeydown={handleKeyDown}
/>

<div class="app-root" role="application" oncontextmenu={(e) => !dev && e.preventDefault()}>
<div
class="app-root"
class:has-custom-titlebar={platformName === 'windows'}
role="application"
oncontextmenu={(e) => !dev && e.preventDefault()}
>
{#if platformName === 'macos' && !$settingsStore?.featureFlags.v3}
<div class="drag-region" data-tauri-drag-region></div>
{/if}

<WindowsTitleBar />

{@render children()}
</div>
<Toaster />
Expand Down
16 changes: 12 additions & 4 deletions apps/desktop/src/routes/[projectId]/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,22 @@
setContext(StackingReorderDropzoneManagerFactory, stackingReorderDropzoneManagerFactory);
});

const focusManager = new FocusManager();
setContext(FocusManager, focusManager);

// Set the Project context immediately so child components can access it
// Even if project is undefined, we set the context to prevent "no instance" errors
setContext(Project, data.project);

// Debug logging to help diagnose the issue
if (!data.project) {
console.warn('Project is undefined in [projectId] layout, projectId:', data.projectId);
}

$effect.pre(() => {
setContext(HistoryService, data.historyService);
setContext(TemplateService, data.templateService);
setContext(BaseBranch, baseBranch);
setContext(Project, project);
setContext(GitBranchService, data.gitBranchService);
setContext(UncommitedFilesWatcher, data.uncommitedFileWatcher);
setContext(ProjectService, data.projectService);
Expand All @@ -141,9 +152,6 @@
setContext(StackPublishingService, data.stackPublishingService);
});

const focusManager = new FocusManager();
setContext(FocusManager, focusManager);

let intervalId: any;

const forgeFactory = getContext(DefaultForgeFactory);
Expand Down
Binary file added apps/desktop/static/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/desktop/static/icons/dev/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/desktop/static/icons/nightly/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions crates/gitbutler-tauri/capabilities/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"permissions": [
"core:default",
"core:window:allow-start-dragging",
"core:window:allow-close",
"core:window:allow-minimize",
"core:window:allow-maximize",
"core:window:allow-unmaximize",
"core:window:allow-is-maximized",
"core:window:allow-set-decorations",
"core:window:default",
"dialog:allow-open",
"fs:allow-read-file",
Expand Down
17 changes: 17 additions & 0 deletions crates/gitbutler-tauri/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,22 @@ pub fn create(
window_relative_url: String,
) -> tauri::Result<tauri::WebviewWindow> {
tracing::info!("creating window '{label}' created at '{window_relative_url}'");

#[cfg(target_os = "windows")]
let window = tauri::WebviewWindowBuilder::new(
handle,
label,
tauri::WebviewUrl::App(window_relative_url.into()),
)
.resizable(true)
.title(handle.package_info().name.clone())
.disable_drag_drop_handler()
.min_inner_size(1000.0, 600.0)
.inner_size(1160.0, 720.0)
.decorations(true) // Start with decorations enabled, frontend will disable if user has custom title bar enabled
.build()?;

#[cfg(not(any(target_os = "windows", target_os = "macos")))]
Comment on lines +258 to +273
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not identical to below?

let window = tauri::WebviewWindowBuilder::new(
handle,
label,
Expand All @@ -265,6 +281,7 @@ pub fn create(
.disable_drag_drop_handler()
.min_inner_size(1000.0, 600.0)
.inner_size(1160.0, 720.0)
.decorations(true) // Start with decorations enabled, frontend will disable if user has custom title bar enabled
.build()?;
Ok(window)
}
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/styles/core/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
--lexical-input-client-padding: 12px;
--lexical-input-client-toolbar-height: 48px;
--lexical-input-font-size: 13px;

/* OS related */
--windows-title-bar-height: 30px;
}
3 changes: 2 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"dev": {
"dependsOn": ["package"],
"cache": false,
"persistent": true
"persistent": true,
"interruptible": true
},
"check": {
"dependsOn": ["package"]
Expand Down