From 7a6c052a8d207c8ca93b665df4b81e792441f2aa Mon Sep 17 00:00:00 2001 From: ernstmul Date: Tue, 8 Apr 2025 12:35:20 +0200 Subject: [PATCH] Fix chat mobile --- src/lib/components/chat/chat.svelte | 92 +++++++++++++------ src/lib/layout/shellStudio.svelte | 3 +- src/lib/profiles.ts | 10 +- .../project-[project]/+layout.svelte | 13 ++- .../project-[project]/builder/+page.svelte | 30 +++++- 5 files changed, 105 insertions(+), 43 deletions(-) diff --git a/src/lib/components/chat/chat.svelte b/src/lib/components/chat/chat.svelte index 8e9c8981b..550732e83 100644 --- a/src/lib/components/chat/chat.svelte +++ b/src/lib/components/chat/chat.svelte @@ -18,35 +18,57 @@ let minimizeChat = $state(false); -
+
-
- - Chat - { - showChat = false; - }} - > - -
- + {#if !minimizeChat} +
+ + Chat + { + if ($isSmallViewport) { + minimizeChat = !minimizeChat; + } else { + showChat = false; + } + }} + > + +
+ - -
- - - - + + {/if} +
+ + +
+ + + + +
@@ -65,9 +87,19 @@ .chat { width: 0; position: fixed; - top: 48px; - height: calc(100vh - 48px); - //transition: width 0.1s ease-in-out; + top: 56px; + height: calc(100vh - 56px); + z-index: 2; + + @media (min-width: 768px) { + top: 48px; + height: calc(100vh - 70px); + } + } + .chat.minimize-chat { + top: auto; + bottom: var(--space-4); + height: 60px; } .chat-placeholder { diff --git a/src/lib/layout/shellStudio.svelte b/src/lib/layout/shellStudio.svelte index 21bb6ffa9..eb5c216a4 100644 --- a/src/lib/layout/shellStudio.svelte +++ b/src/lib/layout/shellStudio.svelte @@ -255,7 +255,8 @@ } .overlay-button { - margin-top: calc(-1 * var(--space-6)); + position: fixed; + top: 0; @media (min-width: 1024px) { display: none; } diff --git a/src/lib/profiles.ts b/src/lib/profiles.ts index 4fb91b0a9..805bc06eb 100644 --- a/src/lib/profiles.ts +++ b/src/lib/profiles.ts @@ -6,6 +6,7 @@ type Profile = { hasMessages: boolean; hasStorage: boolean; hasSites: boolean; + hasProjectProgressBars: boolean; }; export const ConsoleCloudProfile: Profile = { @@ -15,7 +16,8 @@ export const ConsoleCloudProfile: Profile = { hasFunctions: true, hasMessages: true, hasStorage: true, - hasSites: true + hasSites: true, + hasProjectProgressBars: true }; export const ConsoleSelfhostedProfile: Profile = { @@ -25,7 +27,8 @@ export const ConsoleSelfhostedProfile: Profile = { hasFunctions: true, hasMessages: true, hasStorage: true, - hasSites: true + hasSites: true, + hasProjectProgressBars: true }; export const StudioProfile: Profile = { @@ -35,5 +38,6 @@ export const StudioProfile: Profile = { hasFunctions: false, hasMessages: true, hasStorage: true, - hasSites: true + hasSites: true, + hasProjectProgressBars: false }; diff --git a/src/routes/(console)/project-[project]/+layout.svelte b/src/routes/(console)/project-[project]/+layout.svelte index 8aa3c635a..0634000fe 100644 --- a/src/routes/(console)/project-[project]/+layout.svelte +++ b/src/routes/(console)/project-[project]/+layout.svelte @@ -24,6 +24,7 @@ canWriteProjects, canWriteSites } from '$lib/stores/roles'; + import { consoleProfile } from '$lib/system'; onMount(() => { return sdk.forConsole.client.subscribe(['project', 'console'], (response) => { @@ -113,11 +114,13 @@ -
- - - -
+{#if consoleProfile.hasProjectProgressBars} +
+ + + +
+{/if}