-
Notifications
You must be signed in to change notification settings - Fork 3
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/restore default #615
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 |
@@ -32,7 +32,7 @@ const ColorPicker = ({ | |||
}: ColorPickerProps): JSX.Element => { | |||
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.
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
@@ -27,3 +28,17 @@ export const getCurrentUIData = createSelector( | |||
: defaultData; | |||
} | |||
); | |||
|
|||
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.
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
return ( | ||
<div className={styles.container}> | ||
<SideBarContents | ||
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
clearUserSelectedColors
is 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
ColorPicker
so that re-renders wouldn't trigger a reset ofselectedUIDisplayData
when just trying to run a preview.Steps to Verify: