Skip to content

Desktop: Isolate CEF-rendered UI into separate crate and process#4321

Merged
timon-schelling merged 14 commits into
masterfrom
desktop-ui-crate
Jul 14, 2026
Merged

Desktop: Isolate CEF-rendered UI into separate crate and process#4321
timon-schelling merged 14 commits into
masterfrom
desktop-ui-crate

Conversation

@timon-schelling

Copy link
Copy Markdown
Member
  • New graphite-desktop-ui crate runs CEF in its own host process
  • Main process spawns controls the host over IPC
  • Frames returned via shared memory, or shared GPU textures
  • Fixes a bunch of problems that come with running CEF in-process

TL;DR: I got tired of dealing with CEF so I isolated it

@timon-schelling

timon-schelling commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

!build desktop (Run ID 29061690651)

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

cubic-dev-ai[bot]

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown
📦 Mac Build Complete for f526630
Download binary

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
📦 Linux Build Complete for f526630
Download binary
Download Flatpak

@github-actions

Copy link
Copy Markdown
📦 Windows Build Complete for f526630
Download binary

@timon-schelling

timon-schelling commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

!build desktop (Run ID 29065912212)

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 18 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/ui/src/dirs.rs">

<violation number="1" location="desktop/ui/src/dirs.rs:12">
P2: Replacing the panic with `tracing::error!` avoids crashing, but callers of `app_tmp_dir()` now have no way to know that directory creation failed. The function still returns the path as if it were valid, so downstream code may hit less-obvious IO failures later. Consider propagating the error by changing the return type to `io::Result<PathBuf>` (and updating `temp_dir_root()` accordingly), so callers can handle the failure explicitly.</violation>
</file>

<file name="desktop/ui/src/remote/spawn.rs">

<violation number="1" location="desktop/ui/src/remote/spawn.rs:256">
P2: Replacing `.expect()` with `?` here introduces a partial-startup risk: `InstanceReceivers` has already been consumed from the `HostHandle`, so if this or a subsequent thread spawn fails, earlier threads remain running while the caller gets no `shutdown_complete_receiver` and cannot call `start_instance` again (it would return `InstanceLimit`). Consider ensuring cleanup of already-spawned threads on error, or deferring `receivers.take()` until all spawns succeed.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread desktop/ui/src/remote/host.rs Outdated
Comment thread desktop/ui/src/dirs.rs
Comment thread desktop/ui/src/remote/spawn.rs
@github-actions

Copy link
Copy Markdown
📦 Mac Build Complete for 24c5cb2
Download binary

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
📦 Linux Build Complete for 24c5cb2
Download binary
Download Flatpak

@github-actions

Copy link
Copy Markdown
📦 Windows Build Complete for 24c5cb2
Download binary

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 15 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread desktop/ui/src/frames/surface.rs
@timon-schelling

timon-schelling commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

!build desktop (Run ID 29287686618)

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
📦 Linux Build Complete for 948bf0e
Download binary
Download Flatpak

@github-actions

Copy link
Copy Markdown
📦 Mac Build Complete for 948bf0e
Download binary

@github-actions

Copy link
Copy Markdown
📦 Windows Build Complete for 948bf0e
Download binary

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/ui/src/ipc.rs">

<violation number="1" location="desktop/ui/src/ipc.rs:1">
P3: This TODO is contradicted by the current module graph: `context.rs` uses `crate::ipc` directly, so inlining `ipc.rs` into `internal` would either break `BrowserContext` or require an unmentioned re-export. Please update or remove the TODO so future refactors do not treat this shared module as internal-only.

(Based on your team's feedback about TODO expectations.) [FEEDBACK_USED].</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread desktop/ui/src/ipc.rs Outdated
@@ -1,3 +1,5 @@
// TODO: Consider inlining this file into internal as it is no longer use outside

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: This TODO is contradicted by the current module graph: context.rs uses crate::ipc directly, so inlining ipc.rs into internal would either break BrowserContext or require an unmentioned re-export. Please update or remove the TODO so future refactors do not treat this shared module as internal-only.

(Based on your team's feedback about TODO expectations.) .

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/ui/src/ipc.rs, line 1:

<comment>This TODO is contradicted by the current module graph: `context.rs` uses `crate::ipc` directly, so inlining `ipc.rs` into `internal` would either break `BrowserContext` or require an unmentioned re-export. Please update or remove the TODO so future refactors do not treat this shared module as internal-only.

(Based on your team's feedback about TODO expectations.) .</comment>

<file context>
@@ -1,3 +1,5 @@
+// TODO: Consider inlining this file into internal as it is no longer use outside
+
 use cef::{Frame, ImplBinaryValue, ImplFrame, ImplListValue, ImplProcessMessage, ImplV8Context, ProcessId, V8Context, sys::cef_process_id_t};
</file context>
Suggested change
// TODO: Consider inlining this file into internal as it is no longer use outside
// TODO: Consider reorganizing this file; it is shared by context and internal CEF handlers.

@timon-schelling timon-schelling changed the title Desktop: Isolate CEF-rendered UI in a separate crate and process Desktop: Isolate CEF-rendered UI into separate crate and process Jul 14, 2026
@timon-schelling timon-schelling added this pull request to the merge queue Jul 14, 2026
Merged via the queue into master with commit c863a2c Jul 14, 2026
11 checks passed
@timon-schelling timon-schelling deleted the desktop-ui-crate branch July 14, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants