Repository navigation
feat(viewer): highlight a layer's material from the element panel - #373
Merged
Merged
Conversation
Each layer row of a selected wall, floor, roof or ceiling is a toggle that lights up every element using that material, directly or as a layer. PanelLayers rows carry their material (index, name, element count), and material element counts include use in layer sets.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_abb99122-1756-4594-bca8-4426551816cd) |
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
In the viewer's element panel, each layer row of a selected wall, floor, roof or ceiling is now a toggle. It lights up every element using that layer's material, directly or as one of its layers. Its accessible name states the count: "Highlight the 7 elements using Masonry - Brick in the 3-D view".
Before this, a material highlight matched only
material_index, so layered elements, which carry their materials in a layer set (RE-58), never lit up.Checked in Chromium on the MIT tutorial house (local only). Selecting wall 166276 lists its five layers as toggles:
Clicking "Masonry - Brick" presses it and tints the 7 elements. There is no page error, and only the pressed row is tinted.
Changes
PanelLayer { label, value, material }replacesPanelRowinPanelLayers::rows;count_elements_using_materialcounts use in layer sets.layersGrouprenders each layer as a toggle;entityIndicesWithMaterialmatches layer sets;material_layer_setsandmaterial_layer_set_index..info-layer, with design-token colours and a pressed state.Testing
cargo +1.85.0 check.No tests were added.
Breaking changes
PanelLayers::rowsisVec<PanelLayer>(label, value, material) instead ofVec<PanelRow>.Related issues
Refs #355.
Note
Medium Risk
Changes the serialized panel API and shared material-highlight logic; incorrect layer-set matching could tint the wrong elements, but scope is viewer UI and read-only model traversal.
Overview
Layer rows in the element panel can now highlight every element that uses that material, including materials buried in compound wall/floor/roof/ceiling layers (RE-58), not only a direct
material_index.The Rust panel payload gains
PanelLayer(label,value, optionalPanelMaterial) in place of plainPanelRowonPanelLayers::rows, andcount_elements_using_materialcounts elements that reference the material directly or via any layer in their material layer set. The viewer mirrors that inentityIndicesWithMaterial, extends the in-memory model withmaterial_layer_sets/material_layer_set_index, and renders layers through a newlayersGroupwhere each known layer is a pressable row (styled.info-layer) that toggles the same 3-D tint as the main Material band. Docs and the changelog describe the API and behaviour.Breaking: consumers of
PanelLayers::rowsmust expectPanelLayerinstead ofPanelRow.Reviewed by Cursor Bugbot for commit 39bbd8a. Configure here.