Skip to content

Upgrade egui stack 0.29 → 0.35 - #23

Merged
kakarot-dev merged 2 commits into
masterfrom
agent/egui-0-35
Aug 18, 2026
Merged

Upgrade egui stack 0.29 → 0.35#23
kakarot-dev merged 2 commits into
masterfrom
agent/egui-0-35

Conversation

@kakarot-dev

Copy link
Copy Markdown
Contributor

Summary

Mechanical upgrade of tokito_ui's egui stack from 0.29 to 0.35 — no behavior or visual changes intended. This is the upstream half of TokitoAI/tokito#502 (M0: egui 0.29 → 0.35): the app consumes this crate as a git-tagged dependency, so its egui types must unify with the app's before the app-side bump can compile.

Dependency changes

  • egui 0.29 → 0.35
  • egui_extras 0.29 → 0.35
  • egui-phosphor 0.7 → 0.13 (the release whose egui dependency is ^0.35)
  • eframe (dev-dependency, gallery example) 0.29 → 0.35

API migrations

  • RoundingCornerRadius (now i8-backed) — rounding_xs/sm/md() helpers on Tokens now cast the underlying f32 radius fields with as u8.
  • Frame::none()Frame::new(); Margin::same/symmetric now take i8.
  • WidgetVisuals::roundingcorner_radius; Visuals::window_rounding/menu_roundingwindow_corner_radius/menu_corner_radius.
  • Painter::rect_stroke now requires an explicit StrokeKind — used StrokeKind::Inside everywhere (egui's own migration guide's stated default for closed rectangles).
  • Context::style()/set_style() removed for per-theme style_of/style_mut_of. theme::apply() now pins the active theme via ctx.set_theme(...) and rewrites that theme's Style in one style_mut_of closure — preserves the prior "single active style, unconditionally overwritten" behavior.
  • egui::Id::new now requires AsId (Hash + Debug) — every id_source: impl Hash parameter across components.rs gained a + std::fmt::Debug bound.
  • ctx.fonts(|f| f.layout_job(..))fonts_mut(..) (layout_job needs &mut FontsView).
  • TextEdit::frame(bool)frame(Frame); falseFrame::NONE.
  • The egui::popup module and Memory::{is_popup_open,toggle_popup} were removed as part of egui 0.32's popup/menu overhaul — menu_button and select ported to the new egui::Popup builder (Popup::from_toggle_button_response(...).id(...).close_behavior(...).show(...); open-state reads use Popup::is_id_open).
  • Context::screen_rect()content_rect() (the modal primitive).
  • eframe::App::updateApp::ui (gallery example only).

Docs

AGENTS.md and README.md version claims updated (egui 0.29 → 0.35, egui-phosphor 0.7.x → 0.13.x, id_source bound note).

Gates (all green locally)

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all-targets (no unit tests exist in this crate yet; example compiles and runs)

For the reviewer

  • StrokeKind::Inside is a judgment call, not derivable from the type system — worth a visual pass over cargo run --example gallery in both themes to confirm borders still read the same.
  • No public function signatures changed except the additive + std::fmt::Debug bound on id_source params (existing callers all pass Debug types already, so this should not break tokito).

🤖 Generated with Claude Code

kakarot-dev and others added 2 commits August 19, 2026 02:48
Mechanical migration only — no behavior or API-surface changes beyond
what the egui upgrade forced.

Dependency bumps:
- egui 0.29 -> 0.35
- egui_extras 0.29 -> 0.35
- eframe 0.29 -> 0.35 (dev-dependency)
- egui-phosphor 0.7 -> 0.13 (the release pinned to egui ^0.35)

API migrations:
- Rounding -> CornerRadius (now i8-backed); helper fns cast the f32
  radius tokens `as u8`
- Frame::none() -> Frame::new() / Frame::NONE
- Margin::same/symmetric now take i8, not f32 — cast at call sites
- WidgetVisuals::rounding -> corner_radius; Visuals::window_rounding /
  menu_rounding -> window_corner_radius / menu_corner_radius
- Painter::rect_stroke now requires an explicit StrokeKind; used
  StrokeKind::Inside everywhere (egui team's stated migration default
  for closed rectangles, matching this crate's prior stroke look)
- Context::style()/set_style() removed in favor of per-theme
  style_of()/style_mut_of(); theme::apply() now pins the active
  theme via ctx.set_theme() and fully rewrites that theme's Style in
  one style_mut_of() closure, preserving the old single-Style
  override behavior
- egui::Id::new / id_salt now require AsId (Hash + Debug) — all
  `id_source: impl Hash` params gained a `+ std::fmt::Debug` bound
- ctx.fonts(|f| f.layout_job(..)) -> ctx.fonts_mut(..) (layout_job
  needs a mutable FontsView)
- TextEdit::frame(bool) -> TextEdit::frame(Frame); false -> Frame::NONE
- egui::popup module / Memory::{is_popup_open,toggle_popup} removed —
  ported menu_button/select to the new egui::Popup builder
  (from_toggle_button_response + close_behavior); open-state reads use
  Popup::is_id_open
- Context::screen_rect() removed -> content_rect()
- eframe::App::update -> App::ui (gallery example only)

Docs: AGENTS.md / README.md version claims updated to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adversarial review of PR #23 caught three real issues before merge:

1. StrokeKind::Inside was the wrong migration choice. Verified directly
   against the egui 0.29.1 epaint source (tessellator.rs:1709,
   `PathStroke::from(stroke).outside()` inside `tessellate_rect`) — 0.29's
   rect strokes were StrokeKind::Outside, not the migration guide's general
   "you probably want Inside" recommendation. Inside would have shifted
   every card/button/input border inward by a full stroke width. Flipped
   all 13 rect/rect_stroke sites in components.rs to Outside.

2. CI was failing on MSRV: egui 0.35 requires rustc 1.92 (confirmed via
   egui-0.35.0/Cargo.toml `rust-version = "1.92"`), but this repo had no
   rust-toolchain.toml and CI pinned rustc 1.88 via a literal dtolnay
   action version. Added rust-toolchain.toml (channel = "stable", mirrors
   tokito's), bumped Cargo.toml rust-version to 1.92, and repinned
   ci.yml's toolchain action to the 1.92.0 branch SHA. This also newly
   unlocks an MSRV-gated clippy suggestion (`map_or(true, ..)` ->
   `is_none_or(..)`) — fixed the one call site clippy flagged.

3. Fixed the gallery dev-dependency's `eframe` to build on glow instead of
   0.35's new wgpu default, matching the consuming app. `winit/default`
   (Wayland CSD + dlopen) isn't reachable through eframe's feature table
   from a downstream Cargo.toml (`dep/feature` syntax only reaches a
   *direct* dependency) — added `winit` as a direct dev-dependency at the
   same version eframe pins, requesting only the two sub-features
   (`wayland-csd-adwaita`, `wayland-dlopen`) that eframe's default-off
   build otherwise drops, restored via Cargo's per-package feature
   unification.

Also fixed a broken intra-doc link (`egui::SidePanel::right` ->
`egui::Panel::right`) that `cargo doc -D warnings` caught.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kakarot-dev
kakarot-dev merged commit 962e9da into master Aug 18, 2026
1 check passed
@kakarot-dev
kakarot-dev deleted the agent/egui-0-35 branch August 18, 2026 22:48
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.

1 participant