mirror of
https://github.com/open-webui/open-webui
synced 2025-02-22 21:32:32 +00:00
Uncollapse so all source buttons visible
This commit is contained in:
parent
3f24062416
commit
08bc7d4cfe
@ -121,7 +121,7 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<Collapsible bind:open={isCollapsibleOpen} className="w-full">
|
||||
<Collapsible id="collapsible-sources" bind:open={isCollapsibleOpen} className="w-full">
|
||||
<div
|
||||
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}
|
||||
save={!readOnly}
|
||||
{model}
|
||||
onSourceClick={(e) => {
|
||||
onSourceClick={async (e) => {
|
||||
console.log(e);
|
||||
const sourceButton = document.getElementById(`source-${e}`);
|
||||
let sourceButton = document.getElementById(`source-${e}`);
|
||||
const sourcesCollapsible = document.getElementById(`collapsible-sources`);
|
||||
|
||||
if (sourceButton) {
|
||||
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 }) => {
|
||||
|
@ -34,6 +34,7 @@
|
||||
import Spinner from './Spinner.svelte';
|
||||
|
||||
export let open = false;
|
||||
export let id = '';
|
||||
export let className = '';
|
||||
export let buttonClassName =
|
||||
'w-fit text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition';
|
||||
@ -46,7 +47,7 @@
|
||||
export let hide = false;
|
||||
</script>
|
||||
|
||||
<div class={className}>
|
||||
<div id={id} class={className}>
|
||||
{#if title !== null}
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
|
Loading…
Reference in New Issue
Block a user