From b3c30738bd2410555e1baa3956db441c6bee20ef Mon Sep 17 00:00:00 2001 From: Joakim Date: Sun, 15 Feb 2026 14:59:58 +0100 Subject: [PATCH] fix(web): minor UI refinements across header, pills, swipe, and settings - Remove ThemeSwitcher from header (already accessible via settings) - Increase pill padding and font size for better tap targets - Guard non-cancelable touchmove preventDefault in SwipeAction - Restyle settings page with grid-area layout and inline sign-out button Co-Authored-By: Claude Opus 4.6 --- opal-web/src/lib/components/Header.svelte | 2 - .../src/lib/components/PropertyPills.svelte | 20 +- .../src/lib/components/SwipeAction.svelte | 2 +- opal-web/src/routes/settings/+page.svelte | 240 ++++++++++-------- 4 files changed, 147 insertions(+), 117 deletions(-) diff --git a/opal-web/src/lib/components/Header.svelte b/opal-web/src/lib/components/Header.svelte index 709dab9..2f020c9 100644 --- a/opal-web/src/lib/components/Header.svelte +++ b/opal-web/src/lib/components/Header.svelte @@ -1,6 +1,5 @@ @@ -41,11 +41,11 @@ } .pill { - padding: 0.25rem 0.625rem; + padding: 0.375rem 0.75rem; background-color: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 1rem; - font-size: var(--font-size-xs); + font-size: var(--font-size-s); font-family: inherit; color: var(--text-secondary); cursor: pointer; diff --git a/opal-web/src/lib/components/SwipeAction.svelte b/opal-web/src/lib/components/SwipeAction.svelte index 29cfa9a..858d28b 100644 --- a/opal-web/src/lib/components/SwipeAction.svelte +++ b/opal-web/src/lib/components/SwipeAction.svelte @@ -51,7 +51,7 @@ } if (swiping) { - e.preventDefault(); + if (e.cancelable) e.preventDefault(); // Only allow right swipe offsetX = Math.max(0, deltaX); } diff --git a/opal-web/src/routes/settings/+page.svelte b/opal-web/src/routes/settings/+page.svelte index 4c98466..25c679f 100644 --- a/opal-web/src/routes/settings/+page.svelte +++ b/opal-web/src/routes/settings/+page.svelte @@ -6,11 +6,11 @@ import Input from '$lib/components/ui/Input.svelte'; import { auth } from '$lib/api/endpoints.js'; import { goto } from '$app/navigation'; - + let apiKey = ''; let saving = false; let error = ''; - + /** * Save API key as manual auth */ @@ -19,10 +19,10 @@ error = 'API key is required'; return; } - + saving = true; error = ''; - + try { // Store API key as access token (for manual auth mode) authStore.setAuth({ @@ -36,7 +36,7 @@ email: null } }); - + goto('/'); } catch (err) { error = err instanceof Error ? err.message : 'Failed to save API key'; @@ -44,7 +44,7 @@ saving = false; } } - + /** * Logout */ @@ -56,11 +56,11 @@ console.error('Logout error:', err instanceof Error ? err.message : err); } } - + authStore.clear(); goto('/auth/login'); } - + /** * Trigger manual sync */ @@ -74,107 +74,112 @@ } -
-
- - +
+ + + + + +

Settings

+ {#if $authStore.isAuthenticated} + + {/if} +
+ +
+
+

Theme

+ +
+ + {#if $authStore.isAuthenticated}
-

Theme

- +

Account

+
+ Username: + {$authStore.user?.username || 'Unknown'} +
+ {#if $authStore.user?.email} +
+ Email: + {$authStore.user.email} +
+ {/if}
- {#if $authStore.isAuthenticated} -
-

Account

+
+

Sync

+
+ Status: + {$syncStore.status} +
+
+ Queue: + {$syncStore.queueSize} changes +
+ {#if $syncStore.lastSync}
- Username: - {$authStore.user?.username || 'Unknown'} + Last Sync: + {new Date($syncStore.lastSync * 1000).toLocaleString()}
- {#if $authStore.user?.email} -
- Email: - {$authStore.user.email} -
- {/if} -
- -
-

Sync

-
- Status: - {$syncStore.status} -
-
- Queue: - {$syncStore.queueSize} changes -
- {#if $syncStore.lastSync} -
- Last Sync: - {new Date($syncStore.lastSync * 1000).toLocaleString()} -
- {/if} - - -
- -
-

Actions

- -
- {:else} -
-

API Key Authentication

-

- For testing, you can authenticate with an API key. Generate a key using: - opal server keygen --name "Web" + {/if} + + +

+ {:else} +
+

API Key Authentication

+

+ For testing, you can authenticate with an API key. Generate a key using: + opal server keygen --name "Web" +

+ + + + + +
+

+ Or login with OAuth

- - - - - -
-

- Or login with OAuth -

-
-
- {/if} -
+
+ + {/if}