Repository navigation
Add a headless app gallery rendered into docs/gallery - #488
Merged
Merged
Conversation
The gallery is a set of MSTest scenarios in a new tests/ProjectDirector.UITests project. Each one starts the real application through ktsu.ImGui.App.Testing, stages a view and saves a picture of it. A last test writes docs/gallery/README.md, which captions every picture. The six pictures show: - selecting a repository - comparing two repositories - comparing a file side by side - propagating a file - the Set Dev Directory dialog - the Add GitHub Owner dialog The pictures are byte-identical from run to run. The app's settings file and secret store are replaced with in-memory ones, and the three repositories it compares are seeded offline with pinned git authors and dates under a fixed path. Fetching on a timer is turned off, and every picture is cropped above the log panel, which prints wall-clock times. Reaching the app from a test needed a small refactor: - Main now starts the app through an internal BuildConfig(), and an internal constructor takes the settings to use. - The views a test clicks are marked with ImGuiProbes.MarkItem. - The file browser lists its entries in a case-insensitive name order rather than whatever order the file system returns them in. app-gallery.yml regenerates the pictures and commits them after CI passes on main, called from ci.yml the same way ImGuiApp's widget gallery is. No PNGs are committed here; the first run on main writes them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWRBkw7bXdWGzuLpqnCvrB
Path.Join treats a second segment that begins with a separator as part of the path instead of discarding the repository directory before it, which Path.Combine does. The browse path is relative, so nothing changes for it today. The gallery fixture also maps repository names to paths in the loop source rather than inside the loop body. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWRBkw7bXdWGzuLpqnCvrB
|
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.



Requested by Matt · project thread
Before: ProjectDirector had no pictures of itself. Its ImGui layer had no tests, and
Mainbuilt the whole application inline, so a test could not start it.After: the new
tests/ProjectDirector.UITestsproject renders an app gallery with the CPU rasterizer. There is no window, GPU or network involved. The six pictures are:No PNGs and no
docs/gallery/README.mdare committed here. They arrive with the first run of.github/workflows/app-gallery.ymlonmain, or by dispatching that workflow by hand. The workflow follows ImGuiApp's widget gallery:app-galleryjob inci.ymlafter the pipeline passes, and only on a push tomain.workflow_callplusworkflow_dispatch, neverworkflow_run.[bot][skip ci] Regenerate the app gallery.The README now links to the gallery.
How: each gallery entry is an ordinary MSTest scenario, so every PR proves each picture can still be staged. The scenario:
ImGuiAppHarness.MockFileSystemand the GitHub token store to an in-memory credential cache, so nothing reads or writes the settings or credentials of whoever runs it.PROJECTDIRECTOR_GALLERY_OUT names the output directory. Without it, the pictures go to a temporary directory that is deleted afterwards.
Things worth knowing:
Mainnow callsnew ProjectDirector().BuildConfig().BuildConfig()is internal, and an internal constructor takes the settings to use, while the public constructor still loads them from disk as before. The views a test clicks are marked withImGuiProbes.MarkItem, andInternalsVisibleToadmits the new test project. Runtime behaviour is otherwise unchanged.ListBrowserEntriesnow sorts the entries by name, ignoring case. This is a small visible change in the app./tmp/projectdirector-gallery, a fixed path rather than a fresh temp directory. The app prints the dev directory and the selected repo's local path, so that path appears in the pictures.ktsu-io. The dialog is never confirmed.Verified locally:
ProjectDirector.Test: 162 passed, 1 skipped, and 1 failed. The failure isCloningAnLfsRepositoryRestoresTheFileContentRatherThanThePointer, and it fails the same way on an untouchedmaincheckout in the same environment, so it predates this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01WWRBkw7bXdWGzuLpqnCvrB