Commit Graph

193 Commits

Author SHA1 Message Date
Lucas Meurer eee824c0ac Rename egui_system_fonts to egui_system_font_provider (#8724)
The name egui_system_fonts is already taken on crates.io. The new name
matches the crate's `SystemFontProvider` type.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 17:24:04 +02:00
Emil Ernerfeldt dfe33185e4 Improve the fallback syntax highlighter in egui_extras (#8708)
Improes non-`syntect` highlighter in `egui_extras::syntax_highlighting`.

* `TokenType` is now public, with new `CodeTheme::format` and
`CodeTheme::format_mut`, so apps can match the colors to their own theme
* New `TokenType::Function`: an identifier directly followed by `(`
* `/* block comments */` for C, C++, JavaScript, JSON and Rust
* Backslash escapes in strings, so `"say \"hi\""` is one string
* `'single'`, `"""triple"""` and `'''triple'''` strings in Python and
TOML, `'char'` literals in C/C++, and `` `template` `` strings in
JavaScript
* New languages: JavaScript/TypeScript, shell (bash, sh, zsh) and YAML
* `jsonc` and `json5` are now highlighted as JSON

The demo snapshots are rendered with `--all-features`, which uses
`syntect`, so they are unaffected.
The new `egui_extras/tests/syntax_highlighting.rs` snapshot test covers
the fallback highlighter, run by a new CI step without `syntect`.

* [x] I have followed the instructions in the PR template

This PR was written by Claude Code (an LLM) on behalf of @emilk, and
needs a human review before leaving draft.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 06:49:32 +00:00
Leo Timmins da7169ed1a Fix egui-winit compilation on wasm32 (#8516)
Disclosure - AI written PR with GPT 6
I was unable to compile for wasm on my project because I use egui-winnit
instead of eframe

See AI explanation below:

## Summary

* Fixes #8436

`egui-winit` unconditionally compiled `NativeFile`, which implements
`DroppedFile::bytes()`. On wasm32, the trait requires `bytes_async()`
instead, causing compilation to fail.

This change gates the native file implementation and its usage to native
targets. An explicit wasm fallback ignores dropped-file events, which
winit’s web backend does not emit.

Adds a direct wasm compilation check to CI and the local check script,
since eframe’s wasm builds do not compile egui-winit.

## Validation

- wasm32 compilation with default features disabled passes.
- Native Linux/X11 compilation passes.
- Formatting and shell syntax checks pass.
- Strict wasm Clippy encounters six existing, unrelated warnings in
clipboard.rs.
2026-09-07 10:57:16 +02:00
Emil Ernerfeldt f161959d59 CI: run once per PR, and stop PR caches from evicting the main cache (#8507)
The `Run tests` job takes 9-12 minutes because it finds no cargo cache
and rebuilds all 390 crates; the last run that hit the cache took 4m20s
for the whole job. The repository holds 30 caches totalling 10.6 GB,
over the 10 GB limit, so entries are evicted constantly. Each PR saves
its own ~2.5 GB copy of every job cache, which pushes out the `main`
cache that every new PR starts from.

* `on: [push, pull_request]` ran the whole workflow twice for a PR from
a branch in this repo, doubling both runner time and cache writes. The
push half now only runs for `main`.
* Only `main` writes to the cargo cache (`save-if`). PRs still read it.
* New workflow deletes the caches of a PR when it is closed.

* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 09:51:25 +02:00
Emil Ernerfeldt f2de65f636 Render any glyph and colored emoji on native 🚀 (#8512)
Add full emoji support to eframe on native! Also supports any glyph that
your system fonts support.

Test string: ✨ We support ไทย, 한국어, and 🦀 🚀 🤖/🦾/📷/🎞️

Chain, in order, all merged into `emilk/emojis`:

* https://github.com/emilk/egui/pull/8491
* https://github.com/emilk/egui/pull/8492
* https://github.com/emilk/egui/pull/8493
* https://github.com/emilk/egui/pull/8508
* https://github.com/emilk/egui/pull/8509
* https://github.com/emilk/egui/pull/8510
* https://github.com/emilk/egui/pull/8511

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 08:27:50 +02:00
Emil Ernerfeldt 725ed5b523 Run all tests in CI even when a snapshot test fails (#8506)
Run the tests with `--no-fail-fast`, in CI and in `scripts/check.sh`.

`cargo test` stops after the first failing test target, so one failing
snapshot test in `egui_demo_app` hid the failing snapshots of every
later crate, and it took several CI rounds to collect all the new
snapshots. Now one run reports them all and uploads all `.new.png`
files, so one kitdiff pass is enough.

`egui_kittest` already collects all snapshot errors of a test in one
`SnapshotResults` and only panics when it is dropped, so no change is
needed there.

* [x] I have followed the instructions in the PR template

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 15:30:24 +00:00
Emil Ernerfeldt 35b069585d Add an LLM policy (#8458)
https://www.smbc-comics.com/comic/blame

---------

Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
2026-08-25 13:41:02 +00:00
Emil Ernerfeldt b730815797 Update MSRV from 1.92 to 1.95 (#8348)
No particular reason

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 08:37:03 +00:00
Aarni Koskela 3fcadda5ba Upgrade wgpu to v30 (#8289) 2026-07-20 11:07:29 +02:00
Lucas Meurer 68b74530b7 Release 0.35.0 - Inspection, egui_mcp, classes and improved IME (#8268) 2026-06-25 18:48:18 +00:00
Emil Ernerfeldt db87c712a1 Replace cargo machete with cargo shear (#8094)
We've had good experiences with `cargo shear` at Rerun
2026-04-13 17:48:43 +02:00
Emil Ernerfeldt ba9e0eb667 Add taplo-fmt CI step (#8095) 2026-04-13 11:57:34 +02:00
Emil Ernerfeldt bccd5f87bd Update wasm-bindgen to 0.2.108, and ehttp to 0.7.1 (#7996) 2026-03-23 12:33:41 +01:00
Lucas Meurer c09a8723b4 Fix vulnerability in the branch name check workflow (#7982)
Before, a crafted branch name could be used to exfiltrate the github
token and wreak havoc 😅
2026-03-17 17:08:18 +01:00
Lucas Meurer b3ffbca2ab Prevent snapshot update workflow to run on main (#7842)
Turns out if you don't give the gh workflow dispatch a ref it runs it on
main, oops
2026-01-13 11:39:53 +01:00
Jasper Riedel 661d5f9173 Update MSRV from 1.88 to 1.92 (#7793) 2025-12-20 13:52:34 +01:00
Emil Ernerfeldt 14bf7b74a3 CI: disable link checker (#7782) 2025-12-16 18:53:03 +01:00
Emil Ernerfeldt d53a4a9c1d Update docs to reflect that wgpu is the default renderer (#7719)
I missed a few parts when merging
* https://github.com/emilk/egui/pull/7615
2025-11-18 15:56:35 +01:00
Emil Ernerfeldt df6f35d568 eframe: add feature wgpu_no_default_features (#7700)
* Part of https://github.com/emilk/egui/issues/5889
* Closes https://github.com/emilk/egui/issues/7106

This changes the `eframe/wgpu` feature to also enable all the `default`
features of `wgpu` and `egui-wgpu`. This makes switching `eframe`
backend from `glow` to `wgpu` a lot easier.

To get the old behavior (depend on `wgpu` but you must opt-in to all its
features), use the new `wgpu_no_default_features` feature.
2025-11-12 10:51:38 +01:00
Lucas Meurer 30eb38ef45 Fix kitdiff links in pr comments (#7639)
The pr data is not accessible in this workflow so I have to hardcode the
url with the pr number
2025-10-23 10:06:37 +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
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 ac4e04d0b8 cargo upgrade (#7598) 2025-10-07 15:30:00 +02:00
Emil Ernerfeldt 0281b95bd9 CI: use latest typos (#7595) 2025-10-07 14:12:30 +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
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 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
Emil Ernerfeldt 472437a510 Small CI improvements (#7563) 2025-09-26 09:39:42 +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
Lucas Meurer 73c5892a4d Generate changelogs for emath (#7513)
Sometimes there are changes that only affect emath, so those should be
listed somewhere
2025-09-08 10:13:21 +02:00
Lucas Meurer d66fa63e20 Add reasonable timeouts to all workflows (#7499)
Turns out the default timeout for github actions is 6 hours (!). This PR
sets some reasonable default for all workflows, the ones invoking cargo
in some way are limited to 60 minutes and the remaining ones to
10-15mins.
2025-09-04 12:37:24 +02:00
Emil Ernerfeldt 5453cceded Use official cargo machete action (#7470) 2025-08-21 15:42:10 +02:00
Emil Ernerfeldt 531ead5ad1 Update MSRV to 1.86 (#7469) 2025-08-21 15:38:41 +02:00
Lucas Meurer 2c6611d0c6 Enable wgpu default features in eframe / egui_wgpu default features (#7344) 2025-08-05 21:21:00 +02:00
Emil Ernerfeldt 962c8e26a8 Update MSRV to 1.85 (#7279) 2025-06-30 13:43:27 +02:00
Piotr Podusowski 12cd35f48c Disallow accesskit on Android NativeActivity, making hello_android working again (#6855)
Follow up for https://github.com/emilk/egui/pull/6766

I wasn't sure if `compile_error` is appropriate. It felt right.
2025-05-18 13:17:28 +02:00
Emil Ernerfeldt d0876a1a60 Rename master branch to main (#7034)
For consistency with other repositories, i.e. so I can write `git
checkout main` without worrying which repo I'm browsing.
2025-05-08 09:15:42 +02:00
Emil Ernerfeldt ba70106399 Fix enforce_branch_name.yml 2025-05-06 10:25:02 +02:00
Emil Ernerfeldt f3611e3e5a Enforce that PRs are not opened from the 'master' branch of a fork (#6899)
## What
Fail all PRs that are opened from the master/main branch of the fork.

## Why
PR:s opened from the `master` branch cannot be collaborated on. That is,
we maintainers cannot push our own commits to it (e.g. to fix smaller
problems with it before merging).

## How
Untested code straight from Claude 3.7 😅
2025-04-30 14:10:59 +02:00
TÖRÖK Attila fdb9aa282a Raise MSRV to 1.84 (#6848)
Prerequisite of https://github.com/emilk/egui/pull/6744.
See: https://github.com/gfx-rs/wgpu/pull/7218,
https://github.com/gfx-rs/wgpu/pull/7425

Please be aware that Rust 1.84 enables some (more) WASM extensions by
default, and ships with an `std` built with them enabled:
https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features/
According to `rustc +1.84 --print=cfg --target wasm32-unknown-unknown`,
these are: `multivalue`, `mutable-globals`, `reference-types`, and
`sign-ext`.
(c.f. `rustc +1.84 --print=cfg --target wasm32-unknown-unknown -C
target-cpu=mvp` enabling none.)
For reference: https://webassembly.org/features/

----

If support is desired for ancient/esoteric browsers that don't have
these implemented, there are two ways to get around this:
- Target `wasm32v1-none` instead, but that's a `no-std` target, and I
suppose a lot of dependencies don't work that way (e.g.
https://github.com/gfx-rs/wgpu/issues/6826)
- Using the `-Ctarget-cpu=mvp` and `-Zbuild-std=panic_abort,std` flags,
and the `RUSTC_BOOTSTRAP=1` escape hatch to allow using the latter with
non-`nightly` toolchains - until
https://github.com/rust-lang/wg-cargo-std-aware is stabilized. (For
reference:
https://github.com/ruffle-rs/ruffle/pull/18528/files#diff-fb2896d189d77b35ace9a079c1ba9b55777d16e0f11ce79f776475a451b1825a)

I don't think either of these is particularly advantageous, so I suggest
just accepting that browsers will have to have some extensions
implemented to run `egui`.
2025-04-24 17:00:29 +02:00
TÖRÖK Attila 3dd8d34257 CI: Install wasm-opt 123 from the GitHub release of Binaryen (#6849)
* Prerequisite of https://github.com/emilk/egui/pull/6848
2025-04-24 15:39:01 +02:00
Lucas Meurer d78fc39386 Use lychee link checker instead of linkinator (#5868)
Seems like linkinator doesn't find any files:
https://github.com/emilk/egui/pull/5853#issuecomment-2765526298

This will check all links in .md files (except CHANGELOG.md) and in toml
files
2025-04-03 09:26:49 +02:00
lucasmerlin 26288d7dd7 Fix preview build failing (#5756)
The preview build randomly started failing:

https://github.com/emilk/egui/actions/runs/13633368357/job/38106240555?pr=5755
2025-03-03 17:08:54 +01:00
lucasmerlin 40bf21728d Move gifs to git lfs (#5706)
Since we moved pngs to lfs I think we should also move the gifs there.

* [x] I have followed the instructions in the PR template
2025-03-03 15:51:43 +01:00
Nicolas 0521caed2e Fix Cargo-Machete Workflow (#5745)
As cargo machete now uses rust edition2024 we cannot use the older rust
version - we need to install the newest on the runner

* [ ] I have followed the instructions in the PR template

---------

Co-authored-by: lucasmerlin <lucasmeurer96@gmail.com>
2025-02-27 15:24:10 +01:00
lucasmerlin b8051cc301 Add SnapshotResults struct to egui_kittest (#5672)
I got annoyed by all the slightly different variations of "collect
snapshot results and unwrap them at the end of test" I've written, so I
added a struct to make this nice and simple.

One controversial thing: It panics when dropped. I wanted to ensure
people cannot forget to unwrap the results at the end, and this was the
best thing I could come up with. I don't think this is possible via
clippy lint or something like that.

* [x] I have followed the instructions in the PR template
2025-02-04 14:01:32 +01:00
Emil Ernerfeldt 7d87acb5fa Remove dead code from CI 2025-01-29 08:43:18 +01:00