Lets you tell what is driving a scroll: a mouse wheel, fingers on a
trackpad (not a touch screen), or the OS continuing a trackpad swipe
with momentum.
```rust
pub enum MouseWheelSource {
Unknown,
Wheel,
Trackpad,
Momentum,
}
```
* `Event::MouseWheel` gains `source: MouseWheelSource`. Integrations set
it to `Unknown` if they don't know.
* `InputState::scroll_source() -> Option<MouseWheelSource>`: what is
driving the current scrolling, `Some` while `is_scrolling()`. For a
trackpad that covers the whole gesture (`TouchPhase::Start`…`End`); for
a mouse wheel, until the smoothing of the last notch is done. Touch
screens scroll by dragging with the pointer, not with wheel events, so
`None` there.
Use cases: a `ScrollArea` can rubber-band and hold while fingers rest on
the trackpad, but bounce during momentum (#8663, built on this). A
slider or plot can ignore `Momentum` so a flick doesn't keep changing a
value after the fingers lift.
**Where the source is known**
* macOS (eframe): `Wheel`, `Trackpad` or `Momentum`. winit folds the
macOS momentum phase into the regular `TouchPhase`, so egui-winit reads
`NSEvent::momentumPhase` itself through a local event monitor
(`macos_scroll_momentum.rs`, owned by `State`, removed on drop). Precise
deltas are `Trackpad`, line deltas `Wheel`. Goes away once we are on a
winit with rust-windowing/winit#4732; marked with TODOs.
* winit `PanGesture`: `Trackpad`.
* Everywhere else: `Unknown`. Web `WheelEvent`s carry no phase or source
at all.
**Also**: the 150 ms scroll-action timeout from #8636 is tuned for
flowing events. Fingers resting on a trackpad produce none, so a known
`Trackpad` gesture now survives a 1 s gap before being considered over.
The enum mirrors the one proposed for winit.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
* Closes <https://github.com/emilk/egui/issues/8325>
* Closes <https://github.com/emilk/egui/issues/8443>
* [x] I have followed the instructions in the PR template
winit on Wayland sends `TouchPhase::Start` for some mouse wheels, but
never `TouchPhase::End` (winit's own comment in its Wayland pointer
handler: "the `Ended` is not guaranteed to be sent for mouse wheels").
Since #7678, `WheelState` then stays `InTouch` for good, and in
`InTouch` the modifiers are only ever added to. So after a single
ctrl+scroll, every later scroll is a zoom, which is what #8325 bisected
to 1b77d7047. `is_scrolling()` also stays `true`, and with
`show_tooltips_only_when_still` that keeps tooltips from showing.
This ends an `InTouch` scroll action after 150 ms without scroll events,
the same timeout `Smoothing` already uses. The check runs in
`after_events`, and also when the next wheel event arrives, because an
idle app may not run a pass after the timeout has passed. While events
keep coming, the modifiers stay latched as #7678 intended.
Tests, in `wheel_state.rs`:
* `modifiers_should_not_stick_when_touch_phase_end_never_arrives`:
`Start`+`Move` with ctrl, then 1 s later a `Move` without ctrl. Before
the fix it zoomed (`left: 0.9753099`, `right: 1.0`).
* `scroll_action_should_end_when_touch_phase_end_never_arrives`:
`is_scrolling()` is `false` after a second without scroll events. Before
the fix it stayed `true`.
* `modifiers_should_stick_until_touch_phase_end`: letting go of shift
mid-scroll still scrolls horizontally until `End` (the #7678 behavior).
Passes before and after.
`cargo test -p egui --all-features` passes (75 unit tests, 186
doc-tests), and so do `cargo fmt`, `./scripts/lint.py`, `cargo clippy -p
egui --all-features --all-targets -- -D warnings` and `cargo doc -p egui
--document-private-items`. The whole-workspace `cargo test
--all-features` on macOS (with the snapshot tests) passes too. I don't
have a niri or COSMIC setup, so the tests replay winit's event sequence
rather than a real wheel.
Kinetic (momentum) scrolling after a drag used a constant deceleration
(Coulomb friction), so coast distance was proportional to velocity².
Fast flicks flew way too far, slow flicks died instantly.
This switches to exponential velocity decay like `UIScrollView` on
iOS/macOS:
```
v(t) = v₀ · exp(-t / decay_time)
```
Coast distance is `v₀ · decay_time`, i.e. linear in release velocity.
Default `decay_time = 0.5 s`, matching
`UIScrollView.DecelerationRate.normal` (0.998/ms). Integration is exact
per frame, so the result is frame-rate independent.
| release velocity | before | after |
|---|---|---|
| 300 pt/s | 45 pt | 150 pt |
| 1000 pt/s | 500 pt | 500 pt |
| 2000 pt/s | 2000 pt | 1000 pt |
| 4000 pt/s | 8000 pt | 2000 pt |
The constants are exposed in the new `KineticScrollStyle` at
`Style::spacing.scroll.kinetic` (`decay_time`, `stop_distance`), with a
UI in the style settings. `decay_time = 0.0` disables kinetic scrolling.
Only affects drag-to-scroll (touch / mouse drag). Trackpad momentum on
macOS comes from the OS and is unaffected.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
With wasm threads, `DroppedFileHandle` wasn't `Send + Sync`, so neither
was `Context`, which holds the dropped files.
That broke `egui_extras`'s `http` loader and any code moving a `Context`
to another thread, and contradicts the `context_impl_send_sync` test.
`DroppedFileHandle` is `Send + Sync` everywhere again, and eframe wraps
the `web_sys::File` in a `SendWrapper` (new dependency, `send_wrapper`
0.6).
Checked: the command from the issue, the `check_wasm_atomics` CI
command, and the regular wasm32 build of `egui_demo_app`.
This partly reverts the design of #8354, cc @grtlr.
Fixes#8401
`egui_extras`' built-in highlighter (used when the `syntect` feature is
off, e.g. by `egui_commonmark` without `better_syntax_highlighting`) now
highlights `json` code blocks: strings, numbers, and the
`true`/`false`/`null` keywords.
This came up in the Rerun Viewer's agent panel, where JSON code blocks
rendered as plain text.
* [x] I have followed the instructions in the PR template
🤖 This PR was written by Claude, an LLM, on behalf of @emilk.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Broken out of #8617.
* `TextEdit::margin` now makes room for the stroke inside the margin
(like the theme does), so the stroke width changing on hover/focus no
longer causes a layout shift.
* `TextEdit::clip_text(false)` now expands the widget to make all text
visible, as documented, instead of being capped at `desired_width`.
* The default `TextEdit` inner margin is now `spacing.button_padding`,
and the theme gives `TextEdit` the same min height (`interact_size.y`)
as a `Button`, so they always have the exact same height (previously off
by 1px).
Tests added to `test_widget_heights.rs`: text edit included in the
matching-heights test (now run for several `interact_size.y` values),
size stable on hover/focus (with and without custom margin), and
unclipped text edit grows to fit text.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Closes <https://github.com/emilk/egui/issues/7837>
* [x] I have followed the instructions in the PR template
With `update_while_editing(false)`, the value of a `DragValue` is only
updated once editing is done, but `response.changed()` was still `true`
on every keystroke. While the widget is focused, its response is the
inner `TextEdit` response, and a `TextEdit` marks every text edit as a
change.
The fix clears that flag in the text-edit branch. The existing check at
the end of `DragValue::ui` already marks the response as changed when
the value actually changed, so `changed()` now means "the value
changed", in both modes. `Slider` and `RangeSlider` take their value
box's response via `union`, so they get the same fix.
Tests (in `egui_kittest/tests/regression_tests.rs`):
*
`drag_value_should_not_report_changes_while_typing_without_update_while_editing`:
typing `42` reports no change, and pressing Enter reports exactly one
change, with the value `42`. Without the fix, this fails with 2 changes
while typing and the value still at `0`.
*
`drag_value_should_report_changes_while_typing_with_update_while_editing`:
with the default setting, each keystroke still reports a change.
Fallback to `arboard` with `wayland-data-control` if `smithay` does not
find a text MIME type in the clipboard.
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Closes#8558
In debug builds, each `Id`/`IdSalt` stores its `Debug`-formatted source
chain. Using an `Id` as a salt copies its whole chain into the child.
`CollapsingHeader` does `ui.indent(header_id, …)`, where `header_id` is
derived from the parent `Ui` id, so the stored string doubles at every
level of nesting (≈640 kB at depth 11, and it keeps doubling).
The fix caps stored sources at 1024 bytes. It keeps the end, since that
is the most specific part.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Previously it was ignored since menu_style was applied within `Popup`
and the frame was created on the previous, unchanged outer ui.
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Follow-up to https://github.com/emilk/egui/pull/8621
`Ui::is_visible` is `false` for the rest of a pass once anything calls
`request_discard` (see `Context::will_discard`).
#8621 made invisible widgets not interested in focus, so a focused
widget drawn after any `request_discard` call would give up its focus,
and it stays lost because `Memory` persists across passes.
In Rerun this showed up as a focused list item losing focus whenever
some other part of the UI requested a discard.
This removes `w.visible` from `interested_in_focus`.
Invisible widgets are still hidden from accessibility, and their focus
is still not reported to AccessKit (the tree reports the root as focused
instead).
Added the regression test `keep_focus_in_discarded_pass`.
_This PR was written by Claude, an LLM, on behalf of @emilk._
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* [x] I have followed the instructions in the PR template
Adds `egui::Aligned`, a container that places its contents at a given
`Align2` within the available space of the parent `Ui`, e.g. in the
bottom-right corner.
Since the size of the contents isn't known up front, it remembers the
size from the previous pass. On the first pass the contents are added
invisibly and a new pass is requested with `request_discard`, so there
is no flicker.
```rust
egui::Aligned::new(egui::Align2::RIGHT_BOTTOM).show(ui, |ui| {
ui.label("Bottom right");
let _ = ui.button("Click me");
});
```
Like a `Panel`, `Aligned` reserves space in the parent `Ui` along its
main axis: if the contents are aligned to the end of that axis (e.g. the
bottom of a vertical `Ui`), widgets added afterwards go in the space
*before* them. So you can put something in the bottom-right corner and
keep adding widgets above it:
```rust
egui::Aligned::new(egui::Align2::RIGHT_BOTTOM).show(ui, |ui| {
let _ = ui.button("Bottom right");
});
ui.label("Placed above the button");
```
Rerun uses this to overlay the legend on a plot.
Extracted from Rerun's `re_ui::egui_ext` (where it is called `Group`).
Naming suggestions welcome.
Written by Claude (LLM).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* Closes <https://github.com/emilk/egui/issues/8620>
* [x] I have followed the instructions in the PR template
With `scene_rect = Rect::ZERO`, `fit_to_rect_in_scene` computed an
infinite scale. The default zoom range (max `1.0`) clamps that, but
`0.0..=f32::INFINITY` does not, so the translation became `center - ∞ *
0 = NaN`, which ended up as a NaN widget rect and tripped the debug
assert in `create_widget`.
We now fall back to a 1:1 scale when the computed scale is not finite
and positive. This also covers the auto-reset path when the scene
contents are empty.
Added a regression test.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add `BandShape` to epaint, supporting and varying width band along some
direction.
This can be useful in egui_plot, e.g. for filling the area under a
curve, or for visualizing a audio waveform, for instance.
The band has feathering for the fill, plus an optional stroke that is
just drawn on top of the fill.
This solves a small subset of non-convex polygons (since the general
solution is quite difficult, at least if you want feathered edges).
<img width="493" height="180" alt="Screenshot 2026-09-01 at 20 56 33"
src="https://github.com/user-attachments/assets/f79ae9bc-3512-4c87-b166-d1240a8dd3e4"
/>
Includes an interactive waveform demo and alpha screenshot coverage.
Related work:
- https://github.com/emilk/egui/issues/513
- https://github.com/emilk/egui_plot/pull/260
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
[performance] Avoid cross-viewport GalleyCache eviction
This changes `Fonts` to keep `GalleyCache` entries partitioned by
viewport.
Previously, multiple viewports shared one galley cache. Since each
viewport flushes the cache at the start of its pass, root and child
viewports could repeatedly evict each other's text layouts.
As viewport text workload grows, this can force repeated layout of large
text contents and cause severe performance degradation, with the frame
rate dropping below 10 FPS in some cases.
Font data and the texture atlas remain shared. Only layout caches are
separated by an opaque viewport namespace.
* Closes#5249
* Related #5836
* Related #7885
* Related #8284
* Closes#8419
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Follow-up to #8611. Passing `&mut &str` is how `egui_commonmark` (and
the docs) show selectable text; it cannot be typed into any more than
`interactive(false)` can, so it now gets the same read-only mark, and
`egui_kittest` asks no name of it.
Written by Claude (an LLM) for @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
A `Ui` gets its accessibility role from its `UiKind` (#8581). This lets
a caller pick another one, e.g. `Role::Alert` for a toast:
`Area::new(id).role(Role::Alert).accessible_name("Saved")`, or
`UiBuilder::new().accessibility_role(role)` for any `Ui`.
Rerun sets the toast role by reaching into the node from inside the `Ui`
today; @emilk asked for a builder method instead.
Written by Claude (an LLM) for @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
A non-interactive `TextEdit` (selectable text, e.g. the code blocks
`egui_commonmark` renders) now marks its node read-only, and the
`egui_kittest` check from #8589 leaves such fields alone: there is
nothing to type into, so nothing to reach by name.
Rerun was naming those code blocks "Code block" just to pass the check;
@emilk asked for this instead.
Written by Claude (an LLM) for @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Two ways to name every input a closure adds that has no accessible name
yet:
* `ui.label_inputs_by(label.id, |ui| …)`: after a row label, for
property rows and forms whose label is painted apart from its value
widgets, so the editors need not know the row label.
* `ui.name_inputs("Code block", |ui| …)`: a fixed name, for widgets that
cannot be named where they are built, e.g. the read-only `TextEdit`
`egui_commonmark` renders for a code block.
Only the widgets registered on the `Ui`'s layer during the closure are
inspected (the per-layer widget list is in creation order), so the cost
is one node lookup per widget added, not a walk over the whole tree per
call. Both are what #8589's check asks for and what Rerun does by poking
at `accesskit_state` from outside egui today.
`egui::accessibility::is_input(role)` decides which roles count, as an
exhaustive match over `accesskit::Role`; `egui_kittest` uses the same
function.
Written by Claude (an LLM) for @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Panel resize separators currently register no AccessKit content: screen
readers announce an empty node and cannot adjust the split (#8557). This
exposes the handle as a `Role::Splitter` (`WidgetType::ResizeHandle`)
labeled "Resize panel", with its orientation and the panel size as a
numeric value in `0..=1` of the available space.
AccessKit `Increment`/`Decrement`/`SetValue` requests on the handle are
translated into the same size-clamping path a pointer drag uses, and
`Increment` on a collapsed panel's grab handle expands the panel,
mirroring drag-to-expand. For headless testing, the `egui_kittest`
harness gains
`increment_accesskit`/`decrement_accesskit`/`set_value_accesskit` node
helpers. Tests assert the splitter node's label, orientation, numeric
bounds and supported actions, and verify that AccessKit actions move the
split.
Fixes#8557
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Generalizes #8602 from "no font loaded yet" to "nothing laid out yet
this pass": any font, provider, rasterizer or glyph-policy change made
before the first text of a pass takes effect in that pass, since nothing
is laid out with the old fonts.
#8602 missed the case where `default_fonts` is on: an app that installs
its own fonts during its first pass then laid that pass out with the
bundled fonts, and under `MissingGlyphPolicy::Panic` any glyph they lack
(Rerun's ⏎, on a Linux CI box with no system fonts) panics. New
`Fonts::used_since_begin_pass` is what the check reads.
Written by Claude (an LLM) for @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Follow-up to #8581, which gave every `Ui` a role. This adds the name:
`UiBuilder::accessibility_label` sets the label on the `Ui`'s node, and
`Area`, `Popup` and `Tooltip` take an `accessible_name` and pass it on.
A floating container can then be found by name
(`get_by_role_and_label(Role::Dialog, "Options")`) instead of by
reconstructing its node id. Rerun does that reconstruction today for its
modals, toasts and hover tooltips.
Written by Claude (an LLM) for @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
An app built without `default_fonts` starts with no font at all and
installs its own, often from inside its first pass (an `egui_kittest`
harness has no earlier hook).
Fonts used to apply at the start of the *next* pass, so that first pass
laid out every string with an empty family, which since #8601 panics
under `MissingGlyphPolicy::Panic`. Rerun's tests hit this on every
harness.
Nothing laid out before the first font arrives could have used one, so
applying immediately in that case has nothing to keep consistent. With
`default_fonts` on, nothing changes.
Regression test in `egui_kittest/tests/missing_glyphs.rs`.
Written by Claude (an LLM) for @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Adds `Rangef::union`: the smallest range containing both ranges, the
counterpart of `intersection`.
Needed for building min/max envelopes (e.g. audio waveforms) in Rerun,
where we currently spell it out as `Rangef::new(a.min.min(b.min),
a.max.max(b.max))`.
Written with Claude Code (an LLM), reviewed by @emilk.
* [x] I have followed the instructions in the PR template
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
A font family with no font at all used to lay out to an *empty galley*:
the run had no face to shape with, so it was dropped.
`Galley::clamp_cursor` on that empty galley returns 0, so a `TextEdit`
lost its cursor the frame after typing — text stayed, cursor jumped to
0, and e.g. completion popups never opened. Found in rerun's tests after
dropping `default_fonts`, where nothing installed a font for the bare
kittest harness.
### Changes
* epaint: a family without fonts now lays out **one synthetic tofu box
per grapheme cluster**, with metrics derived from the font size.
`glyphs.len() == char_count` and non-zero row heights hold even with no
font.
* epaint: new `MissingGlyphPolicy { Tofu, Panic }` on `Fonts`, consulted
only after every font, `FontProvider` and `GlyphRasterizer` had its
turn. Control characters (`\t`, `\n`, …) never panic, since fonts have
no glyphs for them. The panic names the character, the family and the
installed fonts.
* egui: `Context::set_missing_glyph_policy` / `missing_glyph_policy`.
* egui_kittest: **panics on a missing glyph by default**, since tofu in
a snapshot is easy to miss. Opt out with
`HarnessBuilder::allow_missing_glyphs()`. One demo test needed it (the
emoji completion popup lists emoji the bundled fonts lack).
Top: with fonts, U+10FFFD drawn with Ubuntu's `.notdef`. Bottom: the
same UI with `FontDefinitions::empty()`, all synthetic tofu (3× zoom):
<picture>
<img
src="https://static.rerun.io/tofu_cmp/1c2a567a1f53c301897e716452974a0b6fbc8e12/full.png"
alt="">
<source media="(max-width: 480px)"
srcset="https://static.rerun.io/tofu_cmp/1c2a567a1f53c301897e716452974a0b6fbc8e12/480w.png">
<source media="(max-width: 768px)"
srcset="https://static.rerun.io/tofu_cmp/1c2a567a1f53c301897e716452974a0b6fbc8e12/768w.png">
</picture>
Written by Claude (LLM) together with @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
`Context::add_glyph_rasterizer` appended a rasterizer and requested a
repaint on every call. Calling it from a setup path that runs each frame
piled up duplicates and kept the UI repainting forever (we hit this in
rerun's tests, where `apply_style_and_install_loaders` runs every frame
and the harness never settled).
* `GlyphRasterizer::new` now takes a mandatory `key`: adding a
rasterizer whose key is already installed is a no-op.
* `Context`/`Fonts`/`FontsImpl::add_glyph_rasterizer` only reload fonts,
clear caches and request a repaint when something actually changed.
`Fonts::add_glyph_rasterizer` returns whether it did.
* `SvgGlyph::into_rasterizer` is keyed by cluster, the web canvas
rasterizer by a fixed name.
Written by an LLM (Claude) together with @emilk.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* Stacked on #8581
**⚠️ Breaking ⚠️**
`egui_kittest` that every input widget (button, checkbox, slider, combo
box, text field, …) has an accessible name.
Opt out with `HarnessBuilder::with_accessibility_check(false)`, or run
it by hand with `Harness::check_accessibility`.
Running it over egui's own tests found real gaps, fixed here:
* An empty label (`checkbox(&mut b, "")`) took precedence over
`labelled_by`; now it is not set at all.
* `DragValue` is named after its prefix or suffix (it used to clear the
name).
* The color button has a name, with the color as its value.
* `TextEdit` lost its placeholder on frames where the selection changed.
* `Margin`, `CornerRadius` and the font-size slider name their inputs.
* The demos and kittest tests name their remaining inputs.
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
`WidgetRect::parent_id` used `Ui::id`, the stable id _scope_ shared by
sibling `Ui`s, while accesskit and `WidgetRect::id` use the per-`Ui`
`unique_id`. The `warn_if_rect_changes_id` debug check relies on
`parent_id` changing during a cascading id shift, but cascades propagate
through `unique_id`, not the scope id. So a parent's auto-id shifting
produced a false positive for every widget inside it.
Now `parent_id` is the parent's `unique_id`. Adds a regression test.
Known limitation: the child `Ui`'s own `WidgetRect` still warns in that
case, since its parent's id is genuinely unchanged. The heuristic cannot
tell that apart from a bug.
Found while working on:
* https://github.com/emilk/egui/pull/8542
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* [x] I have followed the instructions in the PR template
Adds `WidgetText::concat(style, parts)`, which joins several `RichText`s
into a single `WidgetText` (backed by a `LayoutJob`).
This is the easy way to get e.g. a label that is partly bold, or a label
with a small colored badge at the end, without manually building a
`LayoutJob` with `RichText::append_to`.
```rust
ui.label(WidgetText::concat(ui.style(), [
RichText::new("Normal, "),
RichText::new("strong, ").strong(),
RichText::new("and small").small(),
]));
```
Extracted from Rerun's `re_ui::egui_ext`.
Written by Claude (LLM).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
A DragValue cannot be held to a width while it is text-edited: the
TextEdit it builds for that state hardcodes clip_text(false), so the
widget grows to fit whatever has been typed and carries its layout with
it. A long entry can stretch a containing popup off-screen. range() does
not help, since it only applies once the edit commits.
clip_text(true) forwards to that TextEdit, so the widget keeps its width
and the text scrolls inside it, following the cursor. Defaults to false,
leaving existing behavior unchanged.
Example on egui.rs:
<img width="1418" height="696" alt="20260917-1900-19 6437910"
src="https://github.com/user-attachments/assets/4bc102ad-24e9-43ae-9e81-91c17a2c2c91"
/>
* Small fix; no corresponding issue created
* [X] I have followed the instructions in the PR template
Found while making the Rerun viewer navigable by accessible name:
floating containers were anonymous `Unknown`/`GenericContainer` nodes at
the root of the tree, and icon-only buttons with a tooltip had no name.
* `Ui`s get an accesskit role from their `UiKind`: panels are `Pane`,
modals and popups `Dialog`, menus `Menu`, tooltips `Tooltip`.
* Popups and tooltips hang under the widget that opened them
(`Area::accessibility_parent`, set through `Popup::anchor_widget`)
instead of floating at the root.
* Combo box popups are `ListBox`.
* `on_hover_text` sets the widget's accessible description, and its name
if it has none.
Drafted with Claude Code (an LLM), tests included.
* [x] I have followed the instructions in the PR template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Each `use foo::*` at the crate root is now spelled out, so it is obvious
what `egui` re-exports and where each name comes from.
In particular, `cargo doc -p egui` will now show all exported items
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Four `Context` methods dropped the font cache immediately:
```rust
pub fn add_glyph_rasterizer(&self, glyph_rasterizer: GlyphRasterizer) {
self.write(|ctx| {
ctx.glyph_rasterizers.push(glyph_rasterizer);
ctx.fonts = None; // ← even if we are mid-pass
});
}
```
Call any of them from inside a pass and the next text layout panics with
`No fonts available until first call to Context::run()`, or the
tessellator hits `.expect("No fonts loaded")`.
They now set a `reload_fonts` flag that `update_fonts_mut` acts on at
the start of the next pass, which is what `set_fonts` and `add_font`
already do, and each requests a repaint so the change still shows up
promptly.
Found in [Rerun](https://github.com/rerun-io/rerun): our style setup
calls `add_glyph_rasterizer` to draw a couple of glyphs from our own SVG
icons, and every `egui_kittest` test calls that setup inside its
`build_ui` closure. 592 tests on Linux and 590 on macOS died on those
two panics.
The new test fails on `main` with exactly that message and passes here.
* [x] I have followed the instructions in the PR template
Disclosure: this PR was written by Claude (an LLM).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
`update_accesskit_for_text_widget` unconditionally called
`builder.set_role`, so the selectable-label pass overwrote the role a
widget had already reported through its `WidgetInfo`. A `Link` came out
as `Role::Label`, indistinguishable from static text to a screen reader.
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
We want to be explicit when constructing `Id`s as `Id::unique`. `AsId`
was the old implicit way. For implicit parameters, use `impl AsIdSalt`
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>