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

fix: reset Model Registry page number on pageload [ET-640] #9876

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

EmilyBonar
Copy link
Contributor

@EmilyBonar EmilyBonar commented Aug 28, 2024

Ticket

ET-640

Description

Resets the user setting of tableOffset on page load. I investigated more elegant ways to solve this, such as removing tableOffset from the settings config and only storing it in the URL params, but InteractiveTable and useSettings are tightly coupled enough that it would take a not-insignificant refactor to do so.

Test Plan

  • Go to Model Registry page
  • Use the Pagination component to change the table page number
  • Navigate away from Model Registry page
  • Navigate back to Model Registry page
  • Confirm that the table is on its first page, not the one you navigated to in the second step

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

@EmilyBonar EmilyBonar requested a review from ashtonG August 28, 2024 20:11
@EmilyBonar EmilyBonar requested a review from a team as a code owner August 28, 2024 20:11
@cla-bot cla-bot bot added the cla-signed label Aug 28, 2024
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Project coverage is 50.55%. Comparing base (2b1856a) to head (b69dddd).
Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
webui/react/src/components/ModelRegistry.tsx 0.00% 34 Missing ⚠️
...bui/react/src/components/ModelRegistry.settings.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9876      +/-   ##
==========================================
- Coverage   54.70%   50.55%   -4.16%     
==========================================
  Files        1261      938     -323     
  Lines      156013   126685   -29328     
  Branches     3588     3589       +1     
==========================================
- Hits        85348    64041   -21307     
+ Misses      70533    62512    -8021     
  Partials      132      132              
Flag Coverage Δ
harness ?
web 54.46% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...bui/react/src/components/ModelRegistry.settings.ts 0.00% <0.00%> (ø)
webui/react/src/components/ModelRegistry.tsx 0.00% <0.00%> (ø)

... and 323 files with indirect coverage changes

Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit b69dddd
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66d1fe9a5fc425000893e233
😎 Deploy Preview https://deploy-preview-9876--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ashtonG
Copy link
Contributor

ashtonG commented Aug 29, 2024

you should be able to:

  1. remove the page offset from the setting schema
  2. create a new schema that is just the tableOffset (maybe io.exact({ tableOffset: io.number }), which would strip extra properties from the input/output), and use useTypedParams to handle reading and writing to the parameters
  3. create a type representing the intersection between your settings schema and the new schema together
  4. wrap updateSettings in a function that takes that intersection and passes the resulting settings object to both the original updateSettings and the updateParams from useTypedParams.

without doing major refactoring.

Copy link
Contributor

@ashtonG ashtonG left a comment

Choose a reason for hiding this comment

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

for posterity, see previous comment

@EmilyBonar EmilyBonar requested a review from ashtonG August 30, 2024 14:37
Copy link
Contributor

@ashtonG ashtonG left a comment

Choose a reason for hiding this comment

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

LGTM, just picked a few nits.

webui/react/src/components/ModelRegistry.settings.ts Outdated Show resolved Hide resolved
webui/react/src/components/ModelRegistry.tsx Outdated Show resolved Hide resolved
webui/react/src/components/ModelRegistry.tsx Outdated Show resolved Hide resolved
webui/react/src/components/ModelRegistry.tsx Outdated Show resolved Hide resolved
@EmilyBonar EmilyBonar merged commit 61fd26b into main Aug 30, 2024
82 of 95 checks passed
@EmilyBonar EmilyBonar deleted the emilybonar/model-registry-page branch August 30, 2024 18:14
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.

2 participants