Skip to content

Abdulrahman 5th PR: Full Messaging System – MVP with Chat, UI Interactions, and Data#121

Merged
AbdulAlharbi merged 27 commits intomainfrom
Messaging_System_Prototype(MVP)
Apr 5, 2025
Merged

Abdulrahman 5th PR: Full Messaging System – MVP with Chat, UI Interactions, and Data#121
AbdulAlharbi merged 27 commits intomainfrom
Messaging_System_Prototype(MVP)

Conversation

@AbdulAlharbi
Copy link
Contributor

@AbdulAlharbi AbdulAlharbi commented Apr 3, 2025

Abdulrahman 5th PR: Full Messaging System – MVP with Chat, UI Interactions, and Data

Implement LessonConnect Messaging Feature (MVP) with chat list, conversation window, toggles, role-based labeling, and mock data for future backend integration.


Branch: messaging_system_prototype-mvp


Overview

What does this PR do?

This PR implements a full-featured messaging system for LessonConnect, allowing students and tutors to communicate within a modern, responsive UI. It introduces the core messaging interface (chat list, conversation window, contact info panel) alongside key front-end functionalities such as search, toggleable sidebars, read receipts, and role-based labeling.

While no real-time or backend functionality is included yet, clear // TODO placeholders mark where future API calls, WebSocket integration, or database logic will be added. This MVP is fully aligned with our DP1 prototype and sets the stage for robust, real-time communication in subsequent releases.


Key Features & Changes

Core Messaging Implementation

  • Chat List Panel: Displays a list of conversations with avatars, last messages, and unread badges. (Issue #116)
  • Main Conversation Window: Message bubbles aligned left/right with timestamps, read receipts, and a typing indicator. (Issue #117)
  • Search Bar: Filters the chat list by name or partial match on last message text.
  • Toggle Sidebars: Collapse/expand both the left chat list and the right contact info panel for smaller screens.
  • Contact Info Panel: Displays role-based labeling, status, email, joined date, and location. (Issues #116 & #118)

Interactive UI Elements

  • New Chat Button: Clear “+ New Chat” label to start a new conversation (placeholder alert for now).
  • Mute / Block / Report: Action buttons in the contact panel with placeholders for future logic.
  • Read Receipts: Sent messages show a check mark once “read” (simulated).
  • Responsive Layout: Smoothly adapts from desktop to mobile, with a hamburger toggle for the chat list.

Styling & UX

  • Uses Chat.css with a friendly teacher/student color scheme (soft purples/blues).
  • Subtle gradients, hover effects, and animations provide a modern feel.
  • Scoped styling under .chat-page to avoid conflicts with other components.

Why This Is Needed

What problem does this solve?

Students and tutors need a straightforward messaging interface within LessonConnect. Previously, there was only a basic placeholder UI. This PR implements a fully designed MVP for messaging, ensuring the UI and interactions are validated before real-time backend work begins.


Implementation Details

  • Developed using React JSX with local useState for:
    • Message arrays
    • Chat list data
    • Toggling sidebars, search, read receipts, etc.
  • Uses mock data for messages and user info.
  • Multiple // TODO: comments highlight backend integration points (axios calls, WebSocket events, etc.).
  • Message alignment is based on a simple type: "sent" vs. "received" property.
  • Responsive design ensures a collapsible left sidebar (chat list) and right sidebar (user info).

Design Alignment

✅ This feature is based on our DP1 Messaging Prototype, fulfilling key user stories:

  • UC1: View Chat List
  • UC2: Toggle Chat Visibility
  • UC3: Search Chats
  • UC4: Open Conversation
  • UC5: Send Message
  • UC6: Read Receipts
  • UC7: View Contact Info
  • UC8: Role-based Labeling
  • UC9: Message Alignment
  • UC10: Status Indicator
  • UC11: Message Metadata
  • UC12: User Avatar

Additionally, we have Mute/Block/Report placeholders on the contact info panel.


System Breakdown

Actor:

  • User (Student/Tutor) – initiates chat actions

System:

  • LessonConnect Messaging – handles all chat list, conversation, and contact info logic

Related GitHub Issues


Related GitHub Discussion


Prototype

This wireframe represents our LessonConnect Messaging System MVP, designed to guide the front-end implementation.

📄 Prototype Doc

🔹 Initial Wireframe

Chat_Prototype_1

This early low-fidelity mockup outlines the core structure of the messaging interface, including:

  • A chat list panel (left)
  • A conversation window (center)
  • A contact info sidebar (right)
  • Action buttons such as Mute, Block, and Report

🔹 Use Case Mapping Diagram

Prototype_1_1

This annotated version of the prototype maps the implemented features to their corresponding User Cases (UC1–UC12) from our Design Portfolio:

Use Case ID Description
UC1 View Chat List
UC2 Toggle Chat Visibility
UC3 Search Chats
UC4 Open Conversation
UC5 Send Message
UC6 Read Receipts
UC7 View Contact Info
UC8 Role-based Labeling
UC9 Status Indicator
UC10 Message Metadata
UC11 Message Alignment
UC12 User Avatar

These wireframes and mappings helped ensure our implementation stayed aligned with the UX goals and functional requirements outlined in DP1.


UML Diagrams

  • Use Case Diagram

click to open for a better view
messaging_use_case_diagram

The use case diagram models how students and tutors interact with the LessonConnect Messaging System.
Key interactions include:

  • Viewing the chat list and searching messages

  • Opening and toggling conversations

  • Sending messages and seeing read receipts

  • Viewing contact info and status indicators

  • Taking actions such as mute, block, and report
    This diagram aligns with UC1–UC12 from our DP1 prototype and illustrates the feature coverage of this MVP.

  • Sequence Diagram – Send + Simulated Reply

send_simulate_sequence

This sequence diagram captures the flow when a user sends a message and receives a simulated reply:

  1. The User types a message and triggers handleSend() via the ChatComponent
  2. The StateManager updates local message state and renders the new message
  3. The SimulateReplyHandler introduces a delay, shows a "typing..." indicator, and then adds a mock response
  4. The UI updates accordingly to show the simulated reply and mark the sent message as read
    This flow supports testing the frontend messaging experience while backend integration is still pending.

How to Test This PR

  1. Navigate to the messaging page in LessonConnect http://localhost:5173/Chat (make sure to run the frontend along with the local server from the backend perspective)
  2. View the Chat List on the left. Try searching by name or partial text to see the live filter in action.
  3. Toggle the chat list’s visibility using the hamburger icon on smaller screens.
  4. Select a conversation to open it in the main window.
  5. Send a Message using the input field and verify it appears with a timestamp.
  6. Simulated Read Receipts: After a short delay, your sent messages show a check mark and you’ll see a simulated reply.
  7. View Contact Info on the right panel (role, email, status, etc.). Mute, Block, and Report buttons are placeholders.
  8. Test Responsiveness: Resize the window or use dev tools to confirm sidebars collapse properly.
  9. Review the code for clear // TODO: notes for future backend integration.

Files Added/Modified

File Name Description
Chat.jsx Main messaging component — includes chat list, conversation window, toggles, etc.
Chat.css Scoped styling with gradients, transitions, and responsive layout

Screenshots & Visual Evolution

Before (Basic UI)

The original placeholder UI was very minimal ( #85 ) , with a single panel and rudimentary styling:
Before


After (MVP – Current Build)

The new layout features a collapsible chat list, conversation window with aligned bubbles, and a contact info panel:

Screenshot 2025-04-02 at 11 18 25 PM


Future Enhancements

  • Real-time backend integration: WebSockets for live messaging updates.
  • File attachments: Drag-and-drop or upload for sharing documents.
  • Group chats: Support multi-user conversations.
  • Emojis and reactions: Enhance chat richness.
  • Notification system: In-app or push notifications for unread messages.

AI Code Usage

Was AI-generated code used in this PR?

  • Yes
  • No direct AI-generated code was used in this PR

I used ChatGPT and GitHub Copilot as learning tools to research best practices for React UI styling, responsive layout techniques, and chat UI behavior.
Specifically, I studied how chat components are structured in React Native tutorials and modern web-based messaging apps to inform my own implementation.
All code was written manually and adapted independently for LessonConnect, with no copy-paste or automated generation involved.


Checklist for Reviewers

  • Does the UI match the DP1 prototype’s messaging layout and features?
  • Are all placeholders (// TODO) clearly marked for future backend integration?
  • Is the design responsive and user-friendly?
  • Do search, toggles, and read receipts function as described?
  • Is the code well-organized, with state managed locally and CSS properly scoped?

Final Notes

Thanks for reviewing!
If you have any feedback or suggestions, please drop them in the PR comments or in Discussion #119. Let’s continue building out LessonConnect’s messaging experience together.

— Abdulrahman

…(), handleKeyPress(), toggleSidebar(), toggleDetails(), handleSelectChat(), TODO sections for the back end
…ssages, show an avatar if not typing , Show time if not typing , If it's a sent message, show a small read receipt check (UC6)
- Define .chat-page layout, fonts, background, and theming variables
- Add box-sizing reset, remove margin/padding, list styles
- Add .header container styles with gradient background
- Style logo text and search bar with icon
- Add focus effect for input field
- Add .container flex layout with padding and spacing
- Style sidebar width, background, transitions
- Add top bar, heading, and button styles
- Implement open/closed toggle transforms
- Style .chat-item list: layout, hover effects, active state
- Add avatar and meta info (name, snippet, time, badge)
- Style .chat-window container with header and border
- Add chat-with section, toggle button, and action buttons
- Add flex alignment for .message
- Style .message-content based on direction (sent/received)
- Add timestamps, read receipt, and typing indicator
- Add layout for .chat-input-area
- Style input field, icon buttons, send button with hover effects
- Style .details-sidebar and .details-card
- Add styles for info blocks and action buttons
- Collapse layout on small screens
- Adjust input widths and sidebar behavior
- Show sidebar toggle button on mobile
@AbdulAlharbi AbdulAlharbi self-assigned this Apr 3, 2025
@AbdulAlharbi AbdulAlharbi added Frontend Issue is primarily frontend related Messaging System Backend Issue is primarily backend related labels Apr 3, 2025
Copy link
Contributor

@Jose-Alarcon1 Jose-Alarcon1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: Full Messaging System – MVP with Chat, UI Interactions, and Data

Here’s my feedback:

What Looks Great

  • The messaging UI is clean, modern, and fully responsive — great work across all screen sizes!

  • Love the smooth interactions: chat list toggles, search bar, and sidebar transitions all feel intuitive.

  • Thoughtful use of useState with mock data lays a solid foundation for backend integration.

  • Really appreciated the use of // TODO: markers for API and WebSocket logic — shows clear planning and intent.

  • Messaging alignment, read receipts, and the "typing..." simulation closely follow the user stories from DP1 — awesome attention to detail!

  • The PR is aligned with all 12 user cases (UC1–UC12) and handles each one as expected

💡 Suggestions for Improvement (if any)

These are just ideas for future iterations:

  • Consider breaking out some logic into smaller components like ChatList.jsx, ConversationView.jsx, etc., for better maintainability as the app grows.

  • Down the line, adding unit tests for critical logic like message rendering or toggling would be a solid enhancement.

  • The timestamp is not very visible. Please fix the background or font color.

  • Try to incorporate an auto scroll to consider the length growth of the messaging system.

🧪 Tested This Feature

I ran the following test steps:

✅ Navigated to the feature/page.
✅ Verified that all new UI elements render correctly.
✅ Tried edge cases (e.g., empty input, window resizing).
✅ Confirmed responsiveness and layout on desktop/mobile.

Everything worked smoothly

🔄 Next Steps

Let me know once backend connections or real-time WebSocket features are added.

🚀 Final Thoughts

Fantastic work on this PR! It’s a real, testable, and polished feature that aligns beautifully with project goals. You’re making strong contributions to Design Portfolio III.

Author: Jose Alarcon

@AbdulAlharbi
Copy link
Contributor Author

Hey @Jose-Alarcon1 !

Thank you so much for the detailed and thoughtful review, Jose — I really appreciate the time you took to test the feature and provide such valuable feedback 🙌

✅ I’ve just pushed a fix for the scrolling issue — the chat window now auto-scrolls smoothly as new messages are added. Great catch!

🛠 I’m currently working on improving the timestamp visibility, along with planning how to break the component into smaller parts like ChatList and ConversationView for better maintainability.

Your feedback is super motivating and spot-on. I’ll definitely keep you posted once backend logic and WebSocket support are added — can’t wait to see it all come together.

Thanks again for the review and encouragement!!

— Abdulrahman 🚀

@AbdulAlharbi
Copy link
Contributor Author

Update for @Jose-Alarcon1 's Review

✅ All suggested changes have been implemented:

  • Auto-scroll behavior is now working as expected.
  • Timestamp visibility has been improved for better readability.
  • ✅ Began modularizing the code structure — components like ChatList and ConversationView are being scoped out for future refactoring.

Thanks again for the valuable review — your feedback helped polish the experience and move us closer to integration readiness! Let me know if you'd like to take another look.

— Abdulrahman

Copy link
Contributor

@FrankFurter123 FrankFurter123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review – Messaging System MVP

Awesome work on this, Abdulrahman! You’ve put together a clean, intuitive messaging system that really brings the LessonConnect vision to life. It follows the DP1 prototype closely and shows you’ve thought through the user flow well.


Highlights & Wins

  • Feature Complete: You hit all the core use cases (UC1–UC12), and each piece feels polished — from contact display to message rendering and role tags.
  • Auto Scroll Added: Jose mentioned auto-scroll as a great addition — and I see you’ve already got it working. Nice job jumping on that enhancement.
  • Great Design Choices: The interface looks great. I love the color scheme and gradient touches — feels warm, modern, and very user-friendly.
  • Responsive UX: The side panel transitions and mobile layout work seamlessly. It feels ready for real user interaction.
  • Realistic Chat Simulation: The typing indicator and delay simulate real-time behavior nicely, giving us a great preview of what the live version will feel like.

Moving Forward

I’ve seen the backend team is actively working on the chat models — once that’s finished, you’ll be able to plug this in and test it live. The way you’ve laid this out should make backend hookup smooth. Looking forward to seeing how it performs with actual user data and API integration.


Suggestions

  • Organize Message Logic: Consider breaking down message handling and panel toggle logic into custom hooks or smaller components to keep it scalable.
  • Accessibility: Adding aria-labels and keyboard nav in future iterations would be great for inclusive UX.
  • Polished Alerts: Replacing browser alerts with modals or toast notifications would improve overall UI consistency.

What I Tested

  • Chat search and message sending
  • Read indicators and typing simulation
  • Contact info
  • Mobile view, sidebar toggles, and UI flow

Final Notes

This is a very good start. I love the direction this is going and can’t wait to see it fully functional with backend support. You’re setting a high bar — keep it up!

I am approving this PR!

  • Franklin

@Jose-Alarcon1 Jose-Alarcon1 self-requested a review April 5, 2025 15:33
@Jose-Alarcon1
Copy link
Contributor

Hello Abdul! I just approved again. You are now ready to merge.

@AbdulAlharbi AbdulAlharbi merged commit b760d96 into main Apr 5, 2025
2 checks passed
@AbdulAlharbi
Copy link
Contributor Author

Final Review Update

Big thanks to @Jose-Alarcon1 and @FrankFurter123 for the awesome reviews!

✅ All requested changes have been implemented:

  • Auto-scroll ✅
  • Timestamp visibility ✅
  • Planning component modularization ✅

I'm really glad the feature resonated with both of you and that it aligns with our DP1 use cases (UC1–UC12). I'm marking this PR as ready to merge.

Next up: backend integration once the chat models are finalized.

Thanks again team — excited to build on this!
— Abdulrahman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend Issue is primarily backend related Frontend Issue is primarily frontend related Messaging System

Projects

None yet

3 participants