Commit Graph

4061 Commits

Author SHA1 Message Date
Lucas Meurer 32336e260b
Write .new.png file if snapshot is missing (#7610)
We should write the .new.png whenever the test fails and snapshots
aren't updated. Necessary for the kitdiff-snapshot-update-workflow to
work
2025-10-09 09:15:18 +02:00
Emil Ernerfeldt 9e13889589
Revert wasm-bindgen to 0.2.100 (#7612) 2025-10-09 08:56:33 +02:00
Lucas Meurer 917aaca991
Use custom github token for commiting snapshots (#7611)
... to ensure that workflows are run
2025-10-08 17:49:29 +02:00
Emil Ernerfeldt 94f2ed6334
Do not lock wasm-bindgen version (#7609) 2025-10-08 17:09:04 +02:00
Emil Ernerfeldt 47a437403f
Use software texture filtering in kittest (#7602) 2025-10-08 16:24:02 +02:00
Lucas Meurer 718a82b013
`Harness`: Add `remove_cursor`, `event` and `event_modifiers` (#7607)
* Closes https://github.com/emilk/egui/issues/7591
2025-10-08 13:47:00 +02:00
Emil Ernerfeldt 4d4f90eb31
kittest: No `debug_open_snapshot` on wasm (#7606) 2025-10-08 11:47:34 +02:00
Lucas Meurer 3fdc5641aa
Group AccessKit nodes by `Ui` (#7386)
* closes https://github.com/emilk/egui/issues/5674

This changes egui to create an AccessKit node for each `Ui`. I'm not
sure if this alone will directly improve accessibility, but it should
make it easier to create the correct parent / child relations (e.g.
grouping menus as children of menu buttons).
Instead of having a global stack of parent ids, they are now passed via
a parent_id field in `UiBuilder`.

If having all these `GenericContainer` nodes somehow is bad for
accessibility, the PR could also be changed to only create nodes if
there is actually some accessibility info with it (the relevant is
currently commented-out in the PR). But I think screen readers should
just ignore these nodes, so it should be fine? We could also use this as
motivation to git red of some unnecessary wrapped `Ui`s, e.g.
CentralPanel creates 3 Uis when 2 should be enough (the initial Ui and a
Frame, maybe we could even only show the `Frame` if we can give it an
UiBuilder and somehow show the Frame with `Ui::new`).

Here is a screenshot from the accessibility inspector
(https://github.com/emilk/egui/pull/7368) with this PR:

<img width="431" height="744" alt="Screenshot 2025-07-24 at 12 09 55"
src="https://github.com/user-attachments/assets/6c4e5ff6-5c38-450e-9500-0776c9018d8c"
/>

Without this PR:


https://github.com/user-attachments/assets/270e32fc-9c7a-4dad-8c90-7638c487a602
2025-10-08 11:30:32 +02:00
Emil Ernerfeldt 6a49c9ad6b Unwind minimum home version 2025-10-08 10:44:44 +02:00
Emil Ernerfeldt 0d47abcaa0
Better docs + deprecation for screen/content/viewport_rect (#7605) 2025-10-08 10:43:11 +02:00
Lucas Meurer c3c08fa38a
Fix preview build on contributor PRs (#7597)
- I broke this in #7577 

`pull_request` workflows don't have permission to comment, so we have to
do this via a `pull_request_target` workflow.

The point of this early comment is that the kitdiff link appears as soon
as possible and isn't dependent on the preview build suceeding.
2025-10-08 10:20:12 +02:00
Emil Ernerfeldt 683214bfe8
Add kittest snapshot test of italics (#7603) 2025-10-07 17:22:31 +02:00
Emil Ernerfeldt 9cb4e6a54e
Create `egui_wgpu::RendererOptions` (#7601) 2025-10-07 17:06:23 +02:00
Emil Ernerfeldt 56b1def064
Update to the latest dependencies (#7599) 2025-10-07 16:26:13 +02:00
Emil Ernerfeldt 86dc9ea64e
Inline log format args (#7600) 2025-10-07 16:14:43 +02:00
Emil Ernerfeldt ac4e04d0b8
`cargo upgrade` (#7598) 2025-10-07 15:30:00 +02:00
Emil Ernerfeldt 843ceea90c
Use more workspace dependencies (#7596) 2025-10-07 15:07:16 +02:00
Lucas Meurer 7fc80d8623
Accessibility inspector plugin (#7368)
Adds an accessibility inspector plugin that shows the current AccessKit
tree:


https://github.com/user-attachments/assets/78f4f221-1bd2-4ce4-adf5-fc3b00f5c16c

Macos has a built in accessibility inspector, but it doesn't seem to
work with AccessKit / eframe so this provides some insight into the
accesskit state.

This also showed a couple issues that are easy to fix:
- [ ] Links show up as `Label` instead of links
- [ ] Not all supported actions are advertised (e.g. scrolling)
- [ ] The resize handles in windows shouldn't be focusable
- [ ] Checkbox has no value
- [ ] Menus should have the button as parent widget (not 100% sure on
this one)


Currently the plugin lives in the demo app, but I think it should be
moved somewhere else. Maybe egui_extras?

This could also be relevant for #4650
2025-10-07 14:39:49 +02:00
Lucas Meurer d83f4500a3
Add `Harness::debug_open_snapshot` helper (#7590)
Adds a helper to quickly see whats going on in a kittest test.

Not all test have snapshots, but when debugging tests it might still be
useful to see whats actually going on, so this adds a helper fn that
renders a snapshot image to a temporary file and opens it with the
default image viewer:



https://github.com/user-attachments/assets/08785850-0a12-4572-b9b5-cea36951081c
2025-10-07 14:39:22 +02:00
Emil Ernerfeldt ab461f4115
Fix eframe window not being focused on mac on startup (#7593)
* Workaround for https://github.com/rust-windowing/winit/issues/4371
* Closes https://github.com/emilk/egui/issues/7588

Tested manually
2025-10-07 14:21:10 +02:00
Emil Ernerfeldt 78fffc7707
clean up the clippy.toml:s (#7594) 2025-10-07 14:12:51 +02:00
Emil Ernerfeldt 0281b95bd9
CI: use latest typos (#7595) 2025-10-07 14:12:30 +02:00
Ian Hobson 30277233ce
Add support for the safe area on iOS (#7578)
This PR is a continuation of #4915 by @frederik-uni and @lucasmerlin
that introduces support for keeping egui content within the 'safe area'
on iOS (avoiding the notch / dynamic island / menu bar etc.), with the
following changes:

- `SafeArea` now wraps `MarginF32` and has been renamed to
`SafeAreaInsets` to clarify its purpose.
- `InputState::screen_rect` is now marked as deprecated in favour of
either `viewport_rect` (which contains the entire screen), or
`content_rect` (which is the viewport rect with the safe area insets
removed).
- I added some comments to the safe area insets logic pointing out the
[safe area API coming in winit
v0.31](https://github.com/rust-windowing/winit/issues/3910).

---------

Co-authored-by: frederik-uni <147479464+frederik-uni@users.noreply.github.com>
Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-10-07 12:30:09 +02:00
Lucas Meurer 65249013c4
Fix stuck menu when submenu vanishes (#7589)
* Closes https://github.com/rerun-io/rerun/issues/11301

This fixes a bug where a menu could get stuck, not closing at all, when
the currently open submenu stops being shown.
I also added a way to reproduce this to the demo, as well as a test
ensuring that there is no race condition in the fix.
2025-10-07 10:16:35 +02:00
Lucas Meurer f0faacc7d1
Add workflow to accept snapshots via kitdiff (#7577)
This adds a new workflow `update_kittest_snapshots.yml` that can be
triggered through the [kitdiff](https://github.com/rerun-io/kitdiff) ui
when viewing a ci artefact.
Also adds a link to kitdiff to view the pr changes to each commit (via
the preview build comment)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-06 15:57:31 +02:00
Andreas Reich f6fe3bff18
Increate wgpu kittest wait timeout (#7585) 2025-10-03 13:05:50 +02:00
Andreas Reich 427c0766fd
Update wgpu to 27.0.0 (#7580) 2025-10-03 09:54:46 +02:00
Emil Ernerfeldt 096ed1c0cb
Replace cargo check with cargo clippy on ci (#7581)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-02 20:19:23 +02:00
Emil Ernerfeldt 6579bb910b
Remove `log` feature (#7583) 2025-10-02 20:09:48 +02:00
Emil Ernerfeldt bd45406fad
Use a lot more let-else (#7582) 2025-10-02 19:47:00 +02:00
Andreas Reich 4c1f344ef8
Update MSRV from 1.86 to 1.88 (#7579)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-10-02 19:12:29 +02:00
Isse 0888e3dc86
Add `Ui::take_available_space()` helper function, which sets the Ui's minimum size to the available space (#7573)
A shorthand, and more descriptive version of calling
`ui.set_min_size(ui.available_size())`, and mentions this on panel's
resizable functions.
2025-10-01 14:39:32 +02:00
Emil Ernerfeldt 18ea9ff0bd
Warn if `DYLD_LIBRARY_PATH` is set and we find no wgpu adapter (#7572)
Co-authored-by: Andreas Reich <andreas@rerun.io>
2025-09-30 15:56:04 +02:00
Emil Ernerfeldt 4fb4072ce8
Adjust when we write .diff and .new snapshot images (#7571) 2025-09-30 15:51:46 +02:00
Tye a450b1c989
Properly end winit event loop (#7565) 2025-09-30 15:48:54 +02:00
Lucas Meurer 47c5617740
Return `0.0` if font not found in `glyph_width` instead of panic (#7559) 2025-09-30 10:12:56 +02:00
Emil Ernerfeldt 5ee88da61c
kittest: Format errors with `Display` (#7569) 2025-09-30 08:24:21 +02:00
Emil Ernerfeldt e9898e4932
Improve error message when failing to run egui_demo_app (#7567) 2025-09-29 11:12:03 +02:00
Emil Ernerfeldt 4683d91653
Small clippy fixes (#7566) 2025-09-27 12:14:47 +02:00
Emil Ernerfeldt 472437a510
Small CI improvements (#7563) 2025-09-26 09:39:42 +02:00
TÖRÖK Attila b69bab73e1
Fix build error in egui-winit with profiling enabled (#7557) 2025-09-23 14:57:43 +02:00
Lucas Meurer a73f2c356f
Add text edit rtl regression test (#7524) 2025-09-23 11:56:32 +02:00
Fangdun Tsai b36a259d47
Update accesskit to 0.21.0 (#7550) 2025-09-23 11:42:59 +02:00
Gijs de Jong 48d903d879
Include popups and tooltips in `Harness::fit_contents` (#7556)
This makes `Harness::fit_contents` also use popups and tooltips to
compute the size of the contents.
2025-09-23 11:03:30 +02:00
Lucas Meurer 9150b9342d
Make individual egui_extras image loaders public (#7551)
This was initially a PR to add kitdiff, but this now lives in it's own
crate: https://github.com/rerun-io/kitdiff

I needed to make the image loaders public, this way it's possible to
compose image loaders together (which allowed me to create a image diff
loader that uses two other image loaders). But you can't use the
`ctx.try_load_image` since that would deadlock, so you have to store a
reference to the other loader in the wrapping loader.
2025-09-23 10:07:18 +02:00
Kumpelinus c97c065a57
Update wgpu to 26 and wasm-bindgen to 0.2.100 (#7540)
Co-authored-by: TÖRÖK Attila <torokati44@gmail.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-09-21 20:42:00 +02:00
Emil Ernerfeldt 6ac155c5cd
eframe web: prevent default action on command-comma (#7547) 2025-09-17 08:12:50 +02:00
Emil Ernerfeldt 603dba29e6
Add snapshot test for text spacing/kerning (#7545) 2025-09-16 13:30:28 +02:00
Lucas Meurer f2f00ef62a
New Plugin trait (#7385)
This adds a new `Plugin` trait and new `input_hook` and `output_hook`
plugin fns. Having a `Plugin` trait should make it easier to store state
in the plugin and improve discoverability of possible plugin hooks.

The old `on_begin_pass` and `on_end_pass` have been ported to use the
new plugin trait, should we deprecate them?
2025-09-16 10:55:58 +02:00
Emil Ernerfeldt 226bdc4c5b
0.32.3 release: Bump version numbers and update changelog (#7536) 2025-09-12 08:18:19 +02:00