From 7b8feee99a79ee5c2eb88323205687662a20051e Mon Sep 17 00:00:00 2001 From: 3252a8 <3252a8@proton.me> Date: Wed, 3 Jun 2026 12:40:57 +0300 Subject: [PATCH] feat: smooth sortable row interactions --- backend/bot/app/web/themes/ascii/style.css | 11 ++ backend/bot/app/web/themes/light/style.css | 13 ++- .../bot/app/web/themes/windows95/style.css | 10 ++ .../src/lib/components/ui/sortable.svelte | 108 ++++++++++++++++-- tests/test_webapp_assets.py | 1 + 5 files changed, 135 insertions(+), 8 deletions(-) diff --git a/backend/bot/app/web/themes/ascii/style.css b/backend/bot/app/web/themes/ascii/style.css index 3d21c78..b96b94d 100644 --- a/backend/bot/app/web/themes/ascii/style.css +++ b/backend/bot/app/web/themes/ascii/style.css @@ -353,6 +353,8 @@ } .theme-key-ascii .ui-sortable { + --sortable-drop-line: #ffffff; + --sortable-drop-soft: rgba(255, 255, 255, 0.08); gap: 6px; } @@ -364,6 +366,15 @@ outline: 1px dashed #ffffff; outline-offset: 2px; background: rgba(255, 255, 255, 0.08); + box-shadow: none; +} + +.theme-key-ascii .ui-sortable-item.is-drop-target::before { + top: -5px; + height: 1px; + border-radius: 0; + background: #ffffff; + box-shadow: none; } .theme-key-ascii .ui-sortable-handle { diff --git a/backend/bot/app/web/themes/light/style.css b/backend/bot/app/web/themes/light/style.css index 213309c..d78fa3b 100644 --- a/backend/bot/app/web/themes/light/style.css +++ b/backend/bot/app/web/themes/light/style.css @@ -236,9 +236,20 @@ body:has(.theme-key-light) .install-platform-item[data-selected] { color: color-mix(in srgb, var(--accent) 58%, #0f172a); } +.theme-key-light .ui-sortable { + --sortable-drop-line: color-mix(in srgb, var(--accent) 64%, #0f172a); +} + .theme-key-light .ui-sortable-item.is-drop-target { - outline-color: color-mix(in srgb, var(--accent) 48%, #0f172a); background: color-mix(in srgb, var(--accent) 8%, #ffffff); + box-shadow: + inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent), + 0 10px 22px color-mix(in srgb, var(--accent) 7%, transparent); +} + +.theme-key-light .ui-sortable-item.is-drop-target::before { + background: var(--sortable-drop-line); + box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); } /* Telegram notifications banner: keep the warm warning tint but swap the diff --git a/backend/bot/app/web/themes/windows95/style.css b/backend/bot/app/web/themes/windows95/style.css index 3e106d9..0d3ad91 100644 --- a/backend/bot/app/web/themes/windows95/style.css +++ b/backend/bot/app/web/themes/windows95/style.css @@ -1231,6 +1231,16 @@ body:has(.theme-key-windows95) .install-platform-item[data-selected] { background: color-mix(in srgb, var(--accent) 12%, var(--admin-surface)); } +.theme-key-windows95 .ui-sortable-item.is-drop-target::before { + top: -7px; + height: 2px; + border-radius: 0; + background: #000080; + box-shadow: + 0 1px 0 #ffffff, + 0 -1px 0 #000000; +} + .theme-key-windows95 .ui-sortable-handle { align-self: center; width: 24px; diff --git a/frontend/src/lib/components/ui/sortable.svelte b/frontend/src/lib/components/ui/sortable.svelte index 646d3a5..7040022 100644 --- a/frontend/src/lib/components/ui/sortable.svelte +++ b/frontend/src/lib/components/ui/sortable.svelte @@ -1,4 +1,6 @@ -
+
{#each items as item, index (getKey(item, index))}
handleDragOver(event, index)} on:drop={(event) => handleDrop(event, index)} on:dragend={reset} @@ -67,7 +92,9 @@ type="button" class="ui-sortable-handle" draggable={!disabled} + {disabled} aria-label={handleLabel} + aria-grabbed={dragIndex === index} title={handleLabel} on:dragstart={(event) => handleDragStart(event, index)} > @@ -80,19 +107,54 @@ diff --git a/tests/test_webapp_assets.py b/tests/test_webapp_assets.py index c7b7c24..6a4e14a 100644 --- a/tests/test_webapp_assets.py +++ b/tests/test_webapp_assets.py @@ -576,6 +576,7 @@ class WebAppAssetTests(unittest.IsolatedAsyncioTestCase): "ui-sortable-item", "ui-sortable-handle", "is-drop-target", + "ui-sortable-item.is-drop-target::before", ) for key in ("light", "ascii", "windows95"):