fix: initialize video modal share popover with correct arguments

- Update `js/ui/components/VideoModal.js` to correctly initialize the modal share popover using the `createPopover(trigger, renderFn, options)` signature instead of a single config object.
- Fix the flaky e2e test `tests/e2e/search-and-filter.spec.ts` by increasing the test timeout from 15s to 30s to allow more time for feed items to be retrieved from the network.
- Update `tests/e2e/video-modal-share-bug.spec.ts` to attach an `#uiOverlay` wrapper element for the popover so the DOM doesn't crash on tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-03-01 20:49:41 +00:00
1 parent 524dc2b3eb
commit f7712f51a9
3 files changed
+44 -28

No files matched your search

+33 -22
View File
@@ -2997,8 +2997,12 @@ export class VideoModal {
this.dispatch("action:copy", { video: this.activeVideo });
}
handleShareRequest() {
this.dispatch("action:share", { video: this.activeVideo });
handleShareRequest(event) {
if (this.modalSharePopover) {
this.modalSharePopover.toggle();
} else {
this.dispatch("action:share", { video: this.activeVideo });
}
}
handleEmbedRequest() {
@@ -3249,9 +3253,9 @@ export class VideoModal {
this.modalMorePopover.destroy();
}
this.modalMorePopover = createPopover({
trigger: this.modalMoreBtn,
content: (container) => {
this.modalMorePopover = createPopover(
this.modalMoreBtn,
({ container }) => {
if (!this.activeVideo) {
container.innerHTML = "";
return;
@@ -3269,18 +3273,21 @@ export class VideoModal {
container.appendChild(panel);
this.modalMoreMenuPanel = panel;
}
return panel;
},
placement: "bottom-end",
offset: 8,
onOpen: () => {
if (this.activeVideo) {
this.syncMoreMenuData({
currentVideo: this.activeVideo,
canManageBlacklist: this.modalMoreMenuContext.canManageBlacklist,
});
}
},
});
{
placement: "bottom-end",
offset: 8,
onOpen: () => {
if (this.activeVideo) {
this.syncMoreMenuData({
currentVideo: this.activeVideo,
canManageBlacklist: this.modalMoreMenuContext.canManageBlacklist,
});
}
},
}
);
}
setupModalSharePopover() {
@@ -3298,9 +3305,9 @@ export class VideoModal {
this.modalSharePopover.destroy();
}
this.modalSharePopover = createPopover({
trigger: this.shareBtn,
content: (container) => {
this.modalSharePopover = createPopover(
this.shareBtn,
({ container }) => {
if (!this.activeVideo) {
container.innerHTML = "";
return;
@@ -3316,10 +3323,14 @@ export class VideoModal {
if (panel) {
container.appendChild(panel);
}
return panel;
},
placement: "top", // or "top-start" based on layout
offset: 8,
});
{
placement: "top", // or "top-start" based on layout
offset: 8,
document: this.document,
}
);
}
refreshModalMoreMenuPanel() {