lore-forge/desktop
Peterino 2174cc97e4 Show transfer speed in the desktop client
The service now measures the bytes a sync, submit or clone moves and
adds them to its activity events as a transfer: direction, bytes done
and total, the rate over the last 3 s, and the elapsed time. On
finish, the rate is the transfer's average. Running events are sent
at most every 250 ms, or when the file count changes, rather than on
every liblore progress event.

The workspace bar shows the running transfer's direction, speed,
bytes and time left under it, and keeps the last transfer's size,
time and average speed until the next one. Sizes in the file list and
the bar share one formatter, in units of 1024, with GB and TB.

The desktop e2e checks that a submit reports bytes pushed and a sync
bytes fetched.
2026-11-26 21:07:28 -07:00
..
gui Show transfer speed in the desktop client 2026-11-26 21:07:28 -07:00
lore-sys Add file locking, autosync and notifications to the desktop client 2026-11-26 12:07:40 -07:00
protocol Show transfer speed in the desktop client 2026-11-26 21:07:28 -07:00
service Show transfer speed in the desktop client 2026-11-26 21:07:28 -07:00
vendor Add the desktop client 2026-11-25 19:09:43 -07:00
Cargo.lock Add file locking, autosync and notifications to the desktop client 2026-11-26 12:07:40 -07:00
Cargo.toml Add file locking, autosync and notifications to the desktop client 2026-11-26 12:07:40 -07:00
README.md Ask for the server on the desktop client's first run 2026-11-26 18:21:06 -07:00
build.zig Drive real workspaces through liblore in the desktop client 2026-11-26 10:19:27 -07:00
build.zig.zon Add the desktop client 2026-11-25 19:09:43 -07:00

README.md

lore-forge desktop client

A tray application for people working in Lore repositories, and the per-user service it talks to. The design is in .ai/designs/desktop-client.md.

Program What it is
forge-desktop The GUI: a UHDK window and tray icon, drawn with Dear ImGui (C++) in a pixel-art style
forge-service The client service: does the Lore work and runs policies (Rust)
forge-tui A terminal frontend. Not written yet

On first run the window asks which Lore server you work on (for example lore.example.com), signs you in through the forge in your browser, and lists the repositories you can clone. Nothing needs configuring first.

Build and run

You need Zig 0.17.1 and Rust. On macOS you also need the Xcode Command Line Tools. From this directory:

zig build          # both programs, installed in zig-out/bin/
zig build run      # open the GUI; it starts the service if none is running
zig build test     # the GUI's self-test against a private service, then cargo test

Closing the window hides it to the tray when there is one. The tray's Quit ends the GUI and leaves the service running; STOP SERVICE in the window stops it.

forge-desktop --licenses prints the licences of what is compiled in: the IBM VGA 8x16 font (CC BY-SA 4.0, by VileR), Dear ImGui, UHDK and glad.

The service keeps its socket, desktop.toml and service.log in:

Platform Directory
macOS ~/Library/Application Support/lore-forge/
Linux ~/.config/lore-forge/; the socket is in $XDG_RUNTIME_DIR/lore-forge/
Windows %APPDATA%\lore-forge\; the socket is a named pipe

Set LORE_FORGE_DESKTOP_DIR to use one directory instead. A Unix socket path must stay under about 100 bytes, so keep that directory's path short.

The GUI keeps the server you chose in server in the same directory. Workspaces are added from the window; the service records them in desktop.toml:

# desktop.toml
[[workspace]]
name = "my-game"
path = "/Users/me/lore/my-game"
remote = "lores://lore.example.com:41337/me/my-game"
autosync = "off"   # off, interval or on_change

Self-test

forge-desktop --test runs against a private service in a new temporary directory and exits 0 once the service has answered and a frame has been drawn.

  • --config-from desktop.toml gives that service workspaces. The test then syncs the first one and waits for its progress.
  • --tab files|graph|tree opens on that tab.
  • --screenshot out.png saves the final frame. Use it to check UI changes; it needs a display that is awake (on macOS a sleeping display makes the window fail to open).
  • --service PATH picks the service binary to start.

Other platforms

zig build check -Dtarget=x86_64-windows-gnu (or x86_64-linux-gnu) cross-compiles the GUI.

Cargo builds the service for the host only. For another platform, build it with Cargo for that target and put forge-service beside forge-desktop.

Platform limits come from UHDK:

  • Linux: Wayland only. The tray needs a StatusNotifier host.
  • Windows: builds target x86_64-windows-gnu.

Layout

Path Contents
gui/src/ The GUI: frame loop, sidebar and service handling (main.cpp), the explorer tabs (explorer.cpp), protocol client, platform glue, the pixel-art theme and icons (theme.cpp), the compiled-in font and licences (embedded.cpp)
gui/uhdk_imgui/ UHDK's ImGui platform backend, copied from UHDK's examples
protocol/ Message types and socket location; the reference the C++ client follows
service/ The client service
vendor/ UHDK, Dear ImGui and the font, unmodified; see vendor/README.md