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

Collapse button for floating viz controls #535

Merged
merged 12 commits into from
Oct 12, 2023
Merged

Conversation

chowington
Copy link
Member

Closes #99

@chowington chowington requested a review from bobular October 9, 2023 22:45
@chowington chowington marked this pull request as ready for review October 9, 2023 22:45
Copy link
Member

@bobular bobular left a comment

Choose a reason for hiding this comment

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

Looks great. A few small comments in the code.

If it's trivial, without massively reengineering coreui, would you be able to make the new button a bit smaller? Ideally not larger than the Add filters button in the header, and maybe not all caps also. (this is the only firm "requested change" - others are for discussion)

There is also a more general problem of our plots (EDA and SAM) all wasting space at the top where a header can go (IIRC, we add a header when faceting in regular SAM).

We should talk about a follow-on ticket that considers the window sizing.

I've added a Map UX topic (item 3 here) to decide what's best for state management. Window size and location could perhaps be part of that discussion.

image

@@ -66,6 +67,8 @@ interface Props {
createComputeJob?: () => void;
/** optional dynamic plugins */
plugins?: Partial<Record<string, ComputationPlugin>>;
hideInputsAndControls?: boolean;
plotContainerStylesOverrides?: PlotContainerStylesOverrides;
Copy link
Member

Choose a reason for hiding this comment

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

This is pedantic, sorry, but we've called these types of prop XyzStyleOverrides, not XyzStylesOverrides elsewhere...

interface Props {
selectedOverlayConfig?: OverlayConfig | BubbleOverlayConfig;
overlayHelp?: ReactNode;
vizOptions?: StandaloneVizOptions;
Copy link
Member

Choose a reason for hiding this comment

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

Was this prop planned and never used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep! Good catch 👍

styleOverrides={{
zIndex: zIndexForStackingContext,
resize: 'both',
overflow: 'hidden',
Copy link
Member

Choose a reason for hiding this comment

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

tbh I don't fully understand the overflow property usage here.
It may be a browser difference (though I've tried Chrome and Firefox).
I am seeing scroll bars appear on mouse-over. Perhaps you could explain to me later? Sorry!

Copy link
Member Author

@chowington chowington Oct 11, 2023

Choose a reason for hiding this comment

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

We want it to scroll, but we don't want DraggablePanel to handle the scrolling (which it does by default); we want to handle it ourselves in the divs we pass as children of DraggablePanel. Thus you'll see overflow: 'auto' on one of the child divs below.

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Thanks for explaining!

@chowington chowington requested a review from bobular October 11, 2023 21:33
Copy link
Member

@bobular bobular left a comment

Choose a reason for hiding this comment

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

Excellent - thanks. I'll draft the next ticket and/or make mockups for the next phase regarding the draggable's sizing.

styleOverrides={{
zIndex: zIndexForStackingContext,
resize: 'both',
overflow: 'hidden',
Copy link
Member

Choose a reason for hiding this comment

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

Got it. Thanks for explaining!

}}
>
<FilledButton
text={hideInputsAndControls ? 'Show Controls' : 'Hide Controls'}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
text={hideInputsAndControls ? 'Show Controls' : 'Hide Controls'}
text={hideInputsAndControls ? 'Show controls' : 'Hide controls'}

Call me a pedant, but this capitalisation would match the other text on screen - "Box plot" and "Add filters" (but not "Unnamed Analysis"...). Not a hill I'm willing to die on though.

@chowington chowington merged commit 7e78755 into main Oct 12, 2023
@chowington chowington deleted the 99-collapse-viz-controls branch October 12, 2023 20:23
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 this pull request may close these issues.

Allow user to collapse floater controls
3 participants