Skip to content

Photograph the editor into a gallery on every build of main - #201

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

matt-edmondson merged 1 commit into
mainfrom
claude/project-thread-4d94d3

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Before: The README described Coder.Editor in words only. Nothing showed what the node graph, the inspector or the generated-code preview look like, and no test drew the editor's whole window.

After: A new headless UI test project, tests/Coder.Editor.UITests, takes nine pictures of the editor and writes docs/gallery/README.md with a caption under each. The pictures are:

  • the node graph with the inspector and the generated C#
  • the inspector showing a function
  • the generated Python, C++, Rust and Go
  • the problems listed for an unfinished document (an empty operand and a detached node)
  • the layout tuning panel with one group open
  • the File menu

The README now links to the gallery.

How:

  • Each gallery entry is an MSTest case, built the same way as ImageGui's feature gallery.
    • It builds the editor the way Program does: Program.BuildServices(), then CoderEditorApp, then BuildConfig().
    • It runs the editor under ImGuiAppHarness at a fixed 1600×900, with ImGuiApp's Nerd Font and the mouse parked off-screen.
    • It lets the layout settle, stages the picture, then crops and saves it.
  • The pictures go to a temporary directory unless CODER_GALLERY_OUT names one.
  • The .UITests suffix and the tests/ directory put the project in the shared pipeline's Linux-only UI test leg. So every pull request shows that each picture can still be staged. A full gallery run takes about seven minutes on the CPU rasterizer.
  • No refactor was needed. CoderEditorApp, its BuildConfig() and Program.BuildServices() are already public, and nothing reads from disk at start-up.
  • The new .github/workflows/editor-gallery.yml follows ImGuiApp's widget-gallery.yml.
    • ci.yml calls it after the pipeline, and only for a push to main. Running it after the pipeline keeps it from racing the release job's metadata push.
    • It is a called workflow, not workflow_run, because Sonar rule S7631 flags workflow_run.
    • It regenerates docs/gallery and checks that each PNG is staged as an LFS pointer.
    • It commits as [bot][skip ci] Regenerate the editor gallery and pushes with a rebase-and-retry loop.

No PNGs or gallery README are committed here. The workflow writes them on its first run after merge. You can also start it by hand with workflow_dispatch on main.

Verified locally:

  • Two gallery runs into separate directories gave byte-identical PNGs and README.
  • I looked at the pictures, and each one shows what its caption says.
  • Coder.Test passed: 1115 of 1115.
  • The solution builds in Release with 0 warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WWRBkw7bXdWGzuLpqnCvrB


Generated by Claude Code

Adds tests/Coder.Editor.UITests, a headless UI test project whose Gallery tests start
Coder.Editor through ImGuiAppHarness, stage it and save a picture of each stage: the
node graph with the inspector and the generated C#, the inspector on its own, the
generated Python, C++, Rust and Go, the problems listed for an unfinished document,
the layout tuning panel, and the File menu. A further test writes docs/gallery/README.md
captioning every picture.

The pictures go to a temporary directory unless CODER_GALLERY_OUT names one, so on a pull
request they are ordinary tests that prove every stage can still be reached. The new
editor-gallery workflow, called from ci.yml after the pipeline on a push to main, writes
them to docs/gallery and commits them back when they change. Running the gallery twice
produces byte-identical pictures.

No PNGs are committed here; the workflow writes them on its first run.

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
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 28528c1 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