-
Notifications
You must be signed in to change notification settings - Fork 0
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
feature: UI for loading CSVs (CSV pt. 3) #213
Conversation
…ted more functions (greyscreen)
export interface ReduxLogicDeps { | ||
action: AnyAction; | ||
httpClient: AxiosInstance; | ||
imageDataSet: ImageDataset; | ||
getState: () => State; | ||
ctx?: any; |
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.
Moved from logic dependencies into metadata new imageDataset
state branch
@ShrimpCryptid I see a bunch of small things that need to be fixed, like using selectors instead of accessing state directly in your logics.
UPDATE: I read the other PRs associated with this, and I'm now understanding better what you're doing here, I'll keep making comments |
const thumbnailSrc = formatThumbnailSrc( | ||
thumbnailRoot, | ||
hoveredPointData?.thumbnailPath || "" | ||
); |
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.
could we do this earlier? like in the image-dataset class functions?
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.
Probably, but I think I'd need to change functionality in the existing ImageDataset classes as well, and I didn't want to touch them too much in this PR.
<Descriptions.Item label={downloadInfo.date}> | ||
<Descriptions.Item | ||
label={downloadInfo.date} | ||
key={index} |
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.
Adds a key because React was complaining
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.
LGTM!
export function loadCsvDataset(payload: string): LoadCsvDatasetAction { | ||
return { | ||
payload, | ||
type: LOAD_CSV_DATASET, |
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.
weird formatting here: compare line 6 vs lines 10-13
src/components/LandingPage/index.tsx
Outdated
|
||
<div className={styles.sectionContent}> | ||
<CsvInput /> | ||
</div> |
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.
what happens if you load a CSV and then select one of the existing datasets afterwards?
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.
Loading a CSV immediately takes you to the plot view, so you can no longer select the JSON or Firebase datasets.
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.
but if you hit back you can, and it's a SPA
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.
ack !!!
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.
Opened a ticket as #221. I've started tinkering with this but need more time to make the solution not too janky.
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.
Where are we headed with this? In my mind this PR was never meant to be released to production - it was just supposed to be something we could demo with BFF. IMO it's already gotten way more engineering than it initially deserved. The dynamic dataset changing is out of scope for the functionality we wanted to deliver. I suggest that we need to stop and decide what to do with this functionality.
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.
Problem
Closes #211, "prototype direct spreadsheet import."
Adds the ability to drag and drop CSVs onto the landing page and have them be opened as a dataset.
Estimated review size: small, 15-20 minutes
This PR also spins off into a few new issue tickets:
Solution
imageDataset
to be part of the redux-managed state, instead of an immutable global dependency. This lets it be changed at runtime when a CSV is uploaded.CsvUploadButton
component, which handles logic for initializing the CSV dataset and replacing it in redux state.Changes that still need to be made:
Type of change
Steps to Verify:
Screenshots (optional):
Video Talk-through (🔊):
2024-11-15.13-46-31.mp4