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
5613af03
Commit
5613af03
authored
May 02, 2024
by
Timothy J. Baek
Browse files
fix: styling
parent
8fb5e22e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
12 deletions
+33
-12
src/lib/components/chat/MessageInput/Suggestions.svelte
src/lib/components/chat/MessageInput/Suggestions.svelte
+20
-1
src/lib/components/chat/Messages.svelte
src/lib/components/chat/Messages.svelte
+1
-1
src/lib/components/chat/Messages/Placeholder.svelte
src/lib/components/chat/Messages/Placeholder.svelte
+1
-1
src/lib/components/layout/Navbar.svelte
src/lib/components/layout/Navbar.svelte
+1
-4
src/routes/(app)/+page.svelte
src/routes/(app)/+page.svelte
+8
-3
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+2
-2
No files found.
src/lib/components/chat/MessageInput/Suggestions.svelte
View file @
5613af03
<script lang="ts">
<script lang="ts">
import Bolt from '$lib/components/icons/Bolt.svelte';
import Bolt from '$lib/components/icons/Bolt.svelte';
import { onMount } from 'svelte';
export let submitPrompt: Function;
export let submitPrompt: Function;
export let suggestionPrompts = [];
export let suggestionPrompts = [];
...
@@ -12,6 +13,21 @@
...
@@ -12,6 +13,21 @@
// suggestionPrompts.length <= 4
// suggestionPrompts.length <= 4
// ? suggestionPrompts
// ? suggestionPrompts
// : suggestionPrompts.sort(() => Math.random() - 0.5).slice(0, 4);
// : suggestionPrompts.sort(() => Math.random() - 0.5).slice(0, 4);
onMount(() => {
const containerElement = document.getElementById('suggestions-container');
if (containerElement) {
containerElement.addEventListener('wheel', function (event) {
if (event.deltaY !== 0) {
// If scrolling vertically, prevent default behavior
event.preventDefault();
// Adjust horizontal scroll position based on vertical scroll
containerElement.scrollLeft += event.deltaY;
}
});
}
});
</script>
</script>
{#if prompts.length > 0}
{#if prompts.length > 0}
...
@@ -22,7 +38,10 @@
...
@@ -22,7 +38,10 @@
{/if}
{/if}
<div class="w-full">
<div class="w-full">
<div class="relative w-full flex gap-2 snap-x snap-mandatory overflow-x-auto tabs">
<div
class="relative w-full flex gap-2 snap-x snap-mandatory md:snap-none overflow-x-auto tabs"
id="suggestions-container"
>
{#each prompts as prompt, promptIdx}
{#each prompts as prompt, promptIdx}
<div class="snap-center shrink-0">
<div class="snap-center shrink-0">
<button
<button
...
...
src/lib/components/chat/Messages.svelte
View file @
5613af03
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
};
};
</script>
</script>
<div class="h-full flex">
<div class="h-full flex
mb-16
">
{#if messages.length == 0}
{#if messages.length == 0}
<Placeholder
<Placeholder
models={selectedModels}
models={selectedModels}
...
...
src/lib/components/chat/Messages/Placeholder.svelte
View file @
5613af03
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
</script>
</script>
{#key mounted}
{#key mounted}
<div class="m-auto w-full max-w-3xl px-8 pb-
32
">
<div class="m-auto w-full max-w-3xl px-8
lg:px-0
pb-
16
">
<div class="flex justify-start">
<div class="flex justify-start">
<div class="flex -space-x-4 mb-1" in:fade={{ duration: 200 }}>
<div class="flex -space-x-4 mb-1" in:fade={{ duration: 200 }}>
{#each models as model, modelIdx}
{#each models as model, modelIdx}
...
...
src/lib/components/layout/Navbar.svelte
View file @
5613af03
...
@@ -27,10 +27,7 @@
...
@@ -27,10 +27,7 @@
<ShareChatModal bind:show={showShareChatModal} chatId={$chatId} />
<ShareChatModal bind:show={showShareChatModal} chatId={$chatId} />
<nav id="nav" class=" sticky py-2.5 top-0 flex flex-row justify-center z-30">
<nav id="nav" class=" sticky py-2.5 top-0 flex flex-row justify-center z-30">
<div
<div class=" flex max-w-full w-full mx-auto px-6 pt-1">
class=" flex {$settings?.fullScreenMode ?? null ? 'max-w-full' : 'max-w-3xl'}
w-full mx-auto px-5"
>
<div class="flex items-center w-full max-w-full">
<div class="flex items-center w-full max-w-full">
<div class="flex-1 overflow-hidden max-w-full">
<div class="flex-1 overflow-hidden max-w-full">
{#if showModelSelector}
{#if showModelSelector}
...
...
src/routes/(app)/+page.svelte
View file @
5613af03
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
chatId
,
chatId
,
config
,
config
,
WEBUI_NAME
,
WEBUI_NAME
,
tags
as
_tags
tags
as
_tags
,
showSidebar
}
from
'$lib/stores'
;
}
from
'$lib/stores'
;
import
{
copyToClipboard
,
splitStream
}
from
'$lib/utils'
;
import
{
copyToClipboard
,
splitStream
}
from
'$lib/utils'
;
...
@@ -838,7 +839,11 @@
...
@@ -838,7 +839,11 @@
</title>
</title>
</svelte:head>
</svelte:head>
<div class="h-screen max-h-[100dvh] w-full flex flex-col">
<div
class="min-h-screen max-h-screen {$showSidebar
? '
lg
:
max
-
w
-[
calc
(
100
%-
260
px
)]
'
: ''} w-full max-w-full flex flex-col"
>
<Navbar
<Navbar
{title}
{title}
bind:selectedModels
bind:selectedModels
...
@@ -849,7 +854,7 @@
...
@@ -849,7 +854,7 @@
/>
/>
<div class="flex flex-col flex-auto">
<div class="flex flex-col flex-auto">
<div
<div
class=" pb-2.5 flex flex-col justify-between w-full flex-auto overflow-auto h-0"
class=" pb-2.5 flex flex-col justify-between w-full flex-auto overflow-auto h-0
max-w-full
"
id="messages-container"
id="messages-container"
bind:this={messagesContainerElement}
bind:this={messagesContainerElement}
on:scroll={(e) => {
on:scroll={(e) => {
...
...
src/routes/(app)/c/[id]/+page.svelte
View file @
5613af03
...
@@ -859,8 +859,8 @@
...
@@ -859,8 +859,8 @@
{#if loaded}
{#if loaded}
<div
<div
class="min-h-screen max-h-screen {$showSidebar
class="min-h-screen max-h-screen {$showSidebar
? '
lg
:
max
-
w
-[
calc
(
100
%-
260
px
)]
'
? '
lg
:
max
-
w
-[
calc
(
100
%-
260
px
)]
'
: ''} max-w-full flex flex-col"
: ''}
w-full
max-w-full flex flex-col"
>
>
<Navbar
<Navbar
{title}
{title}
...
...
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