Commit Graph

13 Commits (e76049a3538034c43f870cbc91899b2cb6fa60b4)

Author SHA1 Message Date
Joca e76049a353
Chat: Add draft auto-save to localStorage with restore and discard options
- Add draft management functions to app.js (saveDraft, loadDraft, clearDraft, getDraftTimestamp)
- Implement draft auto-save in chat that saves every 2 seconds after typing stops
- Show draft restoration banner on page load if draft exists and is less than 7 days old
- Display draft age with "X minutes/hours/days ago" format
- Add Restore and Discard buttons to draft indicator
- Clear draft automatically after successfully sending a message
- Add draft indicator styles matching beige/blue/pink theme with cyan restore button
- Support dark mode with appropriate color adjustments
- Draft indicator slides in from top with smooth animation

Draft key format: draft_chat_{boardId} for per-board draft storage.
2026-01-15 23:23:12 -03:00
Joca 83113a563a
Chat: Fix message duplication by removing optimistic UI for sent messages
- Remove optimistic message rendering that was causing duplicates
- Messages now only appear after server broadcast confirmation
- Simplify appendMessage() to check for existing message IDs and prevent duplicates
- Remove message delivery status indicators (sending/sent/failed)
- Add user alert when attempting to send while disconnected

This fixes the issue where messages appeared twice - once as an optimistic
temporary message and again when the server broadcast was received.
2026-01-15 23:05:00 -03:00
Joca 935446280f
Chat: Add real-time connection status, typing indicators, smart scrolling, and message delivery status
Features added:
- Connection status indicator (green=connected, yellow=connecting, red=disconnected)
- Exponential backoff reconnection (1s → 2s → 4s → ... → 30s max)
- Typing indicators showing who is typing (up to 3 users, with overflow count)
- Message status (⋯ sending, ✓ sent, ✗ failed with retry option)
- Jump-to-bottom button with unread message count badge
- Smart scroll preservation (stays in place unless already at bottom)
- Optimistic UI for sent messages (appears immediately, updates with real status)
- Backend support for broadcasting typing events to other users
2026-01-15 23:00:31 -03:00
Joca d36d0d46fd
UI: Add breadcrumb navigation to chat page
- Breadcrumb bar above chat header (Home › Boards › Chat Name)
- Styled to match chat container with themed colors
- Includes dark mode support
2026-01-15 22:50:58 -03:00
Joca 00185e6774
UI: Fix word wrapping for long text content
- Add word-wrap and overflow-wrap to all content areas
- Prevents horizontal overflow on long words/URLs
- Fixes layout breaking with continuous text (e.g., 'owohhh...')
- Applied to post content, chat messages, lists, and paragraphs
2026-01-15 22:44:49 -03:00
Joca 7b934e00a6
Chat: Add Markdown support
Using RegEx because It's easier.
We will change to another solution if this proves to be a problem.
2025-09-05 22:09:17 -03:00
Joca e18d7ba193
Chat: Highlight a message if the current user is mentioned 2025-08-29 14:48:38 -03:00
Joca 3a82e2a0d1
All: Migrate boards from global to board specific
Massive commit. Rewrites some of the chat logic to work individually
rather than a global chat.
2025-08-22 00:07:13 -03:00
Joca b1db26af16
Chat: Highlight user mentions even after page reload 2025-08-09 21:05:01 -03:00
Joca d3db9723ec
chat: polish mention system
We now have a proper autocomplete. Next on the list is moving the chat page into it's proper place and add pop-ups for profiles.
2025-08-03 19:21:06 -03:00
Joca 7b0528ef36
feat: Add file-based avatar system
- A new `files` table to store metadata about uploaded files, including original name and hash.
- The `users` table is updated to reference a `pfp_file_id` from the new `files` table, removing the insecure `pfp_url` field.
- A new `/file` endpoint and handler (`handlers/file.go`) are created to serve files securely based on their ID, preventing direct file system access.
- Profile editing (`handlers/profile_edit.go` and `templates/pages/profile_edit.html`) is updated to handle file uploads instead of URL inputs.
- The chat feature (`models/chat.go` and `templates/pages/chat.html`) is updated to work with the new file ID system, ensuring avatars are displayed correctly.
Should also fix #68.
2025-06-21 16:21:21 -03:00
Joca cb9022d8bd Fixing that reply interface. 2025-06-15 02:47:16 +02:00
Joca 3b56c7e831 Initial implementation of the chat feature. 2025-06-15 02:47:16 +02:00