detached ea6754c

feat(ui): Change start positioning for AIM login window

commit
ea6754c50ebdd6a0e6dca88fa43101d9ed1ebd0e
author
Kit · · 2025-02-18 16:12 UTC
parent
6e4a0f0
signature
SSH UnverifiedSHA256:H91DFuEG4jpk5edzLA4aUKkpv4zv9Q339ipRmkph6Tk The key is unknown
1 file · +18 -9
M src/lib/components/aim-login.svelte +18 -9
@@ -7,6 +7,7 @@
77 import { chatState } from '$lib/states/chat.svelte';
88 import Turnstile from './turnstile.svelte';
99 import { createSafeUser } from '$lib/types/chat';
10+ import { onMount } from 'svelte';
1011
1112 interface $$Props {
1213 showAuth: boolean;
@@ -34,6 +35,23 @@
3435 let signupStatus = $state('idle');
3536 let suTurnstileToken = $state('');
3637
38+ // Added dragging state and handler similar to chat-room
39+ let windowX = $state(0);
40+ let windowY = $state(0);
41+
42+ // Initialize window position on mount
43+ onMount(() => {
44+ if (window.innerWidth > 768) { // Desktop mode
45+ windowX = window.innerWidth * 0.2;
46+ windowY = window.innerHeight * 0.2;
47+ }
48+ });
49+
50+ function handleDragMove(event: CustomEvent<{ x: number; y: number }>) {
51+ windowX = event.detail.x;
52+ windowY = event.detail.y;
53+ }
54+
3755 function handleClose() {
3856 console.debug("Closing AIM Login component.");
3957 showAuth = false;
@@ -221,15 +239,6 @@
221239 handleClose();
222240 }
223241 }
224-
225- // Added dragging state and handler similar to chat-room
226- let windowX = $state(0);
227- let windowY = $state(0);
228-
229- function handleDragMove(event: CustomEvent<{ x: number; y: number }>) {
230- windowX = event.detail.x;
231- windowY = event.detail.y;
232- }
233242 </script>
234243
235244 <svelte:window onkeydown={handleKeydown} />
@@ -7,6 +7,7 @@
7 import { chatState } from '$lib/states/chat.svelte';7 import { chatState } from '$lib/states/chat.svelte';
8 import Turnstile from './turnstile.svelte';8 import Turnstile from './turnstile.svelte';
9 import { createSafeUser } from '$lib/types/chat';9 import { createSafeUser } from '$lib/types/chat';
10+ import { onMount } from 'svelte';
10 11
11 interface $$Props {12 interface $$Props {
12 showAuth: boolean;13 showAuth: boolean;
@@ -34,6 +35,23 @@
34 let signupStatus = $state('idle');35 let signupStatus = $state('idle');
35 let suTurnstileToken = $state('');36 let suTurnstileToken = $state('');
36 37
38+ // Added dragging state and handler similar to chat-room
39+ let windowX = $state(0);
40+ let windowY = $state(0);
41+
42+ // Initialize window position on mount
43+ onMount(() => {
44+ if (window.innerWidth > 768) { // Desktop mode
45+ windowX = window.innerWidth * 0.2;
46+ windowY = window.innerHeight * 0.2;
47+ }
48+ });
49+
50+ function handleDragMove(event: CustomEvent<{ x: number; y: number }>) {
51+ windowX = event.detail.x;
52+ windowY = event.detail.y;
53+ }
54+
37 function handleClose() {55 function handleClose() {
38 console.debug("Closing AIM Login component.");56 console.debug("Closing AIM Login component.");
39 showAuth = false;57 showAuth = false;
@@ -221,15 +239,6 @@
221 handleClose();239 handleClose();
222 }240 }
223 }241 }
224-
225- // Added dragging state and handler similar to chat-room
226- let windowX = $state(0);
227- let windowY = $state(0);
228-
229- function handleDragMove(event: CustomEvent<{ x: number; y: number }>) {
230- windowX = event.detail.x;
231- windowY = event.detail.y;
232- }
233 </script>242 </script>
234 243
235 <svelte:window onkeydown={handleKeydown} />244 <svelte:window onkeydown={handleKeydown} />

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 3

Tags 8

↑↓ moveenter openesc close