Repository navigation
fix(menu): check mark for layer targets of toggle_layer_render - #214
Merged
Merged
Conversation
The flag lookup matched surface ids only, so a row toggling a layer stayed unchecked even while that layer was drawing. Resolve the target in the surface the menu was opened from, which is where the action itself toggles it, and report that layer live render state. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CodeZeno
added a commit
that referenced
this pull request
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toggle_layer_rendertarget is a layer never showed a check mark, even while that layer was drawing.context_menu_action_flagsresolved the target againsttheme.surfacesonly, socheckedstayedfalsefor every layer target.execute_context_menu_actionrunstoggle("<target>", render)throughexecute_mouse_action_sourcein the surface the menu was opened from, where layers do resolve. So the row toggled the layer correctly but reported no state back.toggle_layer_render_stateso it can be covered without window state. No behaviour change fortoggle_provider,toggle_widget, or surface targets.To reproduce before the fix: give a theme a menu row with
{"type": "toggle_layer_render", "target": "<layer id>"}. Clicking it shows and hides the layer, but the row is never checked, unlike atoggle_providerrow.Testing
Windows 11, Rust 1.95.0 (MSVC), release profile:
cargo fmt --all -- --check— clean.cargo build --locked --release— success.cargo test --locked --release— 619 passed, 0 failed, 6 ignored.window::window_context_menu::tests::a_layer_toggle_row_reports_the_layer_state_a_surface_row_already_reported: a surface id still reports the surface, a visible layer id now reportsSome(true), the same layer withrender = 0reportsSome(false), and an unknown id reportsNone. It usesThemeDocument::starter()and no credentials or live provider requests.toggle_providerrow next to them is unaffected.Checklist
🤖 Generated with Claude Code