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
f1acf68b
Commit
f1acf68b
authored
Apr 30, 2024
by
Timothy J. Baek
Browse files
fix: styling
parent
3c9fc785
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
41 deletions
+6
-41
src/lib/components/chat/Messages.svelte
src/lib/components/chat/Messages.svelte
+3
-40
src/lib/components/chat/Messages/CodeBlock.svelte
src/lib/components/chat/Messages/CodeBlock.svelte
+3
-1
No files found.
src/lib/components/chat/Messages.svelte
View file @
f1acf68b
...
...
@@ -238,43 +238,6 @@
history: history
});
};
// const messageDeleteHandler = async (messageId) => {
// const message = history.messages[messageId];
// const parentId = message.parentId;
// const childrenIds = message.childrenIds ?? [];
// const grandchildrenIds = [];
// // Iterate through childrenIds to find grandchildrenIds
// for (const childId of childrenIds) {
// const childMessage = history.messages[childId];
// const grandChildrenIds = childMessage.childrenIds ?? [];
// for (const grandchildId of grandchildrenIds) {
// const childMessage = history.messages[grandchildId];
// childMessage.parentId = parentId;
// }
// grandchildrenIds.push(...grandChildrenIds);
// }
// history.messages[parentId].childrenIds.push(...grandchildrenIds);
// history.messages[parentId].childrenIds = history.messages[parentId].childrenIds.filter(
// (id) => id !== messageId
// );
// // Select latest message
// let currentMessageId = grandchildrenIds.at(-1);
// if (currentMessageId) {
// let messageChildrenIds = history.messages[currentMessageId].childrenIds;
// while (messageChildrenIds.length !== 0) {
// currentMessageId = messageChildrenIds.at(-1);
// messageChildrenIds = history.messages[currentMessageId].childrenIds;
// }
// history.currentId = currentMessageId;
// }
// await updateChatById(localStorage.token, chatId, { messages, history });
// };
</script>
<div class="h-full flex">
...
...
@@ -297,10 +260,10 @@
}}
/>
{:else}
<div class="
{$settings?.fullScreenMode ?? null ? 'w-full' : 'mx-auto'} pt-2 pb-28
">
<div class="
w-full pt-2
">
{#key chatId}
{#each messages as message, messageIdx}
<div class=" w-full">
<div class=" w-full
{messageIdx === messages.length - 1 ? 'pb-28' : ''}
">
<div
class="flex flex-col justify-between px-5 mb-3 {$settings?.fullScreenMode ?? null
? 'max-w-full'
...
...
@@ -355,7 +318,7 @@
{/each}
{#if bottomPadding}
<div class="
m
b-20" />
<div class="
p
b-20" />
{/if}
{/key}
</div>
...
...
src/lib/components/chat/Messages/CodeBlock.svelte
View file @
f1acf68b
...
...
@@ -31,7 +31,9 @@
>
</div>
<pre class=" rounded-b-lg hljs p-4 px-5 overflow-x-auto rounded-t-none"><code
<pre
class=" hljs p-4 px-5 overflow-x-auto"
style="border-top-left-radius: 0px; border-top-right-radius: 0px;"><code
class="language-{lang} rounded-t-none whitespace-pre">{@html highlightedCode || code}</code
></pre>
</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