Skip to content

Chat: "is typing…", "Seen by" and search (#97) - #106

Merged
Oceandek merged 1 commit into
mainfrom
feat/chat-typing-seen-search
Oct 29, 2026
Merged

Oceandek merged 1 commit into
mainfrom
feat/chat-typing-seen-search

Conversation

@Oceandek

Copy link
Copy Markdown
Collaborator

Closes #97 (spec #91).

What's new

  • "Is typing…": while a chat person types, the others see "Anna is typing…" ("Anna and Bram are typing…", "Anna, Bram and Cas are typing…") under the messages. The page tells the backend at most every 2.5 s; the backend keeps it in memory (chat.TypingBoard, like the LoginGuard) and forgets it 5 s after the last keystroke, or as soon as the message is sent. Staff who only read along never show as typing; you never see yourself.
  • "Seen by": your own messages show "Seen by N" (or "Not seen yet"); a click lists the names. It counts only the chat people (Members, Product Owner, Guests) whose read mark is at or after the message, never staff who only read along. It updates live as the others read.
  • Search: a Search panel above the messages: text (any case, in message text and file names; % and _ are searched as they are), From (the chat people and the authors of the shown messages) and Files only. Results are newest first (max 50), deleted messages are never found, and clicking a result scrolls to the message.
  • One poll for everything: an open chat now calls GET .../chat/updates?since= every 2 s, which returns the changed messages, who is typing and the others' read marks. ADR 0008 updated; CONTEXT.md: Seen by; changelog row.
  • No migration.

API

GET /api/projects/{id}/chat/updates?since= → {messages, typing, reads [{name, last_read_id}]}; POST /api/projects/{id}/chat/typing; GET /api/projects/{id}/chat/search?q=&from=&files_only= (422 "Type something to search for." without any filter). Messages get seen_by (names, only on your own; null otherwise).

Tests

  • Backend 364 passed; new test_chat_typing_seen_search.py (typing for 5 s with a fake clock, never yourself, sending ends it, staff reading along never type, Seen by counts only chat people, search in text and file names, literal %/_, Files only, From, needs a filter, access).
  • Frontend 117 passed; new test_chat_typing_seen_search.py (typing line wording, a Student sees the Teacher typing, Seen by goes from "Not seen yet" to "Seen by 1" with the name, search finds a message and jumps to it, Files only). The bodies() test helper now orders by message id, because a message is redrawn when its "Seen by" changes.

🤖 Generated with Claude Code

Typing kept in the backend's memory for 5 s; "Seen by N" on your own
messages counting only chat people, live; search a chat's text and file
names with From and Files only. Open chats poll one updates endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Oceandek
Oceandek merged commit 3f9601e into main Oct 29, 2026
2 checks passed
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.

Chat: 'is typing…', 'Seen by' and search

1 participant