Skip to content

Conversation

@khushiiagrawal
Copy link
Contributor

Description

This PR refactors the zoom controls panel in the WDS topology view to improve UX and accessibility. The main changes include:

  • Vertical Layout: Changed the control panel from horizontal to vertical orientation for better space utilization and visual hierarchy
  • Position Update: Moved the control panel from the left side to the right side of the viewport
  • Focus Behavior Fix: Removed unnecessary button focus outlines that were causing visual distractions after button clicks
  • Responsive Scaling: Added viewport-based proportional scaling to ensure controls adapt smoothly to different screen sizes

Related Issue

Fixes #2248

Changes Made

  • Updated ZoomControls.tsx to use vertical layout (flexDirection: 'column')
  • Refactored panel positioning from left to right side
  • Fixed button focus behaviors by removing focus outlines (outline: 'none' for :focus and :focus-visible)
  • Added responsive scaling system based on viewport height with min/max constraints

Checklist

Please ensure the following before submitting your PR:

  • I have reviewed the project's contribution guidelines.
  • I have written unit tests for the changes (if applicable).
  • I have updated the documentation (if applicable).
  • I have tested the changes locally and ensured they work as expected.
  • My code follows the project's coding standards.

Screenshots or Logs (if applicable)

Screen.Recording.2025-11-20.at.11.38.16.PM.mov

Additional Notes

Copilot AI review requested due to automatic review settings November 20, 2025 18:28
@kubestellar-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign onkar717 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
Copy link

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@kubestellar-prow kubestellar-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 20, 2025
@github-actions github-actions bot added frontend and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 20, 2025
Copy link
Contributor

Copilot AI left a 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 refactors the zoom controls panel in the WDS topology view, changing it from a horizontal layout positioned on the left to a vertical layout positioned on the right side. The changes improve visual hierarchy and add responsive scaling based on viewport height, while also removing focus outlines from buttons.

Key changes:

  • Vertical layout with right-side positioning for better space utilization
  • Responsive scaling system that adapts control sizes based on viewport height
  • Removal of focus outlines on buttons (:focus and :focus-visible)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@khushiiagrawal
Copy link
Contributor Author

/cc @clubanderson PTAL
thanks!

@kubestellar-prow
Copy link

@khushiiagrawal: GitHub didn't allow me to request PR reviews from the following users: PTAL.

Note that only kubestellar members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc @clubanderson PTAL
thanks!

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.

@khushiiagrawal
Copy link
Contributor Author

PTAL @kunal-511 @btwshivam
thanks!

@Per0x1de-1337
Copy link
Contributor

/ok-to-test

@Per0x1de-1337
Copy link
Contributor

the CI's are failing
@khushiiagrawal Could you check them again ?

@khushiiagrawal
Copy link
Contributor Author

the CI's are failing @khushiiagrawal Could you check them again ?

@Per0x1de-1337 I think this problem is not because of the PR, it's the issue with Helm Chart.
I have mentioned this on Slack last week

@btwshivam
Copy link
Contributor

@khushiiagrawal Too much lag and rendering. make it smooth. also test same with WECS

@khushiiagrawal
Copy link
Contributor Author

@khushiiagrawal Too much lag and rendering. make it smooth. also test same with WECS

@btwshivam i've made the rendering smoother and it works for WECS also.
Thanks!

Screen.Recording.2025-11-29.at.7.07.14.PM.mov

@clubanderson
Copy link
Contributor

@btwshivam can you advise on this?

@btwshivam
Copy link
Contributor

The whole screen is being zoomed in and out fix it. set refernce for treeview screen only not whole window.

@btwshivam
Copy link
Contributor

The useEffect that subscribes to rf.on('move', ...) and the RAF fallback uses many external values (rf, getViewport, getZoom, snapToStep, setZoom). dont left it empty

@btwshivam
Copy link
Contributor

i mean set minimum dependency.. also use usememo whereever the calculation is being done

@btwshivam
Copy link
Contributor

In the RAF fallback branch you set rafId and then requestAnimationFrame repeatedly. eensure the cleanup properly cancels rafId when the component unmounts or when branch conditions change. i mean this can memory leak

@khushiiagrawal
Copy link
Contributor Author

@btwshivam PTAL.
I’ve updated updated ZoomControls so scaling is based on the treeview container height (panel parent) instead of window.innerHeight, with a minimal non-empty useEffect dependency array and memoized calculations. In the RAF fallback I added an isCancelled guard plus cancelAnimationFrame(rafId) on cleanup, and clamped the panel with viewport-based maxHeight.
Thanks!

@Arpit529Srivastava
Copy link
Member

/ok-to-test

@kubestellar-prow kubestellar-prow bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Dec 4, 2025
@khushiiagrawal
Copy link
Contributor Author

@khushiiagrawal Test this with kunals PRs and upload a video

Screen.Recording.2025-12-09.at.2.29.37.AM.mov

@clubanderson
Copy link
Contributor

@btwshivam is this ready?

@btwshivam
Copy link
Contributor

@khushiiagrawal Again whole window getting zoomed in out

@btwshivam
Copy link
Contributor

told you to set reference

@khushiiagrawal
Copy link
Contributor Author

told you to set reference

@btwshivam i have set the reference for the for treeview screen as you asked

@khushiiagrawal
Copy link
Contributor Author

khushiiagrawal commented Dec 9, 2025

@khushiiagrawal Again whole window getting zoomed in out

@btwshivam isn't it because i am increasing and decreasing the screen size ?
PHOTO-2025-12-09-22-26-43

@btwshivam
Copy link
Contributor

btwshivam commented Dec 9, 2025

@khushiiagrawal Again whole window getting zoomed in out

@btwshivam isn't it because i am increasing and decreasing the screen size ?

hmm .. show me how it is behaving on zoom in out and why you are resizing the screen to show zoom in out
you should use zoom buttons

@khushiiagrawal
Copy link
Contributor Author

@khushiiagrawal Again whole window getting zoomed in out

@btwshivam isn't it because i am increasing and decreasing the screen size ?

hmm .. show me how it is behaving on zoom in out and why you are resizing the screen to show zoom in out you should use zoom buttons

i was showing the control panel behavior as it is responsive, i'll attach with the treeview zoom also

@khushiiagrawal
Copy link
Contributor Author

@khushiiagrawal Again whole window getting zoomed in out

@btwshivam isn't it because i am increasing and decreasing the screen size ?

hmm .. show me how it is behaving on zoom in out and why you are resizing the screen to show zoom in out you should use zoom buttons

Screen.Recording.2025-12-09.at.10.35.37.PM.mov

@btwshivam
Copy link
Contributor

looks good but have to figureout something for less then 60 zoom. it look consaliated

@btwshivam
Copy link
Contributor

btwshivam commented Dec 9, 2025

can you try one thing for me.. try passing a statement if zoom out is less then 60 then double the horizontal sepration and vertical sepration also.. use memo for recalculation

@khushiiagrawal
Copy link
Contributor Author

khushiiagrawal commented Dec 9, 2025

can you try one thing for me.. try passing a statement if zoom out is less then 60 then double the horizontal sepration and vertical sepration also.. use memo for recalculation

its done. PTAL /cc @btwshivam

Before

Screen.Recording.2025-12-09.at.11.46.23.PM.mov

After

Screen.Recording.2025-12-09.at.11.55.50.PM.mov

@btwshivam
Copy link
Contributor

Much better right..

@khushiiagrawal
Copy link
Contributor Author

Much better right..

yeah, right!

@btwshivam
Copy link
Contributor

no you are redifining node and rank sep again use existing... it will create problem for wecs and if someone change from canvas flow then also

@btwshivam
Copy link
Contributor

btwshivam commented Dec 9, 2025

ok then do one thing revet last commit -- 1 thing is wecs and wds node and ranksep should be same
2 thing incease vertical more and horizontal by little in original (should be same for wecs and wds)
then use the exising heights then use this 2x formula okay or u can use 3 for less then 60%(make 3x for hozizontal and 2x for vertical when less then 60 percent)
unstanding what i am tring to say??
do this in seprate PR and make a issue. we will merge this for now.. revert the last commit

@khushiiagrawal
Copy link
Contributor Author

ok then do one thing revet last commit

Okay @btwshivam , got your point. Will do it.
thanks!

@khushiiagrawal khushiiagrawal force-pushed the control-panel branch 2 times, most recently from 150afb8 to 245ea6a Compare December 9, 2025 19:44
@khushiiagrawal
Copy link
Contributor Author

@btwshivam , I have checked everything and now the branch is at the commit with you were expecting.
thanks!

@clubanderson
Copy link
Contributor

@btwshivam is this ready to go?

@btwshivam
Copy link
Contributor

yes merge it next will fix in next pR

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Merge in KubeStellar UI Project Dec 9, 2025
@kubestellar-prow kubestellar-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 9, 2025
@kubestellar-prow
Copy link

LGTM label has been added.

DetailsGit tree hash: 817ce3e05cfb4c5835814bcfa5c2c4ef680776a6

@btwshivam btwshivam merged commit 796f28d into kubestellar:dev Dec 9, 2025
23 of 27 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Merge to Done in KubeStellar UI Project Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE]: place control bar on right side of deployed and staged workload user interfaces

6 participants