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 color #3237

Merged
merged 2 commits into from
Jun 30, 2023
Merged

Fix reset color #3237

merged 2 commits into from
Jun 30, 2023

Conversation

lanzhenw
Copy link
Contributor

What changes are proposed in this pull request?

  • Bugfix: reset button failed to set can view permission user setting back to dataset app_config setting on TEAMS.
  • Previously x-direction scroller shows up unnecessarily on color modal.

How is this patch tested? If it is not, please explain why.

(Details)

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

@lanzhenw lanzhenw added the bug Bug fixes label Jun 29, 2023
@lanzhenw lanzhenw self-assigned this Jun 29, 2023
@@ -38,6 +38,11 @@ const ColorFooter: React.FC = () => {
return true;
}, [savedSettings]);

// set to be true only for teams
const isTeams = useRecoilValue(fos.compactLayout);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is logic/naming something we should avoid. compactLayout means isTeams by coincidence only

@@ -47,7 +52,7 @@ const ColorFooter: React.FC = () => {
text={"Reset"}
title={`Clear session settings and revert to default settings`}
onClick={() => {
setColorScheme(false, null);
setColorScheme(false, isTeams ? datasetDefault : null);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand the behavior here. Reset means two different things based on the context? How does a Teams user nullify a dataset default? Ideally we add a selector that resolves to the reset value (resolution should be opaque/decoupled)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reset always means reset to dataset default (if there is one). We have something else to clear dataset default setting.

By setting colorScheme to null, OSS will load dataset default or color pool from fo.app_config or session.config from the session. But teams can't update through the session. Therefore, I am pointing the setting to datasetDefault here for TEAMS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. In my routing work, the color scheme will update through a session regardless of what the means to the context (Teams, OSS, or a hypothetical). I'm just advocating that this doesn't leak into OSS and component logic

Copy link
Contributor

@benjaminpkane benjaminpkane left a comment

Choose a reason for hiding this comment

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

LGTM for the release

@lanzhenw lanzhenw merged commit 310e414 into release/v0.21.1 Jun 30, 2023
@lanzhenw lanzhenw deleted the fix-reset-color branch June 30, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants