Skip to content

Add a headless gallery of the Schema editor - #269

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/project-thread-4d94d3
Oct 9, 2026
Merged

matt-edmondson merged 2 commits into
mainfrom
claude/project-thread-4d94d3

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Before: The repository had no pictures of the Schema editor. Seeing what it looks like meant building and running it.

After: docs/gallery/ will hold ten captioned pictures of the editor working on a small sample schema for a game. CI regenerates them from main after every passing build. The README links to the gallery. The pictures are:

  1. Starting a schema (the File menu)
  2. Editing a class (the member grid)
  3. Member metadata (unit, range, default and the other metadata fields)
  4. Choosing a type
  5. Choosing a unit
  6. Editing an enum
  7. Code generators
  8. Class graph
  9. Diagnostics
  10. Themes

No pictures are committed here. LFS pushes are refused from the environment this was written in. The first run of the workflow on main writes the PNGs and docs/gallery/README.md. You can also get them earlier by dispatching Editor Gallery from the Actions tab.

How: The gallery follows ImageGui's feature gallery.

  • The tests. Each picture is an ordinary MSTest scenario in tests/Schema.Editor.UITests/Gallery. It starts the real editor through ImGuiAppHarness, stages it with probe clicks, and saves the rasterized frame. Because they are ordinary tests, every pull request proves each picture can still be staged.
  • Output. The pictures go to a temporary directory unless SCHEMA_GALLERY_OUT names one. A last test writes the captioned README.md.
  • Determinism. The pictures are byte-identical from run to run. Display size and font are fixed, the mouse is parked off-screen, and there are no clocks or machine paths.
  • The workflow. .github/workflows/editor-gallery.yml copies the structure of ImGuiApp's widget-gallery.yml. It is called from a new editor-gallery job in ci.yml after the pipeline, for pushes to main only. It is not a workflow_run. It commits as github-actions[bot] with [bot][skip ci], and refuses to commit any PNG that is not an LFS pointer.

Refactor in the editor. Two small seams, neither of which changes what a user sees:

  • SchemaEditor.MarkMainTabs: the right-hand tab bar comes from a widget library that records nothing. This method records each tab as main-tab/<name>, but only while a probe is listening. That is how the gallery reaches the class graph and the diagnostics list.
  • ClassGraphView.RequestFitToView(): the gallery calls this so the class graph picture shows the whole layout. Nothing in the editor calls it yet. Whether users should get a "fit to view" control is a separate decision.
  • SchemaEditor.ClassGraph is now internal so the gallery can reach it.

CLAUDE.md now documents both seams and the gallery.

Verified locally:

Check Result
Release build of the whole solution 0 warnings
Schema.Editor.UITests (includes 11 gallery tests) 201/201
Schema.Editor.Test 26/26
Schema.Test 514/514
Schema.Cpp.Test 104/104
Two gallery runs into separate directories byte-identical

🤖 Generated with Claude Code

https://claude.ai/code/session_01WWRBkw7bXdWGzuLpqnCvrB


Generated by Claude Code

Ten pictures of the editor working on a small sample schema for a game: the File menu, a class's
member grid, a member's metadata fold, the type and unit pickers, an enum, a code generator, the
class graph, the diagnostics list and the theme browser. Each is an ordinary test in
tests/Schema.Editor.UITests/Gallery that stages the editor through probe clicks and saves the
rasterized frame, so every pull request proves each picture can still be staged. They write to a
temporary directory unless SCHEMA_GALLERY_OUT names one, and a last test writes a captioned
README.md beside them. Two runs produce byte-identical files.

editor-gallery.yml runs them into docs/gallery after CI passes on main and commits the result back
as github-actions[bot], following ImGuiApp's widget-gallery.yml: called from ci.yml rather than as
a workflow_run, after the pipeline so the release commit is already on main, and refusing to commit
a picture that is not an LFS pointer. No pictures are committed here; the first run on main writes
them.

Two seams in the editor, neither used outside a test. The right-hand tab bar comes from a widget
library that records nothing, so MarkMainTabs records each tab as main-tab/<name> while a probe is
listening, which is how the gallery reaches the class graph and diagnostics. And the class graph
gains RequestFitToView, which the gallery calls so the picture shows the whole layout rather than
whatever part of it lands on the canvas.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWRBkw7bXdWGzuLpqnCvrB
@matt-edmondson matt-edmondson self-assigned this Oct 9, 2026
Comment thread tests/Schema.Editor.UITests/Gallery/EditorGallery.cs Fixed
Comment thread tests/Schema.Editor.UITests/Gallery/EditorGallery.cs Fixed
Comment thread tests/Schema.Editor.UITests/Gallery/EditorGallery.cs Fixed
Path.Combine discards everything before a rooted segment, which the
code-quality check flags. None of these segments is rooted, so Join
produces the same paths without the hazard.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWRBkw7bXdWGzuLpqnCvrB
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 7e9ef7f into main Oct 9, 2026
15 checks passed
@matt-edmondson
matt-edmondson deleted the claude/project-thread-4d94d3 branch October 9, 2026 21:52
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