-
Notifications
You must be signed in to change notification settings - Fork 222
refactor: enhance tree view layout zoom #2278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rol responsiveness Signed-off-by: Khushi Agrawal <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @khushiiagrawal. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
PTAL @btwshivam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses TreeView UI consolidation issues at low browser zoom levels (60% or lower) by implementing dynamic spacing calculations that scale with zoom. It also improves the ZoomControls component's responsiveness to prevent overflow on zoomed browser windows.
Key Changes:
- Enhanced TreeView layout with zoom-aware spacing that applies higher multipliers at compressed zoom levels (≤60%)
- Improved ZoomControls constraints using
min()CSS function to respect both viewport and container boundaries - Replaced hardcoded spacing values with calculated constants based on zoom level
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
frontend/src/components/treeView/hooks/useTreeViewData.ts |
Introduces base dimension constants and dynamic spacing calculations that scale with zoom, applying 3x horizontal and 2x vertical spacing at compressed zoom levels |
frontend/src/components/wds_topology/ZoomControls.tsx |
Updates maxWidth and maxHeight constraints to use min() function preventing overflow by respecting both viewport and container boundaries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@khushiiagrawal no not like this.. you can see it is rerendering and recalculating |
|
first.. MAke wds and wecs rank and node sepration same.. then export the existing rank, nod sepration then apply formlua. 2x or 3x on 60%.. now u got? |
|
zoom control is same for wds and wecs so you cant use constant height.. make both same and export the variable then apply formula. use memo u can use.. just ensure no rerendering.. no recalculation and smooth zooming out |
…moization Signed-off-by: Khushi Agrawal <[email protected]>
|
@btwshivam PTAL, i have removed the recalculation part as it shouldn't be there at first and yea it is very smooth now Screen.Recording.2025-12-12.at.12.01.59.AM.mov |
|
/ok-to-test |
|
Good Job.. this is exactly i was talking.. |
|
Just test ones with wecs tree.. upload a video then we can merge |
|
Layout recalculation is on every zoom change.. fix it.. it is causing performance issue |
|
dont recalulate implement Debounce zoom-based recalculation |
Signed-off-by: Khushi Agrawal <[email protected]>
Signed-off-by: Khushi Agrawal <[email protected]>
actually im unable to deploy any workload on wecs, even if i am deploy it doesn't show. happens every time. |
Create a binding policy |
|
@btwshivam PTAL. Screen.Recording.2025-12-13.at.6.15.19.PM.mov |
|
Looks good.. but same concern.. it is recalutating on evry zoom change, can u optimze performance.. removing caching can hurt performance with large graphs. |
@btwshivam should i keep a constant spacing or like same gaps between each node so that it doesn't have to recalculate ? zoom in and out will work as it is just it gaps will be constant throughout. |
Can you please check argocd treeview. how they are maintating and showing larger trees? |
Yess, try it.. i will recommend you to once check ArgoCD treeviw |
|
@btwshivam i checked argocd's implementation
What they do well:
|
|
okay try that.. |
|
container scale is fine but thiing is tree should be smartly structured into container. then only we can scale in or out |
|
Keep this work in this branch .. raise Another PR for that |
okay i'll do that |
|
/ok-to-test |
|
@khushiiagrawal please update with the latest changes ! |
Done! |
|
we are going with fixed node zoom.. thank you for this.. |
|
/close |
|
@btwshivam: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Description
This PR fixes the TreeView UI consolidation issue that occurs when the browser zoom level is set to 60% or lower. The fix implements dynamic spacing calculations that scale appropriately with zoom levels, ensuring proper node spacing and readability across all zoom ranges.
Additionally, this PR improves the ZoomControls component's responsiveness by fixing viewport-based constraints to prevent overflow issues on zoomed browser windows.
Related Issue
Fixes #2276
Changes Made
Enhanced TreeView layout calculations (
useTreeViewData.ts):BASE_NODE_WIDTH,BASE_NODE_HEIGHT,BASE_NODE_SEP,BASE_RANK_SEP)Improved ZoomControls responsiveness (
ZoomControls.tsx):maxWidthandmaxHeightconstraints to respect both viewport and container boundariescalc(100vw - ...)tomin(calc(100vw - ...), calc(100% - 16px))to prevent overflow on browser zoomChecklist
Please ensure the following before submitting your PR:
Screenshots or Logs (if applicable)
Screen.Recording.2025-12-10.at.12.48.34.PM.mov
Additional Notes