detached e52fcc0

style: format SSE files with prettier

commit
e52fcc07b29eff722070620a36b3b24906cb86bd
author
Kit · · 2025-12-15 10:50 UTC
parent
6c2663e
signature
SSH UnverifiedSHA256:H91DFuEG4jpk5edzLA4aUKkpv4zv9Q339ipRmkph6Tk The key is unknown
3 files · +18 -13
M src/lib/sse/SSEClient.svelte.ts +1 -3
@@ -241,9 +241,7 @@ export class SSEClient {
241241 this._reconnectAttempts++;
242242
243243 const delay = this.calculateBackoff();
244- console.debug(
245- `[SSEClient] Reconnecting in ${delay}ms (attempt ${this._reconnectAttempts})`
246- );
244+ console.debug(`[SSEClient] Reconnecting in ${delay}ms (attempt ${this._reconnectAttempts})`);
247245
248246 this.reconnectTimer = setTimeout(() => {
249247 this.connect();
@@ -241,9 +241,7 @@ export class SSEClient {
241 this._reconnectAttempts++;241 this._reconnectAttempts++;
242 242
243 const delay = this.calculateBackoff();243 const delay = this.calculateBackoff();
244- console.debug(244+ console.debug(`[SSEClient] Reconnecting in ${delay}ms (attempt ${this._reconnectAttempts})`);
245- `[SSEClient] Reconnecting in ${delay}ms (attempt ${this._reconnectAttempts})`
246- );
247 245
248 this.reconnectTimer = setTimeout(() => {246 this.reconnectTimer = setTimeout(() => {
249 this.connect();247 this.connect();
M src/lib/sse/SSEManager.ts +10 -2
@@ -136,7 +136,11 @@ class SSEManager {
136136 * Remove a connection
137137 * @returns Whether this was the last connection for the user
138138 */
139- removeConnection(connectionId: string): { removed: boolean; isLastConnection: boolean; userId: string | null } {
139+ removeConnection(connectionId: string): {
140+ removed: boolean;
141+ isLastConnection: boolean;
142+ userId: string | null;
143+ } {
140144 const connection = this.connections.get(connectionId);
141145 if (!connection) {
142146 return { removed: false, isLastConnection: false, userId: null };
@@ -360,7 +364,11 @@ class SSEManager {
360364 /**
361365 * Get connection statistics
362366 */
363- getStats(): { totalConnections: number; uniqueUsers: number; queueStats: { rooms: number; totalMessages: number } } {
367+ getStats(): {
368+ totalConnections: number;
369+ uniqueUsers: number;
370+ queueStats: { rooms: number; totalMessages: number };
371+ } {
364372 return {
365373 totalConnections: this.connections.size,
366374 uniqueUsers: this.userConnections.size,
@@ -136,7 +136,11 @@ class SSEManager {
136 * Remove a connection136 * Remove a connection
137 * @returns Whether this was the last connection for the user137 * @returns Whether this was the last connection for the user
138 */138 */
139- removeConnection(connectionId: string): { removed: boolean; isLastConnection: boolean; userId: string | null } {139+ removeConnection(connectionId: string): {
140+ removed: boolean;
141+ isLastConnection: boolean;
142+ userId: string | null;
143+ } {
140 const connection = this.connections.get(connectionId);144 const connection = this.connections.get(connectionId);
141 if (!connection) {145 if (!connection) {
142 return { removed: false, isLastConnection: false, userId: null };146 return { removed: false, isLastConnection: false, userId: null };
@@ -360,7 +364,11 @@ class SSEManager {
360 /**364 /**
361 * Get connection statistics365 * Get connection statistics
362 */366 */
363- getStats(): { totalConnections: number; uniqueUsers: number; queueStats: { rooms: number; totalMessages: number } } {367+ getStats(): {
368+ totalConnections: number;
369+ uniqueUsers: number;
370+ queueStats: { rooms: number; totalMessages: number };
371+ } {
364 return {372 return {
365 totalConnections: this.connections.size,373 totalConnections: this.connections.size,
366 uniqueUsers: this.userConnections.size,374 uniqueUsers: this.userConnections.size,
M src/routes/api/sse/+server.ts +7 -8
@@ -64,12 +64,7 @@ function startTimeoutCheck() {
6464 status: 'offline',
6565 lastSeen: now
6666 })
67- .where(
68- and(
69- ne(users.status, 'offline'),
70- lt(users.lastSeen, timeoutThreshold)
71- )
72- )
67+ .where(and(ne(users.status, 'offline'), lt(users.lastSeen, timeoutThreshold)))
7368 .returning({
7469 id: users.id,
7570 nickname: users.nickname,
@@ -347,7 +342,11 @@ export const GET: RequestHandler = async ({ request, locals }) => {
347342 if (cleanupListener) cleanupListener();
348343
349344 const maskedUserId = userId.slice(0, 8);
350- log.info('Connection closed', { userId: maskedUserId, connectionId: connectionId?.slice(0, 8), reason });
345+ log.info('Connection closed', {
346+ userId: maskedUserId,
347+ connectionId: connectionId?.slice(0, 8),
348+ reason
349+ });
351350
352351 // Remove connection from manager
353352 const { isLastConnection } = sseManager.removeConnection(connectionId);
@@ -379,7 +378,7 @@ export const GET: RequestHandler = async ({ request, locals }) => {
379378 headers: {
380379 'Content-Type': 'text/event-stream',
381380 'Cache-Control': 'no-cache',
382- 'Connection': 'keep-alive',
381+ Connection: 'keep-alive',
383382 'X-Accel-Buffering': 'no' // Disable nginx buffering
384383 }
385384 });
@@ -64,12 +64,7 @@ function startTimeoutCheck() {
64 status: 'offline',64 status: 'offline',
65 lastSeen: now65 lastSeen: now
66 })66 })
67- .where(67+ .where(and(ne(users.status, 'offline'), lt(users.lastSeen, timeoutThreshold)))
68- and(
69- ne(users.status, 'offline'),
70- lt(users.lastSeen, timeoutThreshold)
71- )
72- )
73 .returning({68 .returning({
74 id: users.id,69 id: users.id,
75 nickname: users.nickname,70 nickname: users.nickname,
@@ -347,7 +342,11 @@ export const GET: RequestHandler = async ({ request, locals }) => {
347 if (cleanupListener) cleanupListener();342 if (cleanupListener) cleanupListener();
348 343
349 const maskedUserId = userId.slice(0, 8);344 const maskedUserId = userId.slice(0, 8);
350- log.info('Connection closed', { userId: maskedUserId, connectionId: connectionId?.slice(0, 8), reason });345+ log.info('Connection closed', {
346+ userId: maskedUserId,
347+ connectionId: connectionId?.slice(0, 8),
348+ reason
349+ });
351 350
352 // Remove connection from manager351 // Remove connection from manager
353 const { isLastConnection } = sseManager.removeConnection(connectionId);352 const { isLastConnection } = sseManager.removeConnection(connectionId);
@@ -379,7 +378,7 @@ export const GET: RequestHandler = async ({ request, locals }) => {
379 headers: {378 headers: {
380 'Content-Type': 'text/event-stream',379 'Content-Type': 'text/event-stream',
381 'Cache-Control': 'no-cache',380 'Cache-Control': 'no-cache',
382- 'Connection': 'keep-alive',381+ Connection: 'keep-alive',
383 'X-Accel-Buffering': 'no' // Disable nginx buffering382 'X-Accel-Buffering': 'no' // Disable nginx buffering
384 }383 }
385 });384 });

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