Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
5ae121b0
"include/vscode:/vscode.git/clone" did not exist on "8ce9fe5735d1297eeb611bb72b08e88bbc880d96"
Commit
5ae121b0
authored
Mar 06, 2024
by
Timothy J. Baek
Browse files
feat: message tooltips
parent
434595b3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
297 additions
and
265 deletions
+297
-265
src/lib/components/chat/Messages/ResponseMessage.svelte
src/lib/components/chat/Messages/ResponseMessage.svelte
+245
-220
src/lib/components/chat/Messages/UserMessage.svelte
src/lib/components/chat/Messages/UserMessage.svelte
+52
-45
No files found.
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
5ae121b0
This diff is collapsed.
Click to expand it.
src/lib/components/chat/Messages/UserMessage.svelte
View file @
5ae121b0
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import Name from './Name.svelte';
import Name from './Name.svelte';
import ProfileImage from './ProfileImage.svelte';
import ProfileImage from './ProfileImage.svelte';
import { modelfiles, settings } from '$lib/stores';
import { modelfiles, settings } from '$lib/stores';
import Tooltip from '$lib/components/common/Tooltip.svelte';
const dispatch = createEventDispatcher();
const dispatch = createEventDispatcher();
...
@@ -246,55 +247,35 @@
...
@@ -246,55 +247,35 @@
</div>
</div>
{/if}
{/if}
<button
<Tooltip content="Edit" placement="bottom">
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition edit-user-message-button"
<button
on:click={() => {
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition edit-user-message-button"
editMessageHandler();
on:click={() => {
}}
editMessageHandler();
>
}}
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-4 h-4"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"
/>
</svg>
</button>
<button
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition"
on:click={() => {
copyToClipboard(message.content);
}}
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-4 h-4"
>
>
<path
<svg
stroke-linecap="round"
xmlns="http://www.w3.org/2000/svg"
stroke-linejoin="round"
fill="none"
d="M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"
viewBox="0 0 24 24"
/>
stroke-width="1.5"
</svg>
stroke="currentColor"
</button>
class="w-4 h-4"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"
/>
</svg>
</button>
</Tooltip>
{#if !isFirstMessage}
<Tooltip content="Copy" placement="bottom">
<button
<button
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition"
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition"
on:click={() => {
on:click={() => {
deleteMessageHandler(
);
copyToClipboard(message.content
);
}}
}}
>
>
<svg
<svg
...
@@ -308,10 +289,36 @@
...
@@ -308,10 +289,36 @@
<path
<path
stroke-linecap="round"
stroke-linecap="round"
stroke-linejoin="round"
stroke-linejoin="round"
d="
m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.1
6 1
9
.6
73a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.2
5 0 0
1-
2.244-2.077L4.772 5.79m14.456 0a48.108 4
8.
1
08
0 0 0-3.478-.397m-12 .562c.34-.059.68-
.11
4
1.
022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c
-1.18.
037
-2.0
9
1.
022-2.09 2.201v.916m7.5 0
a48.
667
48.
667
0 0
0-7.5 0
"
d="
M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.16
6 1.6
38m7.332 0c.055.194.084.4.084.612v0a.75.7
5 0 01-
.75.75H9a.75.75 0 01-.75-.75v0c0-.212.03-.41
8.08
4-.612m7.332 0c.646.049 1.288
.11 1.
927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0
-1.1
0
8.
806
-2.0
57
1.
907-2.185
a48.
208
48.
208
0 0
11.927-.184
"
/>
/>
</svg>
</svg>
</button>
</button>
</Tooltip>
{#if !isFirstMessage}
<Tooltip content="Delete" placement="bottom">
<button
class="invisible group-hover:visible p-1 rounded dark:hover:text-white hover:text-black transition"
on:click={() => {
deleteMessageHandler();
}}
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-4 h-4"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"
/>
</svg>
</button>
</Tooltip>
{/if}
{/if}
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment