egui / eframe 0.34 follow-up cleanup¶
Status: COMPLETED (eframe 0.35 bump, PR #131)¶
The deprecated-API cleanup this plan describes was carried out as
part of the eframe 0.34 → 0.35 upgrade, because 0.35 removed the
APIs that 0.34 only deprecated. Done in ryll/src/app.rs:
TopBottomPanel/SidePanel→ unifiedPanel(Panel::top/::bottom/::left/::right);default_width→default_size.- Every panel
show(ctx, …)→show(ui, …), fed by the root&mut UifromApp::ui;ctxis now a borrow of a cloned (Arc-backed)Contextso the remainingWindow::show(ctx, …)andctx.method()sites are unchanged.Windows still take&Context. show_animated(ctx, bool, …)→show_collapsible(ui, &mut bool, …).Frame::none()→Frame::NONE;ctx.style()→ctx.style_of(ctx.theme());InputState::screen_rect()→viewport_rect();Context::wants_pointer_input()→egui_wants_pointer_input();menu::menu_button(ui, …)→ui.menu_button(…);Ui::close_menu()→Ui::close().- The module-wide
#![allow(deprecated)]shim was removed; clippy passes under-D warningswith no remaining deprecated usage.
The historical analysis below is retained for context.
Prompt¶
Before responding to questions or discussion points in this
document, explore the ryll codebase thoroughly. Read relevant
source files, understand existing patterns (egui rendering,
panel layout, input handling), and ground your answers in
what the code actually does today. Do not speculate about
the codebase when you could read it instead. Where a question
touches on external concepts (egui 0.34 API surface,
Context vs Ui semantics, viewport vs content rect),
research as needed against the upstream changelog and docs.
Flag any uncertainty explicitly rather than guessing.
Consult AGENTS.md for build commands, project conventions,
code organisation, and a table of protocol reference sources.
I prefer one commit per logical change, and at minimum one commit per phase. Do not batch unrelated changes into a single commit. Each commit should build, pass tests, and have a clear commit message explaining what changed and why.
Situation¶
The renovate bump to eframe 0.34 (PR #61) was landed with
the minimum diff required to make the workspace compile
and pass clippy under the project's -D warnings policy.
That minimum diff consisted of:
- Renaming
RyllApp::updatetoRyllApp::ui, taking the providedUiand immediately pulling theContextout of it withlet ctx = ui.ctx();. The original body continues to driveTopBottomPanel/SidePanel/CentralPanelagainst thatContext, so the suppliedUiis intentionally unused at the top level. - Casting
Margin::symmetric(4.0, 2.0)toMargin::symmetric(4, 2). - Passing
egui::StrokeKind::Middleas the fourth argument toPainter::rect_stroke(preserves pre-0.34 behaviour where the stroke was centred on the rect edge). - Replacing the
LicenseRef-UFL-1.0cargo-deny exception forepaint_default_fontswithUbuntu-font-1.0, which is the SPDX identifier the crate now emits. - Adding
#![allow(deprecated)]at the top ofryll/src/app.rsso the 24 deprecation warnings the bump introduces do not trip clippy's-D warnings.
That last point is the debt this plan addresses. The
module-wide #![allow(deprecated)] also masks any future,
unrelated deprecations that show up in app.rs, which is
the largest file in the crate. We want it gone.
Mission and problem statement¶
Migrate ryll/src/app.rs (and any other call sites that
surface during the work) off the deprecated egui 0.34 APIs
listed below, then remove the module-wide
#![allow(deprecated)] so the next deprecation in this
file is once again loud at lint time.
Scope¶
The deprecated APIs the eframe 0.34 bump flagged in
ryll/src/app.rs, grouped by area:
App trait shape¶
eframe::App::update(&mut self, ctx, frame)is deprecated in favour ofui(&mut self, ui, frame)(currently satisfied by the trivial wrapper that extractsctxfrom the suppliedUi). Decide whether the app should restructure to use the providedUidirectly (drop the outer panels and put widgets straight on the rootUi) or keep the panel-driven layout and only update the signature. The current layout assumes panels, so the minimum-correct migration is "keep the wrapper, just remove#[allow(deprecated)]on theupdateshim if we reintroduce one".
Panels¶
egui::TopBottomPanel,egui::SidePanel,egui::CentralPanelare now type aliases marked deprecated; the canonical names live underegui::containers::panel. The aliases still resolve, so this is purely a path/import rename.Panel::show,Panel::show_animated,Panel::default_widthare deprecated. Replacements (per the upstream changelog) areshow_inside(when nesting inside an existingUi) or freshPanel::*builders. Audit each call site — the right replacement depends on whether the panel currently paints into the root viewport or into anotherUi.
Frame / margins¶
egui::Frame::none()is deprecated; useFrame::NONE(a const) orFrame::new(). Mechanical replacement.
Context-level helpers¶
egui::Context::styleis deprecated; renamed toglobal_style. Mechanical rename.egui::Context::wants_pointer_inputis deprecated; renamed toegui_wants_pointer_input. Mechanical rename. Verify there is not also awants_pointer_inputonInputStatethat we should switch to instead.
Input state¶
egui::InputState::screen_rectis deprecated and was split intoviewport_rect()andcontent_rect(). The deprecation note says callers "likely" wantcontent_rect(). Audit the single call site inapp.rsto confirm whether it cares about the OS window or the drawable content area — guessing wrong here changes positioning behaviour on platforms with a title bar / menu bar.
Menus¶
egui::menu::menu_buttonis deprecated; the new container lives underegui::containers::menu. Likely a non-trivial rewrite of the hamburger menu site because the new API uses a builder rather than a free function.egui::Ui::close_menuis deprecated. Find the replacement in the new menu container API and update the close path accordingly.
Approach¶
The migration is mechanical at most call sites, but two items need real judgement and should be done first so later steps can lean on the decisions:
screen_rect→viewport_rectvscontent_rect. Read the one call site, work out whether the consumer cares about the OS window or the drawable surface, and document the choice. The wrong choice is silent — it just produces subtly wrong layout on platforms where the two differ.- Menu rewrite. The new
egui::containers::menucontainer is a different shape from the oldmenu::menu_buttonfree function. Sketch the replacement against the hamburger menu site first so we know whether other menu sites need the same treatment.
Everything else (panel paths, Frame::none, Context::style,
wants_pointer_input, default_width, show → show_inside)
is mechanical. Once the call sites are migrated, delete the
#![allow(deprecated)] at the top of ryll/src/app.rs and
re-run make lint to confirm clippy is clean without it.
Acceptance¶
ryll/src/app.rsno longer contains#![allow(deprecated)].make lintpasses with-D warnings.make testpasses.- The hamburger menu, latency stats panel, bug-report
region-select overlay, and any layout that depended on
screen_rectall behave the same as before, verified by smoke-running the GUI against a QEMU SPICE target.
Open questions¶
- Is there a planned eframe 0.35 / 0.36 that further
reshapes the App trait (e.g. removes
updateentirely)? If so, the menu rewrite ought to happen ahead of that bump rather than after, to avoid double-migration. - Does the
screen_rectconsumer want viewport or content semantics? See Approach point 1.