-
Notifications
You must be signed in to change notification settings - Fork 204
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
Use a modal for license explanation #4800
Conversation
3d87622
to
ac27177
Compare
53c9bfe
to
cc2c019
Compare
814496e
to
54ec74f
Compare
@@ -51,7 +52,7 @@ const close = () => { | |||
<template #default> | |||
<VContentReportForm | |||
ref="contentReportFormRef" | |||
class="p-7 pt-0 sm:p-9" | |||
class="p-7 pt-0 sm:p-9 sm:pt-0" |
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 the fix for #4802
@@ -15,6 +15,7 @@ import type { Placement, Strategy } from "@floating-ui/dom" | |||
|
|||
const props = withDefaults( | |||
defineProps<{ | |||
id: string |
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.
id: string | |
/** | |
* The id used to keep track of the modal in the open modal stack, to enable | |
* nested modals. | |
*/ | |
id: string |
Should this have a similar comment?
const activeDialog = computed(() => stack.value[stack.value.length - 1]) | ||
|
||
return { | ||
stack, | ||
push, | ||
pop, | ||
clear, | ||
indexOf, | ||
activeDialog, | ||
} | ||
} |
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.
Can we document what activeDialog means in terms of the actual UI here? For example saying it's the "top-level dialog with no dialogs above it" or something. That's a terrible example but hopefully conveys what I mean.
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 love the ID stack approach to fixing the nested dialog issue! Everything I've tested works great. Some documentation nits, otherwise LGTM.
f8eb161
to
cfffa98
Compare
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
f61532d
to
9dcafec
Compare
Fixes
Fixes #3582 by @fcoveram
Fixes #4802 by @fcoveram
Description
This PR converts the license explanation popover to a modal.
Desktop
Mobile
Functionality changes
On mobile screens, the license explanation modal appears on top of the content settings modal. So, when the user clicked outside of the license explanation modal, the lower content settings modal handled this event and closed, keeping the top-most license explanation one open.
To correctly handle this, I added a
use-dialog-stack
composable andid
s to all modals and popovers to keep track and route the event to the currently open, top-most dialog.Vertical overflow
I added the
max-height
to modals, set to the full height of the screen, minus the height of the modal header, minus an arbitrary value of 6rem. @fcoveram, what is the best value for vertical margin of the modal?Testing Instructions
Run the app and go to
http://localhost:8443/search?q=cat
.On desktop, open the filters sidebar and click on one of the
?
buttons next to licenses. The modal should appear. It's styles should match the mockups, and it should function correctly.On a mobile, open the content settings modal, select the Filters tab and click on one of the
?
buttons next to licenses. The modal should appear. Clicking on the close button, pressing Escape or clicking outside of the modal should close it, and only it (not the content settings modal below it).Checklist
Update index.md
).main
) or a parent feature branch.ov just catalog/generate-docs
for catalogPRs) or the media properties generator (
ov just catalog/generate-docs media-props
for the catalog or
ov just api/generate-docs
for the API) where applicable.Developer Certificate of Origin
Developer Certificate of Origin