feat(desktop): scaffold desktop app

Co-authored-by: Maze <mazeincoding@users.noreply.github.com>
This commit is contained in:
Maze Winther
2026-07-10 19:57:05 +00:00
committed by Cursor Agent
co-authored by Maze
parent 7ae51862b6
commit b59255cca8
14 changed files with 142 additions and 13 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ tasks:
dev:
command: 'bun run dev'
options:
runInCI: false # dev server skipped in CI, never cached
runInCI: false # dev server: skipped in CI, never cached
build:
command: 'bun run build'
+1 -1
View File
@@ -11,5 +11,5 @@ export default new Elysia({ adapter: CloudflareAdapter })
body: t.Object({ message: t.String() }),
}
)
// .compile() is required it triggers AoT compilation at startup
// .compile() is required, it triggers AoT compilation at startup
.compile();
+13
View File
@@ -0,0 +1,13 @@
[package]
name = "opencut-desktop"
description = "OpenCut desktop app, built with GPUI"
version.workspace = true
edition.workspace = true
license.workspace = true
[[bin]]
name = "opencut-desktop"
path = "src/main.rs"
[dependencies]
gpui = { workspace = true }
+24
View File
@@ -0,0 +1,24 @@
# OpenCut Desktop
Built with [GPUI](https://www.gpui.rs).
> [!WARNING]
> Very early. Right now this is just a window that opens.
## Running
Rust is pinned in `.prototools` at the repo root (`proto use` installs it).
```sh
moon run desktop:dev # cargo run
moon run desktop:check # cargo check
moon run desktop:build # cargo build --release
```
The first build compiles GPUI from source and takes a while. The root `Cargo.lock` is committed.
## Platform requirements
- **macOS**: Xcode command line tools (Metal renderer).
- **Windows**: no extra dependencies (Win32 + DirectWrite).
- **Linux**: renders via Vulkan (Blade), windows via Wayland or X11 (both enabled by default). System packages (Debian/Ubuntu names): `libvulkan1` + working Vulkan drivers, `libwayland-dev`, `libx11-xcb-dev`, `libxkbcommon-x11-dev`, `libfontconfig-dev`, plus a C toolchain and `cmake`.
+28
View File
@@ -0,0 +1,28 @@
$schema: 'https://moonrepo.dev/schemas/project.json'
language: 'rust'
layer: 'application'
tasks:
dev:
command: 'cargo run'
options:
runInCI: false
check:
command: 'cargo check'
inputs:
- 'src/**/*'
- 'Cargo.toml'
- '/Cargo.toml'
- '/Cargo.lock'
build:
command: 'cargo build --release'
inputs:
- 'src/**/*'
- 'Cargo.toml'
- '/Cargo.toml'
- '/Cargo.lock'
outputs:
- '/target/release/opencut-desktop'
+51
View File
@@ -0,0 +1,51 @@
use gpui::{
div, prelude::*, px, rgb, size, App, Application, Bounds, Context, SharedString,
TitlebarOptions, Window, WindowBounds, WindowOptions,
};
struct Root {
status: SharedString,
}
impl Render for Root {
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
div()
.flex()
.flex_col()
.gap_2()
.size_full()
.justify_center()
.items_center()
.bg(rgb(0x111111))
.text_color(rgb(0xffffff))
.child(div().text_xl().child("OpenCut"))
.child(
div()
.text_sm()
.text_color(rgb(0x888888))
.child(self.status.clone()),
)
}
}
fn main() {
Application::new().run(|cx: &mut App| {
let bounds = Bounds::centered(None, size(px(960.), px(600.)), cx);
cx.open_window(
WindowOptions {
titlebar: Some(TitlebarOptions {
title: Some(SharedString::from("OpenCut")),
..Default::default()
}),
window_bounds: Some(WindowBounds::Windowed(bounds)),
..Default::default()
},
|_, cx| {
cx.new(|_| Root {
status: "desktop shell scaffold".into(),
})
},
)
.expect("failed to open the main window");
});
}
+1 -1
View File
@@ -7,7 +7,7 @@ tasks:
dev:
command: 'bun run dev'
options:
runInCI: false # dev server skipped in CI, never cached
runInCI: false # dev server: skipped in CI, never cached
build:
command: 'bun run build'
+1 -1
View File
@@ -16,7 +16,7 @@ export const Route = createRootRoute({
content: 'width=device-width, initial-scale=1',
},
{
title: 'OpenCut rewrite beta.opencut.app',
title: 'OpenCut rewrite | beta.opencut.app',
},
],
links: [