From fe8b93e8a88f5d2b14197323a7456594fa4aec16 Mon Sep 17 00:00:00 2001 From: Jonas Weinz Date: Sat, 15 Nov 2025 14:53:13 +0100 Subject: [PATCH] add session management to the ui through cookies --- multiplayer_crosswords/webui/clue_area.js | 4 +- multiplayer_crosswords/webui/grid.js | 39 ++- multiplayer_crosswords/webui/index.html | 6 +- multiplayer_crosswords/webui/keyboard.js | 55 ++-- multiplayer_crosswords/webui/menu.js | 191 ++++++++++++- multiplayer_crosswords/webui/styles.css | 313 ++++++++++++++++++---- multiplayer_crosswords/webui/websocket.js | 12 +- 7 files changed, 527 insertions(+), 93 deletions(-) diff --git a/multiplayer_crosswords/webui/clue_area.js b/multiplayer_crosswords/webui/clue_area.js index fd2ce4a..aff5db3 100644 --- a/multiplayer_crosswords/webui/clue_area.js +++ b/multiplayer_crosswords/webui/clue_area.js @@ -388,7 +388,7 @@ export class ClueArea extends LitElement {
${currentClue ? html`
- ${currentClue.number}. ${currentClue.direction} + ${currentClue.direction === 'across' ? '▶' : '▼'} ${currentClue.number}
${currentClue.text}
` : html` @@ -396,7 +396,7 @@ export class ClueArea extends LitElement { `}
-
Show all clues:
+
Clues:
+
+ +
+ + ${this._savedSessions.length > 0 ? html` +
+

Recent Sessions

+
+ ${this._savedSessions.map(session => html` +
+
+ ${session.id.substring(0, 8)}... + ${this._formatTimestamp(session.timestamp)} + ${session.language ? html`${session.language.toUpperCase()}` : ''} +
+
+ + +
+
+ `)} +
+ +
+ ` : ''} +
- 📋 Data & Privacy + ▶ 📋 Data Usage for the Multiplayer functionality