Repository navigation
Chat basics: one chat per Project, live updates, unread badge (#92) - #99
Merged
Merged
Conversation
One group chat per Project for its Members and Product Owner; every Teacher and the Superuser can read and write in every chat. Text messages (4000 characters, clickable links), new messages within ~2 s by polling (ADR 0008), Unread counts per User with a badge on the Chat / Chats navigation item, a Chats screen for staff and a Chat button on a Project's page. An Archived Project's chat is read-only. Migration 0014. Frontend tests: backend requests made in-process now always finish (a request cancelled at the end of a test left its transaction open and blocked the next test's reset), engines are disposed, and four tests wait for their page before clicking. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #92 (spec #91).
What's new
GET …/chat/messages?after=<last id>every 2 s, so others' messages appear within ~2 s without reloading (ADR 0008: polling instead of push, frontend → backend stays plain REST).chat_readskeeps each person's last read message. Opening a chat reads it. A red badge on Chat (Students) / Chats (Teachers, Superuser) shows the Unread count of your own chats, refreshed every 10 s; for staff only Projects where they are the Product Owner count. A Student without a Project doesn't see the Chat item./chat(Student's chat),/chats(staff: every Active Project's chat with its Unread count),/chats/{project_id}, and a Chat button next to the title on a Project's page.0014(chat_messages,chat_reads);CONTEXT.md: Chat, Chat people, Unread; changelog row.API
GET /api/projects/{id}/chat,GET/POST /api/projects/{id}/chat/messages,POST /api/projects/{id}/chat/read,GET /api/chats,GET /api/chats/unread.Test infrastructure fix
Pages now poll the backend, and the frontend tests run the backend in-process. A request cancelled at the end of a test left its database transaction open ("idle in transaction"), and the next test's
TRUNCATEwaited forever (seen locally: the suite hung).FinishingTransportinfrontend/tests/conftest.pylets every request finish, the fixture waits for them, and each test's engine is disposed. Four existing tests clicked before their page had loaded; they now wait for it like their neighbours.Tests
Backend 329 passed (new
test_chat.py: access, ordering,after, Unread, length, archived). Frontend 98 passed (newtest_chat.py: Student sends and receives live, Teacher badge + Chats screen + opening reads, Chat button, no Chat item without a Project, link escaping).Not yet: Guests (#93), files (#94), edit/delete/reply (#95), reactions/mentions (#96), typing/seen/search (#97), 6-month cleanup (#98).
🤖 Generated with Claude Code