preview-gui

Render the hops Slint GUI to a PNG headlessly for visual inspection.

Updated Jun 22, 2026
Ready to run
npx skills add https://github.com/jtjones09/grabbr-hops --skill preview-gui-jtjones09
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: preview-gui
Source: https://github.com/jtjones09/grabbr-hops/tree/main/.claude/skills/preview-gui
Command: npx skills add https://github.com/jtjones09/grabbr-hops --skill preview-gui-jtjones09

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slint draws its own pixels, so layout mistakes like stretched controls, misaligned dots, blank fonts, and dead space are invisible when reading .slint source code. This Skill renders the actual AppWindow to a PNG headlessly so you can look at the GUI, critique it, and fix it before showing the user. ## Core Features & Use Cases - Headless PNG rendering: Uses the render_png example harness in crates/hops-slint to snapshot the AppWindow via the Slint software renderer, with no display or screen-recording permission required. - Visual review checklist: Guides inspection for vertical alignment, stretch bugs, font loading, tonal separation, content fit, and de-boxing based on past bugs in the project. - State control via mock data: Edit render_png.rs mock data (set_connected, set_pairing_fp, devices, trusted VecModels) to exercise specific UI states like the pairing card. - Use Case: After editing a widget in ui/*.slint, run the render command, read the PNG, spot that a chip stretched into a giant box, pin its height in theme.slint, and re-render until correct. ## Quick Start Render the hops GUI to a PNG and inspect the image to verify my Slint layout changes look correct.

Frequently Asked Questions about preview-gui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render a Slint GUI to a PNG without a display?▼

Run the render_png example with cargo run -q -p hops-slint --example render_png -- <out.png> [width] [height]. It installs a headless platform with a MinimalSoftwareWindow before creating the AppWindow, so no display or screen-recording permission is needed.

How do I preview Slint layout changes before committing them?▼

Edit the .slint files, render the AppWindow to a PNG with the render_png harness, then open and critique the image for alignment, stretch, and font issues. Iterate until the render matches the target before showing the user.

Why is my rendered Slint PNG completely blank or transparent?▼

The software renderer leaves alpha at 0 in the take_snapshot RGBA8 buffer, so the PNG saves fully transparent. Force every pixel's alpha byte to 255 before saving, and call ui.show() plus update_timers_and_animations() before snapshotting.

Why does AppWindow::new() panic when rendering Slint headlessly?▼

The slint dependency needs the software-renderer-systemfonts feature enabled in crates/hops-slint/Cargo.toml. Without it, the embedded TTF fonts try to register with a renderer that cannot accept them and the app panics.

Why do Slint widgets stretch or misalign in a HorizontalLayout?▼

Text auto-centers on the cross-axis but non-text items like dots, chips, and toggles top-align or stretch to fill the row. Wrap each in a VerticalLayout with center alignment and pin control heights using the Size values in theme.slint.

Can I screenshot the real Slint window instead of using the software renderer?▼

Screenshotting requires the app to be an installed bundle recognized by the screen-access resolver plus a Screen-Recording grant for screencapture. The software renderer avoids all of that and renders identically across backends, making it a faithful proxy.