/app/alumno/clases/{id_class}.
Opening the chat
On the class detail page, a floating circular button with a chat icon appears in the bottom-right corner (only when neither the chat nor an activity drawer is open). Click it to open the teacher chat as a right-side drawer.There is one conversation thread per student per class. All messages with the teacher for a given class are in a single thread, ordered chronologically.
Chat drawer
The drawer shows:- Header — teacher’s avatar, first name, and last name. An × button closes the drawer.
- Message list — all messages in the thread, scrollable. Student messages appear on the right; teacher messages appear on the left.
- Input area — a text input at the bottom and a send button.
Sending a message
Type your message
Click the text input and type your message. Messages support standard text and punctuation up to 1,000 characters. Emoji and special characters that do not match the allowed Unicode pattern are rejected by the server.
Send
Press Enter or click the send button (paper-plane icon). A loading spinner appears on the button while the request is in flight.
Message structure
Each message in the thread has the following fields:| Field | Type | Description |
|---|---|---|
role | "student" | "teacher" | Who sent the message |
content | string | Message text |
seen | boolean | Whether the recipient has read the message |
seen_at | ISO timestamp or null | When the message was marked as seen |
created_at | ISO timestamp | When the message was sent |
Read receipts
When you open the chat drawer, the app automatically marks all unread teacher messages as seen by callingPOST /api/student/send-seen-message. The seen flag and seen_at timestamp are set on every teacher message in the thread.
For your own messages (role student), the chat footer shows:
- “Visto ” with a double-checkmark icon when the teacher has read it.
- “Enviado: ” when it has been sent but not yet read.
Message history
All messages in the thread load when you open the class detail page (fetched server-side fromclasses_messages). The complete history is shown each time you open the chat drawer — there is no pagination. The drawer auto-scrolls to the bottom on open.
API reference
Send a message
| Field | Type | Description |
|---|---|---|
message | string | Message text (max 1,000 characters) |
id_class | string (UUID) | ID of the class |
403.
Mark teacher messages as seen
| Field | Type | Description |
|---|---|---|
id_class | string (UUID) | ID of the class |
updated is the number of teacher messages that were marked as seen. If all messages were already seen, the endpoint still returns success: true with updated: 0.
Fetch the class chat history
The chat is loaded server-side during the class detail page load, not via a dedicated REST endpoint on the client. The data is available viadata.class_data.chat from the SvelteKit page server load function (+page.server.js), which queries the classes_messages table for the current student and class.