Skip to content

feat(gpui): list the text painted in the inspector's last frame - #145

Merged
guyverino merged 1 commit into
masterfrom
feat/inspector-drawn-text
Nov 6, 2026
Merged

guyverino merged 1 commit into
masterfrom
feat/inspector-drawn-text

Conversation

@guyverino

Copy link
Copy Markdown
Collaborator

Summary

Window::inspector_hitboxes (#142) tells a tool what is on screen and where, but not what it reads. This adds Window::inspector_texts: every run of text painted in the last frame, with its bounds, content mask and the ids of the elements it was painted inside. A tool can then name a control by the words a person sees, in whichever language the window is drawn.

No effect on normal builds

  • The field, the method and both call sites are behind #[cfg(debug_assertions)], so a build without debug assertions compiles none of it.
  • With debug assertions on, a frame pays only for the is_inspector_picking check until the inspector is picking.
  • Picking already turns view caching off, so a frame never reuses text it did not paint and no replay is needed.

Test plan

  • cargo fmt -p moon-gpui -- --check
  • cargo test -p moon-gpui, with a new test: nothing is listed outside picking, and a label's path and origin are those of its control
  • MoonTerminal built against this branch with a local path override, in its normal and capture profiles; its scene run read control names from this list on 110 screens in 7 languages

Window::inspector_hitboxes says what is on screen and where, but not what
it reads, so a tool driving the application cannot name a control by its
words. Window::inspector_texts lists every painted run with its bounds and
the ids of the elements around it.

Filled under the same condition as the element map: debug_assertions and a
picking inspector. A build without debug assertions has neither the field
nor the calls.
@guyverino
guyverino merged commit 41c33cd into master Nov 6, 2026
4 checks passed
@guyverino
guyverino deleted the feat/inspector-drawn-text branch November 6, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant