diff --git a/web/src/App.svelte b/web/src/App.svelte index 88f99ab..cb83b6d 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -1114,7 +1114,7 @@ {#if showChannelModal} showChannelModal = false} - onCreate={(id, topic) => { store.createChannel(id, topic); showChannelModal = false; }} + onCreate={(id, topic, isPrivate) => { store.createChannel(id, topic, isPrivate); showChannelModal = false; }} /> {/if} diff --git a/web/src/components/ArtifactDetailHeader.svelte b/web/src/components/ArtifactDetailHeader.svelte index 4ae76ab..1b7515f 100644 --- a/web/src/components/ArtifactDetailHeader.svelte +++ b/web/src/components/ArtifactDetailHeader.svelte @@ -144,6 +144,25 @@ showCompareDropdown = !showCompareDropdown; } + /** + * Close the Compare dropdown on an outside click. The Compare dropdown's + * open state (`showCompareDropdown`) is owned locally in this component + * (unlike the primary dropdown, whose state lives in ArtifactPanel and is + * closed by that file's window guard), so the outside-click listener + * belongs here too. Mirrors ArtifactPanel.handleVersionDropdownOutsideClick: + * the trigger + listbox both live inside + * `[data-testid="compare-version-selector"]`, so a mousedown anywhere + * outside that subtree closes the dropdown. + * @param {MouseEvent} e + */ + function handleCompareDropdownOutsideClick(e) { + if (!showCompareDropdown) return; + const node = e.target; + const el = node instanceof Element ? node : (node?.parentElement ?? null); + if (el && el.closest('[data-testid="compare-version-selector"]')) return; + showCompareDropdown = false; + } + // Diff mode is disabled when there is only a single version to compare. let diffDisabled = $derived(!hasMultipleVersions); @@ -325,6 +344,8 @@ ); + +