Repository navigation
M0: scaffold and spikes - #2
Merged
Merged
Conversation
Adds the bullseye crate skeleton (edition 2024, MSRV 1.96), CI (fmt, clippy -D warnings, tests, doctests, rustdoc -D warnings), the design brief as docs/design.md and CLAUDE.md, so later milestones build on checked ground. Spikes, each a passing test written to be kept by M1: - measure.rs: taffy measure adapter over egui galleys (max-content, min-content = widest word, height-for-width, both-known passthrough, first baseline). The min-content width is the exact widest-word width, because a galley wrapped at that width can come out slightly wider. - spikes.rs: child Ui identity via UiBuilder::scope_id, text colour and font overrides on a child Ui, headless egui_kittest, and the focused widget id query. - Exit test: "Hello" in an 800x600 centred flex container has the measured size and is centred. egui is a dev-dependency with default_fonts: egui 0.37 has no default features, so fonts must be enabled explicitly for measurement tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
This was referenced Nov 7, 2026
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.
Part of #1.
Sets up the crate and CI, and proves the egui and taffy spikes the plan depends on. Each spike ends in a passing test. Nothing draws yet.
What's here
Cargo.toml:taffy 0.15.1,egui 0.37eframe,egui_kittest, andeguiwithdefault_fonts.github/workflows/ci.yml): fmt, clippy-D warnings, tests, doctests, and rustdoc-D warnings.docs/design.md(the design brief) andCLAUDE.md, both verbatim.src/measure.rs: the taffy measure adapter, which measures text with egui galleys, plus its tests and the exit test.src/spikes.rs(test-only): childUiidentity, text overrides, headless kittest, and the focus query.Findings
taffy measure: the callback is
compute_layout_with_measure(node, avail, |LayoutInput, NodeId, Option<&mut Ctx>, &Style| -> LayoutOutput).Baselines work. The first baseline is
row.pos.y + glyph.pos.y, returned inLayoutOutput.baselines.first. This meansitems_baselineis feasible.egui 0.37 renames:
UiBuilder::id→UiBuilder::scope_idUi::id→Ui::scope_idId::newis deprecated, replaced byId::uniqueorIdSaltContext::run→run_ui/run_pass, and the returnedFullOutputmust be explicitly dropped withdrop_without_applying_deltasThe brief's D12 maps to
scope_id. A test shows the child's id is the same under any parent.Text overrides:
visuals.override_text_colorandstyle.override_font_idboth reach aLabelinside a child scope.Fonts: egui 0.37 has
default = []. The library depends on plainegui, so it stays neutral. Tests enabledefault_fonts. Applications get fonts through eframe.Focus:
ctx.memory(|m| m.focused()). Ids are hashes with no hierarchy, so the virtual-list pinned rows (M8) must track which widget ids belong to which row.kittest: runs headless under
cargo test. Snapshots (thesnapshotandwgpufeatures) work on the dev machine. They are kept out of CI for now.MinContent cost for a 50-word paragraph, in release: 627 µs cold, 5.8 µs warm (galley cache hit).
🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up