-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/restore default #615
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
Conversation
…simularium-website into feature/retrieve-colors
… into feature/restore-default
Coverage report
Show files with reduced coverage 🔻
Test suite run success139 tests passing in 8 suites. Report generated by 🧪jest coverage report action from d535a81 |
| const [currentColor, setCurrentColor] = useState(initialColor); | ||
| const [debouncedColor] = useDebounce(currentColor, 250); | ||
| const isInitialRender = useRef(true); | ||
| const isUserInteraction = useRef(false); |
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.
Now that other elements are interacting with color changing, this needed to be a little more robust so prevent re-renders from triggering this and making preview events into permanent selection changes.
ShrimpCryptid
left a comment
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.
Love the new behavior, it's super rad having the instant preview! Tested with browser refresh and it works well.
FYI I am having trouble navigating to the button via keyboard shortcuts, but from the other PRs I've been seeing you open I assume you already know about it.
src/state/compoundSelectors/index.ts
Outdated
| } | ||
| ); | ||
|
|
||
| export const getDefaultUISettingsApplied = createSelector( |
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.
Consider changing to getIsDefaultUISettingsApplied (or Are) so this sounds more like a boolean/conditional value. Otherwise getDefaultUISettingsApplied sounds like it would be returning the default UI settings.
toloudis
left a comment
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 but one suggested renaming.
src/containers/ModelPanel/index.tsx
Outdated
| mainTitle="Agents" | ||
| content={[contentMap[viewerStatus]]} | ||
| content={[ | ||
| <div key="molecules"> |
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.
is molecules maybe too specific a name for this?
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.
I wrote the first drafts of this a long time ago, guess I was feeling granular?
Time estimate or Size
small
Problem
Closes #583 and #511
Solution
Final steps for user color selections in browser storage!!
The button is in the side panel, hover over it? Preview the default settings. Stop hovering over it? Back to your selections.
Click it?? Restore default and delete selections from redux and browser storage.
If selections are in browser storage they should still be applied on load.
In keeping with recent discussion around the role of actions and logics in our redux flow, the business end of
clearUserSelectedColorsis in the logic, where we can run multiple dispatches without excess re-renders, and with logic free reducers.Needed to make a few tweaks to
ColorPickerso that re-renders wouldn't trigger a reset ofselectedUIDisplayDatawhen just trying to run a preview.Steps to Verify: