feat(rooms): merge chat, diary and notes into one kind of room #14
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/rooms"
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?
Closes #13
Changes
Data layer (
matrix/), no data rewritten on the server:koto.ts: every kind (room, and the oldchat,diary,note) is a room.listRoomslists them, minus rooms flagged deleted or unlinked from the space (an emptym.space.child).addRoomcreates kindroomwith level 100 for its creator and the space's admins and the topic at level 0.renameRoom,setRoomDescription,deleteRoom, withcanRename/canDelete. Deleting flags the room where allowed and unlinks it from the space, which also lets the admin remove old member-made notes where the admin has no power. A new community starts with one room, チャット;ensureRootJoinableno longer creates a chat room and opens the topic in rooms the admin owns (the old chat and diary).findChat,listNotes,createNote,deleteNote,setNoteDescriptionare replaced;importNoteremains for the importer.chat.ts: reads titled posts (title, text, photos, an imported post's original date) next to plain messages;arrangehides photo replies that repeat a post's photos;editTextkeeps a post's payload (and, unlike the oldeditEntry, an imported post's original date);deleteMessagetakes the room and also redacts my repeated photo replies, leaving other people's replies under a placeholder.latestandunreadCountfeed the room list.diary.tskeeps posting, reactions, read state and the entry view the importer and tests use;editEntry,deleteEntry,markReadandreadersOfare gone (rooms usechat.ts).tabChat/tabDiary/tabNotesbecometabRooms(default ルーム); stored old labels are dropped on the next save.scripts/migrate.ts: the old diary is imported into a diary room of its own, named like its old tab.UI:
name: text, the post title, or 写真) and an unread count;+ ルームcreates one and opens it.Diary.tsx,Notes.tsx,EntryCard.tsx,ImagePicker.tsx,useEntries.tsremoved; wording that named the diary updated.Docs: README features,
architecture.md(data table, rooms and permissions), the upgrade note indeployment.md.Verification
notes.test.tsbecamerooms.test.ts, covering creation by a member, description by anyone, rename/delete by creator and admin but not other members, and the admin removing an old member-made note) but need a homeserver and have not been run.client/e2e/e2e.mjs) is not updated: about half of it drives the old diary, chat and notes screens, and it needs a rootful Docker daemon that is not available here, so rewriting it blind would likely leave it broken. It needs a follow-up before it is run again.Ran the integration suites against a real Synapse (latest, room version 12; and again with
default_room_version: "11") and rewrote the browser E2E for rooms. Three fixes came out of it:1014056Creating a room failed on room version 12: there a creator outranks everyone without being listed inpower_levels.users, and listing them is an error. The space's other admins are now added after creation, and power is read from the members (computed by the SDK for both kinds of room). Tests adjusted to match.57a9711The room list counted the photo replies that repeat a titled post's photos (preview said 写真, unread one too many), and a rename only showed up with the next event, because the SDK computes the name after the state update fires.2aae0b4client/e2e/e2e.mjsnow drives the room list, titled posts, member-created rooms renamed by the admin, and the rooms tab label. Joining counts as having read what came before, so a newcomer starts with nothing unread (as in other Matrix clients).Integration: 36 passed (push and migration suites skipped). E2E: OK.
2aae0b4481a8226e0ba5