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>
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>
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.
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>
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>
* 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.
- 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.
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>
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.
## 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 😅
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>
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