Merge chat, diary and notes into one kind of room #13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Chat, diary and notes are already the same thing on Matrix: child rooms of the space with a
com.genji1024.koto.kindofchat,diaryornote. Only the client treats them differently (one chat with threads, one diary of titled cards newest first, many notes of comment cards). Make them one kind of room, all shown and used the same way:Decided with the owner: list order by recent activity, rooms created by any member, rename/delete by creator and admin, opening on the room list.
Data: no migration
chat,diaryandnoterooms all become rooms as they are; new rooms getkind: "room". Nothing is rewritten on the server, so production data, other Matrix clients and the importer keep working.m.room.messageevents with koto's payload (title, body, images, original date) and show as titled cards or messages with a photo grid. Imported entries keep showing their original date.m.imagethread replies so other clients can see them; the room view hides those replies when they repeat the photos of the message they belong to, so they do not appear twice.m.space.parent) and has not been unlinked from it (an emptym.space.child). Deleting marks the room deleted where the user has the power to, and unlinks it from the space, which every member may do (the space grantsm.space.childat level 0 so members can link new rooms); that lets the admin also remove old notes created by members, where the admin has no power.ensureRootJoinable) stops creating a chat room and opens the topic to everyone in the rooms the admin owns (the old chat and diary). A brand-new community starts with one room, チャット.tabChat,tabDiary,tabNotes) become one,tabRooms(default ルーム).Client
matrix/chat.tsreads both plain messages and titled ones (title, body, images, original date), edits keep the payload, deleting a titled message also redacts my own photo replies to it (not other people's replies, which stay under a placeholder as in the chat).matrix/koto.ts: listing, creating, renaming, describing and deleting rooms; who may do what.pages/Rooms.tsx(list, new-room form, room header with description and menu) around the existing chat view; the composer gets a タイトル toggle that sends a titled message with its photos in one post.Diary.tsx,Notes.tsx,EntryCard.tsxanduseEntries.tsgo;diary.tskeeps what the importer and reactions use.Verification
Unit tests for reading titled messages and hiding repeated photo replies; typecheck, lint, build. The integration tests and E2E need a homeserver and are updated to the new API but cannot run in the environment this is written in; the behaviour is checked on the pull request's preview against the demo's data (which has chat, a diary and notes).