-
Notifications
You must be signed in to change notification settings - Fork 1
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: Toggle backdrop visibility #483
Conversation
|
Coverage Report
File Coverage
|
function TooltipWithSubtext( | ||
props: TooltipProps & { title: ReactNode; subtitle?: ReactNode; subtitleList?: ReactNode[] } | ||
): ReactElement { | ||
const divRef = useRef<HTMLDivElement>(null); | ||
return ( | ||
<Tooltip | ||
{...props} | ||
title={ | ||
<> | ||
<p style={{ margin: 0 }}>{props.title}</p> | ||
<p style={{ margin: 0, fontSize: "12px" }}>{props.subtext}</p> | ||
</> | ||
} | ||
> | ||
{props.children} | ||
</Tooltip> | ||
<div ref={divRef}> | ||
<Tooltip | ||
{...props} | ||
trigger={["hover", "focus"]} | ||
title={ | ||
<> | ||
<p style={{ margin: 0 }}>{props.title}</p> | ||
{props.subtitle && <p style={{ margin: 0, fontSize: "12px" }}>{props.subtitle}</p>} | ||
{props.subtitleList && | ||
props.subtitleList.map((text, i) => ( | ||
<p key={i} style={{ margin: 0, fontSize: "12px" }}> | ||
{text} | ||
</p> | ||
))} | ||
</> | ||
} | ||
getPopupContainer={() => divRef.current ?? document.body} | ||
> | ||
{props.children} | ||
</Tooltip> | ||
</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.
Recommend reviewing this with whitespace off!
canv.setBackdropBrightness(props.config.backdropBrightness); | ||
canv.setBackdropSaturation(props.config.backdropSaturation); | ||
}, [props.selectedBackdropKey, props.config.backdropBrightness, props.config.backdropSaturation]); | ||
if (props.selectedBackdropKey !== null && props.config.backdropVisible) { |
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.
This is a nice and important check to have!
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! Thank you for the demo and the always-helpful comments.
I noticed that clicking outside the checkbox (while hovering over the same row) still toggles it in Viewer Settings
. This feels like something a user might accidentally trigger. Are we planning to address this in upcoming PRs?
It's semi-addressed in issue #472, but it's on hold for now pending a redesign of the settings area in #486. |
Problem
Closes #480, "make background image toggle more visible"!
This change adds a new onscreen toggle for the backdrop image to help make it more discoverable for users.
Estimated review size: ~20 minutes, medium
Solution
ViewerConfig
type.SettingsTab
with the new vector config.CanvasWrapper
.Type of change
Steps to Verify:
Screenshots (optional):
Video Talk-through (🔊):
2024-12-02.14-35-36.mp4