GUI: Handle display controls for multiple loaded technologies (Web GUI)#10348
Conversation
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Code Review
This pull request implements a hierarchical layer management system, enabling the web interface to display and control layers organized by chiplet instances. It includes backend serialization of the chip hierarchy and a recursive frontend implementation for the layer tree and visibility controls. Feedback highlights the need for stable layer IDs based on instance names, the removal of redundant visibility checks, and a more consistent ID construction scheme to simplify fragile matching logic in the inspector.
|
|
||
| if (hierarchyNode.instances && hierarchyNode.instances.length > 0) { | ||
| hierarchyNode.instances.forEach((inst, idx) => { | ||
| const instId = `${parentId}_inst_${idx}`; |
There was a problem hiding this comment.
Using an index-based ID (inst${idx}) makes the layer visibility state dependent on the order of instances in the JSON and breaks compatibility with the instance_path used by the inspector. It is better to use the instance name provided in the hierarchy node to ensure stable and predictable IDs.
| const instId = `${parentId}_inst_${idx}`; | |
| const instId = parentId + "/" + (inst.name || idx); |
| if (app.layerModel && layer_id) { | ||
| const nodeId = instance_path ? `layers_parent_${instance_path}_${layer_id}` : layer_id; | ||
| // Check layerModel visibility | ||
| if (app.layerModel.isVisible && !app.layerModel.isVisible(nodeId) && !app.layerModel.isVisible(`layers_parent/${instance_path}/${layer_id}`) && !app.layerModel.isVisible(`layers_parent_${instance_path}/${layer_id}`) && !app.layerModel.isVisible(`layers_parent_${instance_path}/${layer_id}`) && !app.layerModel.isVisible(instance_path ? `${instance_path}/${layer_id}` : layer_id)) { |
There was a problem hiding this comment.
This condition contains a duplicate check for layers_parent_${instance_path}/${layer_id}.
Additionally, the logic relies on multiple guesses for the layer ID format (using both _ and / as separators). This is fragile and suggests that the ID scheme is not unified across the application. It is recommended to use a consistent ID construction method (e.g., always using / as a separator) in both display-controls.js and inspector.js to avoid this complex and error-prone matching logic.
| const id = name; | ||
| layer._nodeId = id; | ||
|
|
||
| const visible = !savedHiddenLayers.has(name) && !savedHiddenLayers.has(id); |
b2bf1ca to
756c2e2
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
756c2e2 to
7e59f70
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
7e59f70 to
e982c5e
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
|
fix #10208 |
fix #10209