feat(macos): native desktop app with macOS-native UI - #2
Open
duyet wants to merge 20 commits into
Open
Conversation
Xcode's `metal` tool is missing when only Command Line Tools are installed. Enable gpui_platform/runtime_shaders so `cargo build -p chm-app` works, and keep the chm-app 0.1.1 lockfile bump.
Replace the placeholder Queries/Merges/Replicas/Health/Tables/Traffic views with live tables and charts, poll the active page, and honor --connect, CHM_PROFILE, and CHM_CONFIG. Range chips only show on pages that use a time window; chart axes use stroked grid lines so labels stay readable on Metal.
Document runtime shaders vs Xcode, the implemented --connect / CHM_PROFILE / CHM_CONFIG flags, and a macOS GUI smoke script that captures the app window.
Horizontal 1px strokes tessellate into a filled stripe texture on the Metal runtime-shader path, and a collapsed canvas stacked every y-label into ~40px. Fill the parent height, drop the grid, and paint three right-aligned y-labels in the left gutter.
A Sidebar header control and cmd-b switch between the full nav and the icon strip. Until the user toggles, a window under 900px still collapses on its own.
The chmonitor menu gains Settings… (⌘,) and View gets sidebar/refresh. A Settings page at the sidebar footer persists appearance, update channel, and telemetry in config.toml without taking a 1–8 shortcut.
The sidebar lists saved hosts ([profile] plus [profiles.*]) and Connect can name a host on save. The status bar shows the active host, ok/error, version, replica count, and last fetch time.
Connect can add a CH or PG host. Postgres is a read-only tokio-postgres client (pg_stat_activity/statements/tables/replication). Merges and Traffic stay hidden on a PG host so the sidebar matches the engine.
Replace the bezel/crabtalk GPUI stack with Longbridge gpui-component on official Zed GPUI. Sidebar, status bar, charts, tables, inputs, and settings now use the widget kit; Metal still compiles at runtime.
Add gpui-base and style its Button, Radio, Toggle, Switch, and Table primitives from theme tokens. Sidebar, charts, and theme stay on gpui-component.
Add the chmonitor avatar as AppIcon.icns, scripts/build-macos.sh to emit dist/macos/chmonitor.app, and an [update] config (check on launch, optional auto-download). The status bar installs over the running bundle; manifests now hash the downloadable archive.
Apply the chmonitor.dev Rhea palette (indigo primary, amber charts) and larger metric type. Pages hydrate from a 20s disk cache, show skeleton placeholders on first load, and toggle light/dark from the title bar. Status bar tracks fetch time and RSS; opt-in telemetry pings telemetry.chmonitor.dev for installs and page views.
Use gpui-component TitleBar with traffic lights, host switcher, range, and theme/settings in the chrome. Overview defaults to six live-health metrics and compact density; Settings picks density, tiles, chart, and sidebar.
Port the four dashboard headline cards (Active Queries, Schema, Storage, Uptime) plus the matching system.tables / query_log SQL. Settings still lets you add the extra tiles.
Drag the split between nav and content (140–360px). The width is saved as [ui].sidebar_width. Collapsed icon mode is unchanged.
SF Pro via .SystemUIFont, Menlo numbers, system blue/red/green. Time range is a segmented control; settings switches use the native Switch. Charts and the storage bar follow accent blue.
Move host switching into the sidebar header with the app icon, put the collapse toggle in the title bar, and anchor settings at the bottom of the sidebar. Co-authored-by: Cursor <cursoragent@cursor.com>
Gate Path behind target_os = macos and drop a redundant local in the sidebar nav suffix closure. Co-authored-by: Cursor <cursoragent@cursor.com>
Assert the matching manifest row for the current target triple instead of always expecting the macOS artifact on Linux CI. Co-authored-by: Cursor <cursoragent@cursor.com>
Start Xvfb in the smoke script and export DISPLAY so screenshot capture uses the same headless display as the app under xvfb-run on GitHub-hosted runners. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.appbundle with auto-updateTest plan
cargo test -p chm-appCHM_SMOKE=1 cargo run -p chm-applaunches headless smoke pathscripts/build-macos.shproducesdist/macos/chmonitor.appwith AppIconMade with Cursor