v0.1 64c03e0

desktop-icons.svelte RawHistoryFolder

1<script lang="ts">
2    let { showChatRoom = $bindable(), showAuth = $bindable() } = $props();
3
4    function handleKeydown(event: KeyboardEvent, action: () => void) {
5        if (event.key === 'Enter' || event.key === ' ') {
6            event.preventDefault();
7            action();
8        }
9    }
10
11    function handleChatRoomClick() {
12        console.log('handleChatRoomClick');
13        showChatRoom = true
14    }
15
16    function handleAuthClick() {
17        console.log('handleAuthClick');
18        showAuth = true;
19    }
20</script>
21
22<div class="desktop-icons">
23    <div 
24        class="desktop-icon" 
25        ondblclick={handleChatRoomClick}
26        onkeydown={(e) => handleKeydown(e, handleChatRoomClick)}
27        role="button" 
28        tabindex="0"
29    >
30        <img src="/desktop/aim-desktop-icon.png" alt="Chat Room" />
31        <span class="icon-label">Pdr Aim</span>
32    </div>
33    
34    <div 
35        class="desktop-icon" 
36        ondblclick={handleAuthClick}
37        onkeydown={(e) => handleKeydown(e, handleAuthClick)}
38        role="button" 
39        tabindex="0"
40    >
41        <img src="/desktop/application-x-shellscript.png" alt="Sign In" />
42        <span class="icon-label">login</span>
43    </div>
44</div>
45
46<style>
47    .desktop-icons {
48        position: fixed;
49        top: 20px;
50        left: 20px;
51        display: flex;
52        flex-direction: column;
53        gap: 20px;
54    }
55
56    .desktop-icon {
57        display: flex;
58        flex-direction: column;
59        align-items: center;
60        cursor: pointer;
61        width: 75px;
62        text-align: center;
63        padding: 8px;
64        border: 1px dotted transparent;
65        border-radius: 2px;
66        margin: 2px;
67    }
68
69    .desktop-icon:hover, .desktop-icon:focus {
70        background: rgba(49, 106, 197, 0.2);
71        border: 1px dotted rgba(255, 255, 255, 0.8);
72        outline: 1px solid rgba(49, 106, 197, 0.6);
73        outline-offset: -1px;
74    }
75
76    .desktop-icon:active {
77        background: rgba(49, 106, 197, 0.4);
78    }
79
80    .desktop-icon img {
81        width: 48px;
82        height: 48px;
83        margin-bottom: 5px;
84        pointer-events: none; /* Prevents image from interfering with hover */
85    }
86
87    .icon-label {
88        color: white;
89        text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
90        font-size: 12px;
91        user-select: none;
92        pointer-events: none; /* Prevents text from interfering with hover */
93        max-width: 100%;
94        overflow-wrap: break-word;
95    }
96</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 3

Tags 8

↑↓ moveenter openesc close