Skip to content

Add a headless widget gallery tool and generated gallery images - #521

Merged
matt-edmondson merged 7 commits into
mainfrom
claude/widget-gallery-harness-ouh9b5
Sep 29, 2026
Merged

matt-edmondson merged 7 commits into
mainfrom
claude/widget-gallery-harness-ouh9b5

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Before: there were no pictures of the widgets for the README, and nothing kept a gallery in step with the widget library.

After: dotnet run -c Release --project tools/WidgetGallery renders every widget in ktsu.ImGui.Widgets headlessly and writes the results to docs/gallery/:

  • one PNG per widget in widgets/
  • the full captioned gallery, widgets.png
  • one sheet per README feature group, widgets-<group>.png

--check fails when an ImGuiWidgets member has no tile, so a new widget needs a gallery entry alongside its demo and isolation suite. CLAUDE.md now says so.

How: each tile renders on its own through ImGuiAppHarness with the application's Nerd Font and with Material Icons merged in. The crop is the union of the widget's item rectangle and its pixel difference against a baseline frame. Dialog tiles close themselves so that Hexa's static managers don't leak into the next tile. The composites are laid out in C# and drawn by ImGui itself. Tiles live in tools/WidgetGallery/Catalog/, one file per feature group. The 66 tiles are committed via LFS, and a rerun changes only the tiles whose widgets changed.

Known caveats:

🤖 Generated with Claude Code

https://claude.ai/code/session_01K7xbLYjN86afX9oQFeVxnA


Generated by Claude Code

tools/WidgetGallery renders every widget in ktsu.ImGui.Widgets alone in a
headless harness, crops each to what it drew, and composites the tiles into
captioned gallery images grouped by the README's feature list. A --check mode
reports any ImGuiWidgets member without a tile, so widgets that land later
are flagged rather than silently missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7xbLYjN86afX9oQFeVxnA
One PNG per widget under docs/gallery/widgets, plus the full gallery and
one sheet per feature group, all rendered by tools/WidgetGallery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7xbLYjN86afX9oQFeVxnA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7xbLYjN86afX9oQFeVxnA
Adds WidgetGallery.UITests, which runs the tool end to end. Draws composite
tiles through ImGuiWidgets.Image instead of an unsafe block, splits Main and
the dialog-button search to bring their complexity down, and recreates the
sample folder when a second run in one process finds it deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7xbLYjN86afX9oQFeVxnA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7xbLYjN86afX9oQFeVxnA
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants