agent-joule/crates/gpui/examples
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Charlot da8430783a Clear the workspace-wide lint debt left by the Rust 1.98 upgrade
`script/clippy` denies warnings, so a single failing crate takes the gate
down for everything that depends on it — which meant nobody was seeing
new lints either. Four passes, because each fix unblocks crates the
previous pass could not reach: 76 findings, then 32, then 11, then 5.

Most of it is mechanical and was applied from rustc's own
machine-applicable spans rather than by hand: 29 float literals needing an
explicit `f32` (a future-compat lint that becomes a hard error), redundant
references in format-family arguments, a `drain(..).collect()` that is
`mem::take`, a `clone` on a `Copy` type, manual `Option::filter`.

The rest needed reading. `quick_xml` renamed `unescape_value` to
`normalized_value`, which takes an XML version — `Implicit1_0` is the
right one, since SVG carries no declaration and that is precisely the
"assume 1.0" case the old method covered. `criterion::black_box` moved to
`std::hint`. `rand`'s `choose_multiple` is now `sample`. Protobuf
`from_i32` is `TryFrom`, taken as `try_from(..).ok()` where the caller
wanted an `Option` so the semantics do not shift.

One is deliberately not fixed. `open_ai`'s `RequestError` carries the
response `HeaderMap`, which is what makes the Err variant large; boxing it
is the real fix but the variant is built and matched across several
crates, so that is an API change and not something to slip into a lint
pass. It carries a scoped allow that says so.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-30 16:56:06 -04:00
..
image Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
svg Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
a11y.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
active_state_bug.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
anchor.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
animation.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
data_table.rs fix: finish the rand 0.10 migration across test-only targets 2026-07-20 10:47:50 -04:00
drag_drop.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
focus_visible.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
gif_viewer.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
gradient.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
grid_layout.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
hello_world.rs Clear the workspace-wide lint debt left by the Rust 1.98 upgrade 2026-08-30 16:56:06 -04:00
image_gallery.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
image_loading.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
input.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
layer_shell.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
list_example.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
mouse_pressure.rs Clear the workspace-wide lint debt left by the Rust 1.98 upgrade 2026-08-30 16:56:06 -04:00
move_entity_between_windows.rs Clear the workspace-wide lint debt left by the Rust 1.98 upgrade 2026-08-30 16:56:06 -04:00
on_window_close_quit.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
opacity.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
ownership_post.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
painting.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
paths_bench.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
pattern.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
popover.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
README.md Rebrand Zed -> Joule across UI, docs, embedded assets, and legal 2026-07-03 02:23:35 -04:00
scrollable.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
set_menus.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
shadow.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
tab_stop.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
testing.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
text.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
text_layout.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
text_wrapper.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
tree.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
uniform_list.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
window.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
window_positioning.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
window_shadow.rs Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00

GPUI Examples

Examples can be run from the Joule repository root:

cargo run -p gpui --example hello_world

Where to start

  • hello_world shows the basic shape of a GPUI application: create an Application, open a window, create a root view, and render a div.
  • input demonstrates text input, focus, selections, clipboard actions, and keyboard bindings.
  • uniform_list shows how to render a simple virtualized list.
  • testing demonstrates #[gpui::test], TestAppContext, actions, focus, and window-based tests.

Layout and styling

  • grid_layout demonstrates CSS-grid-style layout.
  • opacity demonstrates opacity styling.
  • pattern shows patterned backgrounds.
  • shadow demonstrates box shadows.
  • text shows styled text rendering.
  • text_layout demonstrates text alignment, decoration, weights, and wrapping.
  • text_wrapper shows wrapping text content.

Interaction

  • anchor demonstrates anchored positioning.
  • data_table combines virtualized list rendering with table-style rows and a custom scrollbar.
  • drag_drop shows draggable elements and drop targets.
  • focus_visible demonstrates keyboard-visible focus styling.
  • mouse_pressure demonstrates pressure-sensitive pointer input where supported.
  • popover shows floating layers with deferred and anchored.
  • scrollable demonstrates scrollable content.
  • tab_stop shows keyboard tab navigation.

Images, drawing, and animation

  • animation demonstrates GPUI animations and animated SVG transforms.
  • gif_viewer shows GIF rendering.
  • gradient demonstrates linear gradients and color spaces.
  • image shows local and remote image loading, image sizing, and asset setup.
  • image_gallery demonstrates image caching and loading remote images.
  • image_loading shows image loading states and asset loading.
  • painting demonstrates custom drawing with paths and canvas.
  • svg shows SVG rendering.

Windows and application behavior

  • move_entity_between_windows shows moving an entity between windows.
  • on_window_close_quit demonstrates quitting when a window closes.
  • set_menus shows application menu setup.
  • window demonstrates creating normal, dialog, popup, and floating windows.
  • window_positioning demonstrates window bounds and placement.
  • window_shadow demonstrates window shadow styling.

Specialized examples

These examples are useful when working on GPUI itself, but they may not be the best starting point for new applications:

  • active_state_bug is a focused active-state reproduction.
  • layer_shell demonstrates Linux layer-shell windows.
  • list_example demonstrates bottom-aligned list state and scrollbar behavior.
  • ownership_post supports the ownership and data-flow documentation.
  • paths_bench is a path rendering benchmark.
  • tree renders a deep tree of nested elements.