mirror of
https://github.com/open-webui/open-webui
synced 2025-05-22 13:54:20 +00:00
Uncollapse so all source buttons visible
This commit is contained in:
parent
3f24062416
commit
08bc7d4cfe
@ -121,7 +121,7 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<Collapsible bind:open={isCollapsibleOpen} className="w-full">
|
<Collapsible id="collapsible-sources" bind:open={isCollapsibleOpen} className="w-full">
|
||||||
<div
|
<div
|
||||||
class="flex items-center gap-2 text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 transition cursor-pointer"
|
class="flex items-center gap-2 text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 transition cursor-pointer"
|
||||||
>
|
>
|
||||||
|
@ -679,12 +679,27 @@
|
|||||||
floatingButtons={message?.done}
|
floatingButtons={message?.done}
|
||||||
save={!readOnly}
|
save={!readOnly}
|
||||||
{model}
|
{model}
|
||||||
onSourceClick={(e) => {
|
onSourceClick={async (e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
const sourceButton = document.getElementById(`source-${e}`);
|
let sourceButton = document.getElementById(`source-${e}`);
|
||||||
|
const sourcesCollapsible = document.getElementById(`collapsible-sources`);
|
||||||
|
|
||||||
if (sourceButton) {
|
if (sourceButton) {
|
||||||
sourceButton.click();
|
sourceButton.click();
|
||||||
|
} else if (sourcesCollapsible) {
|
||||||
|
// Open sources collapsible so we can click the source button
|
||||||
|
sourcesCollapsible.querySelector("div:first-child").dispatchEvent(new PointerEvent('pointerup', {}))
|
||||||
|
|
||||||
|
// Wait for next frame to ensure DOM updates
|
||||||
|
await new Promise(resolve => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(resolve);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Try clicking the source button again
|
||||||
|
sourceButton = document.getElementById(`source-${e}`);
|
||||||
|
sourceButton && sourceButton.click();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onAddMessages={({ modelId, parentId, messages }) => {
|
onAddMessages={({ modelId, parentId, messages }) => {
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
import Spinner from './Spinner.svelte';
|
import Spinner from './Spinner.svelte';
|
||||||
|
|
||||||
export let open = false;
|
export let open = false;
|
||||||
|
export let id = '';
|
||||||
export let className = '';
|
export let className = '';
|
||||||
export let buttonClassName =
|
export let buttonClassName =
|
||||||
'w-fit text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition';
|
'w-fit text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition';
|
||||||
@ -46,7 +47,7 @@
|
|||||||
export let hide = false;
|
export let hide = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class={className}>
|
<div id={id} class={className}>
|
||||||
{#if title !== null}
|
{#if title !== null}
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
|
Loading…
Reference in New Issue
Block a user