Skip to content

Pass in an explicit id in UiBuilder, to avoid wrapping passed in ids with Id::new() - #7925

Merged
lucasmerlin merged 2 commits into
mainfrom
lucas/ui-builder-id
Feb 24, 2026
Merged

lucasmerlin merged 2 commits into
mainfrom
lucas/ui-builder-id

Conversation

@lucasmerlin

Copy link
Copy Markdown
Collaborator

I was really confused why I couldn't find the response for my ui with explicit id. Turns out the id I passed in was wrapped by Id::new

@github-actions

github-actions Bot commented Feb 19, 2026

Copy link
Copy Markdown

Preview available at https://egui-pr-preview.github.io/pr/7925-lucasui-builder-id
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

@juancampa

juancampa commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Glad to see this.

Went through a long head scratcher today. Then wrote this assertion and started doubting my own sanity:

let ui = ui.new_child(UiBuilder::new().id(id));
assert!(id, ui.id()); <--- ❌

@emilk emilk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@emilk emilk added the bug Something is broken label Feb 24, 2026
@lucasmerlin
lucasmerlin merged commit e0bac4e into main Feb 24, 2026
47 of 48 checks passed
@lucasmerlin
lucasmerlin deleted the lucas/ui-builder-id branch February 24, 2026 10:07
Masterchef365 pushed a commit to Masterchef365/egui that referenced this pull request Apr 3, 2026
…s with Id::new() (emilk#7925)

I was really confused why I couldn't find the response for my ui with
explicit id. Turns out the id I passed in was wrapped by `Id::new`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken egui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants