Commit Graph
92 Commits
Author SHA1 Message Date
BordedDev 530f9ab27c feat: show reply time indicator when message gap exceeds 20 minutes
Add logic to detect time gaps between consecutive messages from the same user. When the difference between two messages' timestamps exceeds 20 minutes, the later message receives a `long-time` CSS class, causing its timestamp to be displayed persistently alongside the existing `switch-user` rule. The CSS selector `.message:has(+ .message.long-time)` ensures the preceding message's time remains visible when followed by a long-delayed reply.
2025-05-21 22:19:39 +00:00
retoor 7f0aea4afd feat: replace inline chat-input with custom element and migrate autocomplete logic
Refactor the chat input area in web.html to use the new ChatInputElement custom component instead of inline HTML. Move autocomplete handler from a function-based getInputField() to directly attaching to the chat-input element's autoCompletions property. Remove the legacy initInputField function and its associated keydown/input event listeners, consolidating all input behavior into the component. Add the chat-input.js module script to app.html to ensure the custom element is registered globally.
2025-05-16 22:54:15 +00:00
retoor 6a3364d305 feat: batch file uploads into single message and fix attachment image format handling 2025-05-15 22:32:54 +00:00
retoor 3a6da92c86 feat: replace inline online dialog with reusable dialog components and add help modal
Extract the online users dialog from `online.html` into a dedicated `dialog_online.html` template, create a new `dialog_help.html` template with a custom `help-command-list` web component, and add global `<dialog>` styling in `base.css` with centered positioning, backdrop blur, and fade/scale animations. Update `web.html` to include both dialog templates, wire the `/help` autocomplete command to `showHelp()`, and rename the `/online` handler from `showOnlineUsers()` to `showOnline()`.
2025-05-15 21:16:28 +00:00
retoor af7be99ab9 feat: add message edit time limit and broadcast full record on update
- Add `get_seconds_since_last_update` method to `ChannelMessageModel` for age checking
- Reject edits on messages older than 3 seconds in `updateMessageText` RPC handler
- Broadcast full message record (including html) instead of just text in socket event
- Update frontend `updateMessageText` to parse and set innerHTML from received html field
- Fix CSS selector for chat message images to use descendant combinator
- Add 3-second auto-clear timeout for liveType input field
- Prevent liveType submission on trailing newline or space
- Hide empty messages in channel-message event by setting display none
2025-05-15 17:32:40 +00:00
retoor 10b0c3448a feat: add MessageList and UserList web components with load balancer and sync module
Implement MessageList custom element with real-time message text updates and typing glow animation, add UserList component with relative time formatting, introduce LoadBalancer class for backend process management, create DatasetWebSocketView for key-value sync over WebSocket, override save method in ChannelMessageService to render HTML templates, and return channel_message object from ChatService instead of boolean.
2025-05-15 11:18:53 +00:00
retoor 8ff32f9293 fix: reduce image rendering width to 240px and strip query params on fullscreen 2025-05-13 18:35:42 +00:00
retoor 549c98d55b feat: add click-to-expand image overlay with dark backdrop in web chat template
Implement a full-screen image preview overlay triggered by clicking any <img> element inside the messages container. The overlay uses a fixed dark background (rgba(0,0,0,0.9)) and centers the image at up to 90% viewport dimensions. Clicking the overlay dismisses it by removing the element from the DOM.
2025-05-13 18:18:47 +00:00
BordedDev 414cce6c71 feat: add image conversion and resizing via query params in channel attachment view 2025-05-11 23:47:54 +00:00
retoor 8fc126d45a feat: add channel attachment upload and retrieval with dedicated model, mapper, service, and view 2025-05-10 18:38:32 +00:00
retoor bb56df9183 feat: add typing indicator with glow animation and event broadcasting
Implement real-time typing indicator feature across frontend and backend. Add `set_typing` RPC method in `RPCView` that broadcasts typing events with user details to a fixed channel. Introduce `typeLock`, `typeListener`, and `set_typing` method in `App` class to periodically send typing status. Update `Socket` to emit custom events from incoming data. Add CSS `glow` keyframe animation and apply it to user avatars in `web.html` when `set_typing` event is received.
2025-05-10 13:08:28 +00:00
retoor 6d645d5225 fix: add missing timeout delay before focusing input field after upload 2025-05-07 23:10:56 +00:00
retoor 8cfcb9604d fix: add input field focus after layout update on Shift+G shortcut 2025-05-07 23:09:59 +00:00
retoor 09d7e273f6 fix: prevent shift+G layout update when input field is focused 2025-05-07 23:07:42 +00:00
retoor 2b9ae1bdec fix: delay input focus by 500ms after message send to prevent race condition
The focus call for the input field after sending a message is now wrapped in a setTimeout with a 500ms delay. This prevents the focus from being applied before the DOM has fully updated after the new message is rendered, ensuring the cursor reliably lands in the input field for the next keystroke.
2025-05-07 23:04:29 +00:00
retoor 524d86c8c9 feat: auto-focus input field after sending message in chat UI
When a message is sent via Enter key, the input field now automatically regains focus, allowing the user to continue typing without manually clicking back into the text area. This improves the upload and messaging flow by eliminating an extra interaction step.
2025-05-07 23:03:11 +00:00
retoor 6ab89e69f6 fix: correct variable name in Escape key handler from timeout to keyTimeout 2025-05-07 22:59:18 +00:00
retoor c2378a6ffa feat: add keyboard shortcut to scroll to last message on double Escape+G press
Implement a keydown listener that tracks Escape key state and counts subsequent 'G' presses. When Escape is held and 'G' is pressed twice within 300ms, the view scrolls to the last message in the messages container. Also handle Shift+G to trigger layout update via existing updateLayout function.
2025-05-07 22:56:55 +00:00
retoor 2a1b8059d2 feat: dispatch upload event and refocus input field after file upload completes 2025-05-07 22:31:21 +00:00
BordedDev 4164fbd877 feat: add paste and file drop support to web input handler
Implement clipboard paste event listener in initInputField that reads image files from clipboard and triggers upload via the upload-button component. Add drag-and-drop file drop support to the textarea input field for improved user experience.
2025-05-06 21:14:52 +00:00
retoor 976f0eeb68 feat: add request id to context and cache-bust static assets with rid query param 2025-04-02 12:55:18 +00:00
retoor 50afad74f9 fix: remove hidden chat-window element from web template
The diff removes the `<chat-window>` element that was hidden with `display:none` from the web.html template, likely because it is no longer needed or has been replaced by a different component.
2025-04-01 18:23:35 +00:00
retoor f74fcc3ab3 feat: add sticky header and footer layout for mobile viewports under 600px
Add responsive CSS media query for max-width 600px making header position sticky with block display for logo, and make chat-input footer sticky. Change chat-input container from div to footer element in web.html template for semantic HTML structure.
2025-04-01 18:08:01 +00:00
retoor dc21d63f3b feat: add mark_as_read method and remove debug print statements across services and views 2025-03-27 16:28:54 +00:00
retoor ff34706546 feat: replace static logo with dynamic header text block in app layout
- Split header padding into individual properties (top, left, right) in base.css
- Reduce logo font size from 1.5em to 1.2em in base.css
- Hide static "Snek" logo div with inline display:none in app.html
- Add new logo div with block header_text template block in app.html
- Move chat header h2 from web.html into the new header_text block in app.html
2025-03-17 16:01:01 +00:00
retoor 37105cbe9d fix: add block end to scrollIntoView options in chat scroll logic 2025-03-17 08:15:49 +00:00
BordedDev e12d3b7c5d feat: convert JavaScript classes to ES modules with export/import across app and templates
Convert all JavaScript classes in app.js and schedule.js from implicit globals to ES module exports, add import statements in template scripts for the app instance, and mark all script tags with type="module" to enable module scoping. Also fix a potential null reference in web.html by using optional chaining on lastMessage.scrollIntoView and hoist the lastMessage variable to outer scope for proper closure behavior.
2025-03-15 18:10:52 +00:00
retoor a1902fbfb3 fix: reduce updateTimes interval from 1000ms to 30000ms in web.html template
The setInterval call for the updateTimes function was changed from 1 second to 30 seconds,
reducing the frequency of time display updates in the web interface to lower client-side
processing overhead and network requests.
2025-03-14 22:02:58 +00:00
retoor 6163f8f8d4 fix: prepend blockquote prefix to quoted message in reply function 2025-03-13 19:36:14 +00:00
retoor 210cbc598c fix: correct time display to use container timestamp instead of message timestamp in web template 2025-03-13 18:21:38 +00:00
retoor 8b1a691e33 feat: add reply button to messages that populates textarea with quoted text 2025-03-13 18:15:10 +00:00
retoor f2cda2142c fix: correct dm channel name resolution and add channel member access check
- Fix ChannelMemberModel.get_name() to check channel tag instead of uid for dm detection
- Add fallback to channel member label when channel name is empty
- Handle self-dm edge case in ChannelMemberService.get_dm() with null join
- Update threads template to use channel name and color instead of last message user data
- Add channel membership verification in WebView to return 404 for non-members
- Pass resolved channel member name to web template instead of raw channel label
2025-03-08 07:25:49 +00:00
retoor 51bc07dddc fix: extract sidebar channels into partial template and fix DM channel uid reference 2025-02-22 00:21:44 +00:00
retoor 3b42f59528 feat: replace flat notification sound array with named sound map and add mention detection logic
Refactor NotificationAudio.sounds from a positional array to a named object mapping event types ("message", "mention", "messageOtherChannel", "ping") to distinct audio files. Add three new notification WAV assets for mention, other-channel, and ping sounds. Update the channel-message event handler in web.html to use named sound keys, and introduce extractMentions() and isMentionForSomeoneElse() helpers to differentiate messages mentioning the current user from those mentioning other users, playing the appropriate notification sound for each case.
2025-02-20 23:41:22 +00:00
retoor 547cbe1a23 feat: add mention detection and dedicated sound for user mentions in chat
Add a new `isMention` function that checks if a chat message contains the current user's username, and play the new `mention1.wav` sound (index 1) when a mention is detected instead of the default beep. Also remove redundant dataset attributes from the message element creation in the channel-message event handler.
2025-02-20 23:24:14 +00:00
retoor b301648f02 chore: strip verbose Jinja2 comment block with license and attribution from web.html template 2025-02-17 19:34:24 +00:00
retoor 7de2c1ec3e chore: add MIT license and author comment blocks to web.html template 2025-02-17 19:31:18 +00:00
retoor f808559f10 feat: enable infinite scroll by loading messages before the first visible one
Changed the pagination offset parameter from 1 to 0 in the getMessages RPC call, allowing the chat to load messages that precede the current first message rather than skipping it. This enables seamless infinite scroll behavior when the user scrolls up in the message history.
2025-02-17 19:20:32 +00:00
retoor 0a3eb5bd1e fix: move isLoadingExtra reset after message insertion in scroll handler 2025-02-17 19:17:17 +00:00
retoor f9b89ddf3b fix: invert scroll threshold and add layout update after loading extra messages 2025-02-17 19:00:35 +00:00
retoor 4c84530811 feat: enable infinite scroll by uncommenting scrolled-past-half guard in chat
The `isScrolledPastHalf()` check was previously commented out, causing the chat to always load extra messages regardless of scroll position. This change re-enables the guard and adjusts the threshold from 1/4 to 1/2 of the scrollable height, ensuring new messages are only fetched when the user has scrolled past the midpoint of the current content.
2025-02-17 18:57:48 +00:00
retoor 014a0b7a29 feat: remove scroll position guard to enable infinite loading on any scroll
The conditional check `isScrolledPastHalf()` was commented out, removing the requirement that the user must scroll past the halfway point before extra content loads. Now `isLoadingExtra` is set to `true` immediately when the scroll handler fires, allowing infinite scroll to trigger on any scroll event rather than only after passing the 50% threshold.
2025-02-17 18:49:29 +00:00
retoor 0d0566e48f feat: invert scroll detection logic to load extra messages when near top
The `isScrolledPastHalf` function previously always returned true, causing continuous loading. Now it returns true only when scroll position is within the top quarter of the container, and the `loadExtra` guard condition is negated to trigger loading only when scrolled near the top.
2025-02-17 18:48:03 +00:00
retoor 3db95e9ea2 feat: remove early scroll-lock threshold to enable infinite scroll in chat messages
The `shouldAutoScroll` function previously returned false when the user scrolled past the top 20% of the scrollable area, preventing automatic scroll-to-bottom behavior. By commenting out this conditional block, the function now always returns true, allowing the chat view to continuously auto-scroll to new messages regardless of the user's current scroll position. This enables an infinite-scroll-like behavior where the viewport follows incoming content without interruption.
2025-02-17 18:45:46 +00:00
retoor bec6c0e70f feat: reduce auto-scroll threshold from 80% to 20% of scrollable height
The auto-scroll behavior in the chat messages container now triggers at a much lower scroll position (20% from bottom instead of 80%), allowing users to stay near the bottom of the conversation without being forcibly scrolled down. This enables a more natural infinite scroll experience where new messages only auto-scroll when the user is very close to the bottom of the chat history.
2025-02-17 18:44:31 +00:00
retoor 951e3f6ce0 feat: invert scroll-lock threshold to keep view anchored near bottom
The condition for preventing auto-scroll on new messages was changed from
checking if the user is within the top fifth of the scrollable area to
checking if they are beyond the bottom 80% (i.e., scrolled past 83.3%).
This effectively inverts the logic so that auto-scroll is suppressed only
when the user has scrolled significantly upward, rather than when they are
near the top. The change ensures the chat view remains locked to the latest
message unless the user deliberately scrolls far up.
2025-02-17 18:42:45 +00:00
retoor 6f1223741d feat: adjust auto-scroll threshold from 1/4 to 1/5 of scrollable height
The scroll detection logic in the chat messages container now triggers auto-scrolling
when the user is within the top 20% (1/5) of the remaining scrollable area, instead of
the previous 25% (1/4) threshold. This reduces premature scroll jumps during message
streaming, allowing users to read older content with less interruption.
2025-02-17 18:36:57 +00:00
retoor 88f3630124 feat: reduce auto-scroll threshold from half to quarter of scrollable height
The change modifies the condition in `isNearBottom()` within `web.html` to trigger auto-scroll when the user is within the top quarter of the remaining scrollable area instead of the top half, making the scroll behavior more responsive to new messages appearing at the bottom.
2025-02-17 18:36:45 +00:00
retoor b64f41ddda fix: invert scroll detection condition to enable infinite loading on reaching half page 2025-02-17 18:11:14 +00:00
retoor 40f44c6aca feat: invert scroll detection condition to trigger infinite load only when scrolled past half 2025-02-17 18:09:42 +00:00