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

Handle FileSummary rendering using local state #359

Open
nozomione opened this issue Sep 6, 2024 · 0 comments · May be fixed by #365
Open

Handle FileSummary rendering using local state #359

nozomione opened this issue Sep 6, 2024 · 0 comments · May be fixed by #365
Assignees

Comments

@nozomione
Copy link
Member

nozomione commented Sep 6, 2024

Context

Epic: #358

Currently, when a user changes the download options for regenerating a dataset, a new dataset ID is generated.

This ID is then used to update the File Summary section UI (in green) and for the dataset download via API requests.

We want to streamline this process by handling the File Summary section UI updates using a local state, without generating a new dataset ID, until the user actually initiates the dataset regeneration by clicking the Regenerate Dataset button.

Route: /dataset/id - the UI should update using the local state without making an API request:
Screenshot 2024-09-19 at 8 53 08 AM

Problem or idea

We should manage changes to download options and the File Summary section UI updates using local state, without relying on API requests. This approach will enable the UI to immediately reflect user selections, enhancing the overall user experience.

These changes should support both the /download(for My Dataset) and dataset/id (all other dataset types) routes, and all shared components and methods should be updated accordingly.

Route: /download for My Dataset - the UI is updated using API requests to preserve the user's download options preference for their dataset, which is our current flow:
Screenshot 2024-09-19 at 9 00 02 AM

Solution or next step

  1. Add a new local state, regeneratedDataset, in FileSummary to handle the data swap in the UI on download options change for regenerate datasets
  2. Clean up the no longer used global context state regeneratedDataset (replaced by the local state above) from all contexts/hooks
  3. Adjust useDatasetManager hook methods for the processing dataset and the download options updates to support both /doownload and /dataset/id routes based on the changes made in steps 1 and 2
  4. Update the shared DownloadOptionsForm component to finalize the implementation for the local state update for regeneratedDataset
  5. Refactor FileSummary to support these changes
@nozomione nozomione self-assigned this Sep 6, 2024
@nozomione nozomione changed the title Handle FileSummary rendering using local state Handle FileSummary rendering using local state Sep 6, 2024
@nozomione nozomione linked a pull request Sep 18, 2024 that will close this issue
4 tasks
@nozomione nozomione linked a pull request Sep 19, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant