Skip to content
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

Remove automatically scrolling into view functionality #1646

Merged

Conversation

DaoDaoNoCode
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode commented Aug 8, 2023

Closes #1545

Description

The div will automatically scroll into view because we added that feature somehow. But I think it's not needed because users can always scroll the screen by themselves, auto-scroll will only destroy some of the layouts and behaviors and cause unexpected results.

@kywalker-rh Could you confirm this?
The context: When you click on Deployed models on project details page, it will expand the models table, and the page will scroll to show the whole table. However, this auto scroll could cause problems. So I removed it, no when clicking on Deployed models, the page will not auto scroll anymore. Is that acceptable?

How Has This Been Tested?

Follow the same instructions in the issues, you will find the issue disappeared.

Test Impact

N/A, layout issue.

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit tests & storybook for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@kywalker-rh
Copy link

@vconzola - Can you take a look at this? I think you were the one that worked on the design originally.

@vconzola
Copy link

vconzola commented Aug 9, 2023

@DaoDaoNoCode I was the one who requested the auto-scroll. The reason it was added is that when a user deploys a model the only feedback they get today is that the number of deployed models in the model server row increments by one. (I thought that the row was supposed to auto-expand to show the deployed models in the row expansion, but it doesn't appear this was implemented, or it was implemented and later removed. I swear it used to do that, but doesn't anymore.)

So we need a way to make it more obvious that a model was deployed. My thought was that if we auto-scrolled to the row expansion for deployed models the newly deployed model would be easily visible. If this is a problem from a code perspective, we need to figure out another solution for making newly deployed models visible.

@DaoDaoNoCode
Copy link
Member Author

@vconzola I can make the auto expand happen when you newly deploy a model.
What this PR is trying to fix is actually another issue, which is when you expand the deployed model section, it will scroll to the bottom of the page because we want it to show the whole model table. However, this is problematic because the auto scroll to the bottom can cause layout issues. What I am asking is, do we still need the auto-scroll? Can we remove it?
This is the expected behavior after the fix: When users deploy the model, the Deployed models section will automatically expand, but it will not cause any auto-scroll of the page, you may only be able to see half of the table and you can scroll down to see the whole table. Do you think it's acceptable?

@vconzola
Copy link

vconzola commented Aug 9, 2023

@DaoDaoNoCode The problem I was seeing before is that even with auto-expand when a new model was deployed the expansion area was displayed "below the fold" so the user didn't see it without scrolling and therefore didn't know the model was deployed. Can we do any sort of auto-scrolling to ensure the expansion is visible without the user needing to manually scroll? Or is auto-scrolling in general not an option?

@DaoDaoNoCode
Copy link
Member Author

@vconzola Let me give it a try.

Copy link
Contributor

@lucferbux lucferbux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

mmmm so the issue was that every re-render we were scrolling again to the element right? how curious 🤔

@DaoDaoNoCode
Copy link
Member Author

@lucferbux Haha I guess it was me who wrote this erroneous functionality... But I cannot recall what I was thinking at that time 🤷‍♂️

@Gkrumbach07
Copy link
Member

/lgtm

Working on my end and code looks good

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: Gkrumbach07, lucferbux

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

The pull request process is described here

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

@openshift-merge-robot openshift-merge-robot merged commit d61c590 into opendatahub-io:main Aug 11, 2023
3 checks passed
Comment on lines +62 to +64
<ScrollViewOnMount
shouldScroll={activeColumn === ServingRuntimeTableTabs.DEPLOYED_MODELS}
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why you didn't just unmount it...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I totally forgot I could unmount it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Dashboard keeps scrolling to bottom of project when Models Tab is expanded.
7 participants