Skip to content

Replace the Electrobun desktop app with the native GPUI file manager - #248

Merged
jR4dh3y merged 222 commits into
masterfrom
gpui/native-file-manager
Nov 26, 2026
Merged

jR4dh3y merged 222 commits into
masterfrom
gpui/native-file-manager

Conversation

@jR4dh3y

@jR4dh3y jR4dh3y commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

The problem

BoxBox Desktop was an Electrobun app: Chromium (CEF), Bun and a private Go server bundled together to browse local files through the web UI. It started slowly, used about 700 MB at rest, and behaved like a web page rather than a Linux file manager. It also needed WebKitGTK, AppIndicator and a portal backend on the host.

The solution

The native GPUI file manager, built on this branch under experiments/gpui-desktop/, becomes the desktop app. It is one Rust binary that talks to the system directly (UDisks2, GVfs, the freedesktop Trash, bookmarks and thumbnails, Wayland). It browses paired BoxBox servers over their API. In local measurements it started in 177 ms against 413 ms and settled at 113 MB against 705 MB (desktop/README.md).

  • Moved experiments/gpui-desktop/ to desktop/. Removed the Electrobun host, Bun scripts, AppRun launcher and FileChooser portal backend. The thumbnail crate moves from desktop/native to desktop/thumbnail as a workspace member.
  • Root scripts: dev, build, check, test and install:desktop now run cargo on desktop/Cargo.toml.
  • Release archive: boxbox-desktop-v<version>-linux-amd64.tar.gz keeps its name, so the website download page is unchanged. It now holds boxbox-files, install.sh (per-user, no sudo, with --set-default and --uninstall), a desktop entry, the icon and LICENSE. package-release.ts now builds the frontend itself before the server binaries; the old desktop build used to do this as a side effect.
  • Release check: runs the standalone server in --dev mode and checks it serves the API and embedded UI. It then installs, updates and uninstalls the desktop app in a throwaway home with spaces in its path, and checks that the default handler and user settings are left alone.
  • AppImage: wraps the binary. The new scripts/desktop-smoke.ts launches the app on a throwaway root and passes only when the profiler records the first painted frame and a painted folder listing. CI runs it under Xvfb with software Vulkan (mesa-vulkan-drivers).
  • AUR: the PKGBUILD installs from the release archive with GPUI's dependencies. The publish step removes the Electrobun-era files from the AUR repo.
  • CI: the setup action installs Rust and the GPUI libraries in place of WebKitGTK and CEF. The desktop and package jobs get 60 minutes for a cold Rust build, and the CI desktop job runs the launch smoke test.
  • Docs: docs/desktop.md is rewritten for the new app. README, AGENTS.md, docs/release.md and docs/development.md are updated.

Behaviour changes for users: the command is boxbox-files and the desktop ID is io.boxbox.files.desktop. Settings from the Electrobun app are not migrated, and the FileChooser portal backend is gone. AppImage and AUR publishing only work for tags that ship this app; v0.3.2 and earlier cannot be repackaged with these tools.

Follow-up (not in this PR)

The frontend's desktop-only code (lib/desktop/, lib/api/desktop*, components/desktop/, the chooser route) and the Go server's --desktop mode, desktop chooser API and desktop servers/transfers served only the Electrobun host. They are now unused. Removing them is a separate, large change.

Verification

Passed locally (Arch, Niri):

  • bun run test:desktop: 158 app tests and 6 thumbnail tests pass.
  • bun run check:desktop (clippy): builds, with 21 existing warnings; warnings do not fail the job yet.
  • bun scripts/package-release.ts, then bun scripts/check-release-package.ts: PASS.
  • scripts/package-appimage.ts with the pinned, checksum-verified appimagetool 1.9.1 and type2 runtime: built the x86_64 AppImage; its .sha256 verifies and desktop-file-validate passes.
  • scripts/desktop-smoke.ts passed on the bare binary (Wayland), the bare binary on X11 (WAYLAND_DISPLAY=) and the AppImage with APPIMAGE_EXTRACT_AND_RUN=1.
  • scripts/prepare-aur.sh and makepkg against the built archive produced a package with the binary, desktop entry (Exec=/usr/bin/boxbox-files %U), icon and license.
  • .github/scripts/test_ci_scope.py passes.

Not tested:

  • The GitHub workflows themselves.
  • The smoke test under Xvfb with lavapipe on Ubuntu.
  • The aarch64 AppImage.
  • namcap (not installed locally).
  • AUR publishing.

🤖 Generated with Claude Code

Confidence Score: 5/5 · The clipboard changes appear safe to merge; no new blocking defect was established.RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

The clipboard changes appear safe to merge; no new blocking defect was established.

Summary

This PR replaces the Electrobun desktop app with the native GPUI file manager. The latest change puts text and file clipboard writes through one shared Writer.

  • BoxBox Files opens local folders and paired servers in a native file manager.
  • The Electrobun host and its bundled portal backend are removed.
  • Release tools build and publish the native app for Linux and Windows.
  • The server can remove an empty directory during file operations.
  • Developers can compare the web components with the native file manager.

Accepted limits from earlier replies:

  • jR4dh3y kept one small fallback icon read per drag; Greptile accepted that explanation.
  • jR4dh3y accepted the remaining watcher limit for launchers in subfolders because that layout is rare.
  • jR4dh3y deferred addressing non-UTF-8 filenames and browsing SMB share lists. Browsing skips unsupported names, and discovered SMB servers ask for a share name instead.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Text["Text fields, selected text, share links"] --> Copy["copy_text"]
  Files["File copy or cut"] --> Begin["begin_file_write"]
  Copy --> Writer["Shared Writer: lock and generation"]
  Begin --> Writer
  Writer --> OS["System clipboard"]
  Copy --> Pending["Pending text for immediate paste"]
Loading

Reviews (35) · Last reviewed commit: "fix(desktop): order text and file clipbo..." · Reviewed by Greptile

usehoplite Bot and others added 30 commits November 5, 2026 11:55
Benchmark snapshot against the Electrobun baseline (Linux, 2026-11-05):\n\n- GPUI: 177 ms startup, 113 MB settled RSS\n- MyGo/WebKitGTK: 303 ms startup, 227 MB settled RSS\n- Electrobun/CEF: 413 ms startup, 705 MB settled RSS\n\nGPUI measured 57% faster to first browse request and used 84% less settled memory. Measurements are local point-in-time data, not a release guarantee.
Persist GPUI preferences under XDG_CONFIG_HOME/boxbox-gpui/settings.json and apply hidden-file, default-sort, default-view, compact-row, and file-extension settings to the browse surfaces.
Add Api::search for GET /search with response validation against the request, per-pane search state (2-char minimum, debounce, stale-response guard), and a keyboard-driven search field in the toolbar with Ctrl+F, Enter, Escape and paste. Results replace the folder listing and restore it on clear or navigation.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The GPUI client is now a native Linux file manager styled like BoxBox.
The map sorts each Svelte file into what the native app keeps, what opens
in a native app instead, and what is web only, with its status in this
line and in PR #226's line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Electrobun sources and config take master's versions: the branch's
runtime renderer choice was an Electrobun experiment, kept in 48c1fc7.
The thumbnail crate keeps the branch's additions, which the GPUI app
links against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The native app styled each control inline, so it drifted from the web UI.
Add Rust components named after the Svelte ones (Button, Input, Toggle,
Select, ProgressBar, ContextMenu, Modal, Toast). Colours are generated from
layout.css and icons from the Lucide set at build time.

A shared gallery manifest renders at /dev/gallery (dev server only) and
under `boxbox-gpui --gallery`; compare-gallery.py diffs them per cell.
All 22 cells are within 3%, except the disabled toggle (GPUI has no group
opacity).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
FileListHeader and FileRow follow FileList.svelte: percentage columns, a
checkbox only on icon hover or selection, icons rather than thumbnails, and
newest-first sorting with folders first. SidebarSection and NavItem follow
Sidebar.svelte, with collapsible sections and pinned favorites.

The tab strip used ml_auto, and Taffy then drops the row's gaps, so a spacer
replaces it. Against the web app at 1280x800, differing pixels fall from
2.66% to 0.98% (list area 3.05% to 0.81%).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A 100k-file folder froze the window for about 240 ms on load and on every
header click, because the comparator parsed both timestamps per comparison
on the UI thread. Keys are now read once per item (51 ms by date, 67 ms by
name, in release), and loads, search results and re-sorts are arranged on
the background executor. Pane entries are shared snapshots, so a re-sort
does not copy them on the UI thread, and a result is dropped when the
entries or sort changed meanwhile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preferences, desktop settings and favorites each had their own atomic
write, and each ran on the UI thread on every toggle. One `persist` module
now owns the config directory and the atomic write. Writes run on the
background executor, one at a time per file, and a write that a newer one
replaced is skipped, so the newest state always lands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
FileTile follows FileGrid.svelte: fixed 152px tiles, cover-cropped
thumbnails, a checkbox on hover, and no detail line for folders (the native
grid showed "—"). The list and grid now share the selection style, cut
state, checkbox handler and display name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dialogs, the location bar and search each had hand-rolled key handling with
no IME, no mouse selection and no word movement. They now use TextField,
the input from PR #226 (GPUI's input example) scrolled to keep the caret in
view, inside the shared Input frame. Rename selects the name without its
extension.

The file menu follows fileContextMenu.ts on ContextMenu, with icons and
shortcuts. The toolbar's + opens the add menu; local folders say "Copy files
here…". Name, properties and preview dialogs use Modal. Text previews are
read-only, as editing belongs to the file's own app, so the save path is
gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Results were a status line under the toolbar that stayed until the next
operation. They are now notices from the shared Toast, bottom right: at
most four at once, each closing five seconds after it is shown. A running
operation shows its label in the status bar, and the name dialog keeps its
own error line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Settings drew its own rows, toggles and cycle buttons, and its dialogs
kept their text in strings fed by a hand-rolled key handler. The frame,
General and Appearance now follow SettingsModal.svelte on Modal,
SettingsTab, SettingsRow, Toggle and Select; a select opens its options
as a menu with the current one ticked. Appearance has the web's rows: an
accent source, an inline hex field, compact rows, and wallpaper fit, tint
and frost once a wallpaper is set. The hardware acceleration row is gone,
as GPUI has no such switch.

Server and share dialogs use Modal, Button and TextField; the bearer token
field is masked and cleared once used. Sort and view preferences are enums
that keep the settings file's labels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The native sidebar had no Devices section. It now reads UDisks2 over the
system D-Bus with zbus, which GPUI already pulls in. A watcher thread lists
again after each UDisks signal, so plugged-in drives appear and removed ones
go. Visibility follows GIO's volume monitor, which the web app shows through
the Go server: ignored and driveless blocks are skipped, as are filesystems
mounted at system locations. On this machine both apps list the same
"482 GB Volume".

Clicking a volume mounts it if needed (polkit asks) and opens it. Eject
unmounts the drive's filesystems first, then ejects or powers it off; a fixed
volume is unmounted. All D-Bus calls run off the UI thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy and cut stayed inside the app. Local items now go on the system
clipboard as x-special/gnome-copied-files, text/uri-list (with KDE's cut
flag) and plain paths, and paste reads files other apps copied. Paths the
pane's provider can reach go through the normal transfer, so a cut moves
them; others are copied in. A paste of this app's own copy keeps using the
in-app clipboard.

On Wayland the app owns the clipboard through the data-control protocol
(wl-clipboard-rs), which wlroots compositors, Niri, Hyprland and KDE offer
and GNOME does not; X11 uses xclip. Clipboard calls run off the UI thread,
and tests never touch the developer's clipboard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The web menu offers "Open with…" for local files; the native app had no
way to pick an app. open_with.rs ports the Go server's listing: XDG desktop
entries, mimeapps.list defaults and added and removed associations, the
file's type from GIO, recommended apps first and then every visible app
that takes a file. Launching goes through `gio launch`, and "Use as
default" through `gio mime`. The dialog follows OpenWithDialog.svelte, with
search across both groups and icons from the hicolor theme and pixmaps.
Listing and launching run off the UI thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A paste onto a taken name failed outright. A paste now plans first, off
the UI thread: it lists the destination once, drops a cut back into its own
folder, and gives each conflict a "stem (copy N).ext" name. Conflicts open
TransferConflictDialog's choice, Skip by default or Keep both, and the
transfer runs with the chosen names. Across providers a renamed copy is
staged under its new name before it is imported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Delete, a move off a server, emptying an item from Trash and resetting
preferences asked through GPUI's system prompt, which looks nothing like
BoxBox. One Confirm dialog on Modal now asks each question, worded as
BrowseDialogs.svelte words delete: the item's name, or a count and the
names. Escape closes it, as it closes the conflict dialog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every launch opened another window. The first window now owns a private
Unix socket (from PR #226's instance.rs); a later launch hands it its
argument and exits, and the window opens it in a new tab and raises
itself. The socket is per user and per provider setting, so a server or
test window never takes local launches. Launch arguments may be virtual
paths, real paths or file:// URIs; a file opens its folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lumns

A lone drive card was 515px where the web's is 498px: Taffy floors a flex
item's base size at its padding and border, so a padded card outgrew the
empty column beside it. Cards now sit in bare cells, and the column count
reads the content box, as the web's container query does. The card moves
to components/drive_card.rs, and its usage bar uses the shared ProgressBar.
This PC differs from the web app in 0.1% of pixels (the label and live
sizes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
As browse/undo.svelte.ts does on the web: the workspace remembers the last
local move to Trash (with each item's trash ID) or rename, and Ctrl+Z
restores the items or renames back, off the UI thread. A focused text field
keeps Ctrl+Z to itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
KeyboardShortcutsDialog.svelte's layout on Modal, listing the keys this app
actually binds: Space previews here, and there is no Shift+Delete yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A long paste or import only showed a label in the status bar, with no
progress and no way to stop it. Each one is now a job in a panel like
TransferJobs.svelte, under the notices: name, destination, a progress bar
with "N% of size", and a button that cancels a running job or dismisses a
finished one.

Local copies now copy in 1 MiB chunks. A transfer sets a progress scope on
its background thread, so the copy loop reports bytes and stops when
cancelled without a handle threaded through every provider call; the
partial copy is removed. The panel redraws on a 200 ms timer only while a
job runs. A cancel shows in the panel, not as an error notice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Browsers and editors open a download's or file's folder through
org.freedesktop.FileManager1 on the session bus. The running window now
serves ShowFolders, ShowItems and ShowItemProperties, each opening a tab as
a second launch would. It asks for the name without replacing or queueing,
so a file manager that already answers keeps doing so. The item is not
selected yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dragging a file out of the window did nothing on native Wayland (sway,
Hyprland, Niri with BOXBOX_NATIVE_WAYLAND=1). It only worked through
XWayland, where a second X connection can run XDND on its own.

Wayland does not allow that: a drag must be started by the client that
owns the pressed surface, naming the serial of that press, and GPUI 0.2.2
has no drag-source API and keeps its connection and serials private.

Rather than vendor and patch GPUI (8 MB of source for one hook), the app
now joins GPUI's own connection. The window hands out its wl_display and
wl_surface through raw-window-handle; drag_out/wayland.rs wraps that
display with a second event queue, the way clipboard helpers share a
toolkit's connection. Being the same client, its own wl_seat binding is
sent the same button serials, and wl_data_device.start_drag with the last
one is accepted. The queue is read on a dedicated thread, so the UI
thread only queues requests; the file list is resolved (or, for a server,
downloaded) and written to the target on a thread per request.

Wayland keeps the pointer on the pressed window while the button is
held, so the in-window drag and its label stay as they were, and the drag
is handed to the compositor when the pointer crosses the window edge.
The data device exists only for the length of a drag, so GPUI's own
device keeps answering clipboard and incoming drops.

A drag can now come back into the window it left, so a drop skips files
that already sit in the destination folder instead of failing with
"already exists".

Checked on headless sway 1.12 with a GTK3 Wayland drop target: one row,
a 13-item selection and a grid tile each arrive as text/uri-list with the
right file:// URIs; a refused drop, a drop back on the own window and a
drop in from GTK still behave. Not run: other compositors, a remote
server, and X11 (its code only lost the Prepare alias). Outside the
window the drag has no icon.

The GPUI keymap panic (wayland/client.rs:1267) is left alone, as GPUI is
not patched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jR4dh3y and others added 11 commits November 22, 2026 14:25
…t edge

A hand-sized Name handed the spare room to the last column, leaving a gap
after it in a wide window; the file chooser never fitted the columns, so they
ran off its right side. Name now always fills, and a border sizes the column
to its right so it still follows the pointer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Small tiles with folder previews can show more than the 512 images the cache
holds. Evicting by age dropped visible ones, which were asked for again and
evicted others in turn. The least recently drawn image now goes first, and
none drawn in the last two seconds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ctures

A preview filtered only dot names, so a file marked Hidden on Windows showed
in its folder's tile. Editing a picture in place leaves its folder's time
alone, so the cached preview kept the old picture; a folder listed again now
reads its preview again, showing the old one until then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Customize Folder needs about 420 px of body; in a short window its title bar
and Done button fell outside. Every dialog now fits the window, keeping its
title and footer, and its body scrolls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Looks were kept by the path as written, so a folder customised under
home/projects showed plain through a link to projects. A look is now saved by
the folder's real path, and a folder drawn while any look exists resolves
its real path off the UI thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…footer shadow

The status bar's List/Grid buttons become a shared ViewSwitch, also in the
chooser's toolbar. The grid moves by rows with up and down.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… chooser

Grid tiles render pictures, PDFs and media through the main window's
thumbnail cache and queue. Ctrl+plus, Ctrl+minus, Ctrl+0 and Ctrl+wheel size
the list and grid as in the main window; the step maths moves into shared
helpers. The header names the app from its desktop entry, with its icon,
instead of its app ID.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…omize Folder

Deleting for good, from Trash or emptying it asks one short question in a
narrow dialog with no title bar. Other confirmations keep their explanation.
Customize Folder drops its title bar: the folder's preview and name span a
Folder/Icon switch over one row of swatches, and the icon grid loses its frame
and fades out at the bottom.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the Electrobun entry

The Linux entry takes the Electrobun app's ID, io.boxbox.desktop, and its
name, BoxBox, so it replaces that app in menus and keeps its folder default.
Its icon ships as PNGs rendered by scripts/desktop-icons.ts: Qt-based shells
draw the logo's SVG (masks, currentColor, <use href>) as a black shape. The
installer removes the BoxBox Files entry and the SVG icons earlier installs
left.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread scripts/package-appimage.ts Resolved
Comment thread desktop/packaging/install.sh Resolved
Comment thread desktop/src/workspace/folder_looks.rs Resolved
Comment thread desktop/src/transfer.rs Resolved
Comment thread desktop/src/transfer.rs Resolved
Comment thread desktop/src/workspace/operations.rs Resolved
Comment thread desktop/src/workspace/operations.rs Resolved
Comment thread desktop/src/pane.rs Resolved
The binary was renamed to boxbox-files at packaging time. Master's desktop app is boxbox with the io.boxbox.desktop id, so ship the binary, the Windows exe, the AppImage entry and the AUR package under that name, and drop the cleanup for the io.boxbox.files entry that was never released.
@jR4dh3y
jR4dh3y merged commit 172f897 into master Nov 26, 2026
18 checks passed

This branch was successfully deployed

1 active deployment
Preview — a34e67ef Deployed Nov 26, 2026 by vercel[bot]
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.

3 participants