detached df23202

refactor(toast): migrate from tailwind to inline styles for shadow dom compatibility

commit
df232026d1628f74a0864ee9eec143c1406a1e82
author
bamen · · 2025-09-16 08:13 UTC
parent
c18691d
signature
unsigned
2 files · +48 -6
M gui/src/components/toast/Toast.svelte +30 -1
@@ -52,9 +52,38 @@
5252 aria-label="Dismiss notification"
5353 title="Click to dismiss"
5454 >
55- <div class="w-full min-w-36 px-5 py-4 text-center text-white font-semibold text-sm rounded-xl shadow-2xl backdrop-blur-md border transition-all duration-250 {type === 'success' ? 'bg-gradient-to-br from-green-500/90 to-green-700/90 border-green-300/30' : type === 'error' ? 'bg-gradient-to-br from-red-500/90 to-red-700/90 border-red-300/30' : 'bg-gradient-to-br from-blue-500/90 to-blue-700/90 border-blue-300/30'}">
55+ <div class="toast-content">
5656 {message || 'Notification'}
5757 </div>
58+ <style>
59+ .toast-content {
60+ width: 100%;
61+ min-width: 9rem; /* ~min-w-36 */
62+ padding: 1rem 1.25rem; /* px-5 py-4 */
63+ text-align: center;
64+ color: #fff;
65+ font-weight: 600;
66+ font-size: 0.875rem; /* text-sm */
67+ border-radius: 0.75rem; /* rounded-xl */
68+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); /* shadow-2xl */
69+ backdrop-filter: blur(6px);
70+ border: 1px solid rgba(255,255,255,0.18);
71+ transition: all 250ms ease;
72+ }
73+
74+ .toast-success .toast-content {
75+ background: linear-gradient(135deg, rgba(34,197,94,0.9), rgba(21,128,61,0.9));
76+ border-color: rgba(134,239,172,0.3);
77+ }
78+ .toast-error .toast-content {
79+ background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(185,28,28,0.9));
80+ border-color: rgba(252,165,165,0.3);
81+ }
82+ .toast-info .toast-content {
83+ background: linear-gradient(135deg, rgba(59,130,246,0.9), rgba(29,78,216,0.9));
84+ border-color: rgba(147,197,253,0.3);
85+ }
86+ </style>
5887 </button>
5988
6089 <style>
@@ -52,9 +52,38 @@
52 aria-label="Dismiss notification"52 aria-label="Dismiss notification"
53 title="Click to dismiss"53 title="Click to dismiss"
54 >54 >
55- <div class="w-full min-w-36 px-5 py-4 text-center text-white font-semibold text-sm rounded-xl shadow-2xl backdrop-blur-md border transition-all duration-250 {type === 'success' ? 'bg-gradient-to-br from-green-500/90 to-green-700/90 border-green-300/30' : type === 'error' ? 'bg-gradient-to-br from-red-500/90 to-red-700/90 border-red-300/30' : 'bg-gradient-to-br from-blue-500/90 to-blue-700/90 border-blue-300/30'}">55+ <div class="toast-content">
56 {message || 'Notification'}56 {message || 'Notification'}
57 </div>57 </div>
58+ <style>
59+ .toast-content {
60+ width: 100%;
61+ min-width: 9rem; /* ~min-w-36 */
62+ padding: 1rem 1.25rem; /* px-5 py-4 */
63+ text-align: center;
64+ color: #fff;
65+ font-weight: 600;
66+ font-size: 0.875rem; /* text-sm */
67+ border-radius: 0.75rem; /* rounded-xl */
68+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); /* shadow-2xl */
69+ backdrop-filter: blur(6px);
70+ border: 1px solid rgba(255,255,255,0.18);
71+ transition: all 250ms ease;
72+ }
73+
74+ .toast-success .toast-content {
75+ background: linear-gradient(135deg, rgba(34,197,94,0.9), rgba(21,128,61,0.9));
76+ border-color: rgba(134,239,172,0.3);
77+ }
78+ .toast-error .toast-content {
79+ background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(185,28,28,0.9));
80+ border-color: rgba(252,165,165,0.3);
81+ }
82+ .toast-info .toast-content {
83+ background: linear-gradient(135deg, rgba(59,130,246,0.9), rgba(29,78,216,0.9));
84+ border-color: rgba(147,197,253,0.3);
85+ }
86+ </style>
58 </button>87 </button>
59 88
60 <style>89 <style>
M gui/src/components/toast/ToastContainer.svelte +18 -5
@@ -124,7 +124,22 @@
124124 });
125125 </script>
126126
127-<div class="fixed top-5 left-5 z-[2147483647] pointer-events-none flex flex-col gap-2 max-w-80 visible opacity-100 backdrop-blur-sm">
127+<div
128+ class="toast-container"
129+ style="
130+ position: fixed;
131+ top: 20px;
132+ left: 20px;
133+ z-index: 2147483647;
134+ pointer-events: none;
135+ display: flex;
136+ flex-direction: column;
137+ gap: 8px;
138+ max-width: 320px;
139+ opacity: 1;
140+ backdrop-filter: blur(2px);
141+ "
142+>
128143 {#each toasts as toast (toast.id)}
129144 <Toast
130145 id={toast.id}
@@ -137,8 +152,6 @@
137152 </div>
138153
139154 <style>
140- :global(.toast-base) {
141- pointer-events: auto;
142- will-change: transform, opacity;
143- }
155+ .toast-container { contain: layout style; }
156+ /* The Toast button handles its own pointer events */
144157 </style>⏎̸
@@ -124,7 +124,22 @@
124 });124 });
125 </script>125 </script>
126 126
127-<div class="fixed top-5 left-5 z-[2147483647] pointer-events-none flex flex-col gap-2 max-w-80 visible opacity-100 backdrop-blur-sm">127+<div
128+ class="toast-container"
129+ style="
130+ position: fixed;
131+ top: 20px;
132+ left: 20px;
133+ z-index: 2147483647;
134+ pointer-events: none;
135+ display: flex;
136+ flex-direction: column;
137+ gap: 8px;
138+ max-width: 320px;
139+ opacity: 1;
140+ backdrop-filter: blur(2px);
141+ "
142+>
128 {#each toasts as toast (toast.id)}143 {#each toasts as toast (toast.id)}
129 <Toast144 <Toast
130 id={toast.id}145 id={toast.id}
@@ -137,8 +152,6 @@
137 </div>152 </div>
138 153
139 <style>154 <style>
140- :global(.toast-base) {155+ .toast-container { contain: layout style; }
141- pointer-events: auto;156+ /* The Toast button handles its own pointer events */
142- will-change: transform, opacity;
143- }
144 </style>⏎̸157 </style>⏎̸

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close