v0.1.4 2490b00

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