Skip to content

Conversation

@sosweetham
Copy link
Member

@sosweetham sosweetham commented Jan 21, 2026

Description of change

aims to fix chat sorting and evoting interactive text visibility

Issue Number

Closes #451
Closes #634

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

n/a

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • Bug Fixes

    • Anchor links in messages now render correctly with preserved attributes and explicit cursor styling
    • Chat list sorting improved to prioritize most recent activity
    • Chat activity timestamps now refresh when new messages are sent
  • Style

    • Minor formatting adjustments to message components

✏️ Tip: You can customize this high-level summary in your review settings.

@sosweetham sosweetham requested a review from coodos as a code owner January 21, 2026 05:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

The PR updates anchor tag rendering in chat messages to preserve HTML attributes and add a cursor-pointer class for visual feedback. It also implements a getMostRecentTimestamp helper function to standardize chat sorting by recent activity across Blabsy and Pictique, and refreshes updatedAt timestamps when messages are sent to ensure consistent chat ordering.

Changes

Cohort / File(s) Change Summary
Anchor Tag Rendering
platforms/blabsy/src/components/chat/chat-window.tsx, platforms/pictique/src/lib/fragments/ChatMessage/ChatMessage.svelte
Updated anchor regex from <a href="URL">text</a> to <a href="URL"[attributes]>text</a> to capture and preserve additional HTML attributes; added cursor-pointer class to anchors for visual clickability feedback; reference to display text shifted to third capture group.
Chat Sorting & Timestamps
platforms/blabsy/src/lib/context/chat-context.tsx, platforms/pictique-api/src/services/ChatService.ts
Introduced getMostRecentTimestamp helper that prioritizes: lastMessage.timestamp → updatedAt → createdAt for determining chat recency; replaced conditional branch sorting with uniform timestamp comparison; ChatService now explicitly refreshes updatedAt on message send and sorts messages by createdAt ascending before selecting most recent.
Settings Formatting
platforms/pictique/src/routes/(protected)/settings/account/username/+page.svelte
Reorganized Input component props from single-line to multiline block format; no behavioral changes.

Sequence Diagram

sequenceDiagram
    participant User
    participant Client
    participant ChatService
    participant ChatContext
    participant UI as Chat List UI

    User->>Client: Send message
    Client->>ChatService: sendMessage()
    ChatService->>ChatService: Append message to chat
    ChatService->>ChatService: Refresh chat.updatedAt to current time
    ChatService->>ChatService: Extract most recent timestamp<br/>(via getMostRecentTimestamp)
    ChatService->>ChatService: Sort chats by timestamp descending
    ChatService-->>Client: Return sorted chats
    Client->>ChatContext: Update chat state
    ChatContext->>UI: Re-render with updated<br/>chat order
    UI-->>User: Display chat list with sender's<br/>chat moved to top
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • coodos
  • JulienAuvo

Poem

🐰 Anchors now sparkle with pointer's delight,
Chats bubble to top when messages ignite,
Timestamps aligned across both grand halls,
Fresh sorting ensures no update falls,
Click here, vote now—visibility calls! 🗳️✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix/chat-sort-and-links' is directly related to the main changes: fixing chat sorting behavior and making links more interactive/visible.
Description check ✅ Passed The PR description includes all required template sections: change description, issue numbers, type of change, testing approach, and completed checklist items.
Linked Issues check ✅ Passed The PR addresses both linked issues: #451 (making 'Cast your vote here' a clickable link via regex anchor improvements) and #634 (implementing timestamp-based chat sorting that prioritizes recent activity across all chat types).
Out of Scope Changes check ✅ Passed All changes are in scope: anchor tag styling updates for #451, chat sorting logic refactors for #634, and one formatting-only change to settings page that is tangential but acceptable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coodos coodos merged commit 4f3f912 into main Jan 21, 2026
4 checks passed
@coodos coodos deleted the fix/chat-sort-and-links branch January 21, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Chat order in Blabsy and Pictique Make the text "Cast your vote here" a clickable link to the voting page

3 participants