Repository navigation
Layout debug overlay (F12), and a CI failure summary - #28
Merged
Merged
Conversation
`Debug::Outlines`, set on the egui context with `Debug::set` (or flipped by `Debug::toggle_on(ctx, key)`), makes `Placed::draw` outline every node's border box with a one-physical-pixel hairline on the topmost debug layer, and label the innermost node under the pointer with its readable path and rect. The mode lives in the context, not in `LayoutState`, so one key binding governs every tree drawn in a frame (an example draws a theme bar and a page with separate states). Off costs one context read per layout and per draw: no shapes, no per-node allocation. A node is outlined in red when its content did not fit. For a leaf, layout re-measures it at its final content width when the overlay is on and records the size its text or measure wants (`PlacedNode::measured`); it did not fit if that exceeds the content box on either axis by more than half a point (truncated text is cut to the box by design). A container did not fit when an in-flow child extends past its padding box on an axis it does not clip. The examples bind F12: `ThemeBar::show` (so everything that shows the bar, and the shared runner) and chat_shell call the one `common::toggle_debug`. Tests are shape-based (kittest harness): off emits nothing and leaves the frame unchanged, one outline per node at its rect, red for a nowrap text leaf, a too tall leaf and a spilling child but not a fitting, clipped or wrapping one, hover labels the innermost node, the toggle key. One snapshot golden, debug_overlay_todo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
…t panic (#27) The `ci` job failed once on PR #17 and passed on re-run, and the raw log had expired before anyone read it. Cargo output is now captured (stderr merged into stdout) while it is streamed unchanged to stderr, and a failed step is summarised in one line: its status, every `test ... FAILED` with the test binary it ran in, and the first panic's location and message, or for a step with no test failure its first compiler or rustfmt complaint. The summary logic is a pure function with unit tests over sample cargo output. Behaviour changes: `run_all` runs every step instead of stopping at the first failure, so a lint failure no longer hides a test failure; and cargo output is no longer a terminal, so it is not coloured. No reentrancy bug of the class fixed in 2daaebd was found by auditing every `Context` closure in src and tests (see the issue); the two draw.rs sites that evaluated `ui.unique_id()` inside a `data` closure now read it first. They did not lock, so this changes no behaviour. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
CI's ci and coverage jobs died with `ld terminated with signal 7 [Bus
error]`: the runner ran out of disk. Each of the 24 files in tests/ was
its own test crate statically linking egui/eframe/egui_kittest, 400-700 MB
apiece with debuginfo.
- tests/*.rs are now modules of one crate, tests/it/main.rs; the shared
support module sits beside them. The golden-image tests are a
`#[cfg(feature = "snapshots")]` module of the same binary instead of a
required-features target. trybuild's compile_fail is a module too. Test
bodies are unchanged; their paths gain a module prefix. Four modules
are renamed *_demo because they clash with the example they include.
- `cargo xtask snapshots` runs `--test it` filtered to `snapshots::`.
Behaviour change: `--filter NAME` now matches goldens whose name starts
with NAME (it was a substring match).
- ci.yml: CARGO_PROFILE_{DEV,TEST}_DEBUG=line-tables-only (panics keep
file:line) and a `df -h` / `du -sh target` step that always runs.
- xtask summary: strip ANSI escapes (CI sets CARGO_TERM_COLOR=always) and,
when a step fails without test failures, report `could not compile
<crate> (<target>)` with the first `fatal error:` or error line. Tested
against an excerpt of the real failing log.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
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.
Closes #25. Refs #27 (not reproduced; left open).
Debug overlay (#25)
bullseye::Debug(Offby default,Outlines) lives in the egui context:Debug::of,set,toggle,toggle_on(ctx, Key). One F12 handler then governs every tree drawn in the frame. When Off it costs one context read per layout and per draw, with no shapes and no per-node allocation.Drawing: on a top-most
Order::Debuglayer, every node's border box is outlined with a 1-physical-pixel hairline. That includes anonymous nodes, leaves and overlay roots.Red means content didn't fit. This is exact, not a heuristic:
Hover: the innermost node under the pointer is labelled with its readable path, its rect and its size.
Examples: F12 toggles it through one helper,
common::toggle_debug, which every example reaches.Tests:
tests/debug.rshas 6 tests:The golden is
debug_overlay_todo.CI failure summary (#27)
Not reproduced:
tests/layout.rs, which shares a static context, at 1, 2 and 64 threads, pinned to 2 CPUs;all passed.
Reentrancy audit: every lock-taking
Context/Uiclosure insrc/,tests/andexamples/was checked, and none calls another context method. Two harmlessunique_id()reads insidedataclosures were hoisted out anyway, so the pattern doesn't get copied.A failed step now ends with one line: the failing test names, and the first panic as
file:line:coland message. A compile error or fmt diff shows its first line instead. The parser is a pure function (xtask/src/summary.rs) with 7 unit tests.Behaviour changes:
cargo xtask ciruns every step instead of stopping at the first failure, so a lint failure can't hide a test failure. The exit code is still non-zero on any failure.The remaining lead, if the failure recurs: the trybuild compile-fail test is slow (53 s in one run) and shares the target directory.
To try (UI)
The overlay's colours (outline
#6c8ebf, overflow#ff3030) and its label style are open for review.🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up