Skip to content

Latest commit

 

History

History
 
 

zbugs-gpui

Folders and files

README.md

zbugs in GPUI

zbugs as a native desktop app on the Zero Rust client (rust/zero-client) and GPUI, through GPUI Kit (gpui-kit). macOS first.

  • The model, apps/zbugs-model, is shared with the Rune app: the generated schema and the ports of zbugs' queries and mutators.
  • src/transport.rs: the client's clock and timers on GPUI's foreground executor, so the client runs on the main thread with the UI, and its WebSockets on a tokio thread of the app's own (tokio-tungstenite, rustls). zero-client itself only gets its sqlite feature.
  • src/live.rs: a typed query kept current in a GPUI view.
  • src/app.rs: the issue list (filters, search, the synced count, a scroll bar, paging as it scrolls) and the selected issue (markdown, labels, comments, commenting, closing and reopening). Issue List in the account menu sets how tall the list is: Estimated Full Height (the default) makes it as tall as the synced count, so the scroll bar spans every issue and a drag or click of it pages straight there, with placeholders for rows still to come; Pages as You Scroll makes it as tall as the rows loaded so far. The choice is kept in list-height in the app's directory.
  • The local store is SQLite in ~/Library/Application Support/zbugs-gpui, apart from zbugs-swift's.

Running the app

Start zbugs' backend as for zbugs-swift (see apps/zbugs-swift/README.md), which prints a token for a crew user and ready <zero-cache> <API>:

ZBUGS_PG=postgresql://user:password@127.0.0.1:6434/postgres \
  node apps/zbugs-swift/server/server.ts

Then run the app with the token:

cd apps/zbugs-gpui
ZBUGS_TOKEN=<token> cargo run

ZBUGS_CACHE_URL (default http://127.0.0.1:4848) and ZBUGS_API_URL (default http://127.0.0.1:5173) point it elsewhere. Each is also read from a file of that name (token, cache-url, api-url) in the app's directory.

On macOS, cargo run runs the app as an app: bundle.sh, Cargo's runner there (.cargo/config.toml), makes ZBugs GPUI.app beside the executable (target/debug, or target/release with --release) and runs the app from inside it, so the Dock and the app switcher show its icon. The environment and the output are as before. The bundle stays, to open from Finder or keep in the Dock; it reads the token and the servers from the files above. The icon is compiled with Xcode's actool, which needs Xcode 26 or later.

The icon (AppIcon.icon, an Icon Composer file) is zbugs-swift's with GPUI's logo as a badge, the mark from gpui.rs. GPUI and its logo are Zed Industries'.

Blank space

A debug build with ZBUGS_TINT_BLANK=1 tints the issue list's background orange and has its rows draw the window's, so any blank space a scroll shows, where no row is painted yet, stands out. examples/blanking.rs pushes a list like the issue list, and a chat in GPUI's list whose messages run from a line to a few hundred words, as hard as it can, and counts the frames that show blank space: cargo test --example blanking runs it headless (CI runs it with the other tests), and cargo run --example blanking in a window, with BLANKING=full for the list at its Estimated Full Height and BLANKING=chat for the chat.