Skip to content

feat(events): assigning writes the room's row - #696

Merged
mindsers merged 1 commit into
mainfrom
feat/rooms-r4-4b-writers
Nov 28, 2026
Merged

mindsers merged 1 commit into
mainfrom
feat/rooms-r4-4b-writers

Conversation

@mindsers

Copy link
Copy Markdown
Contributor

Parallel rooms R4, PR 4b: the switch-over. Every reader moved to the room rows first (#690–#694), and #695's trigger takes a part with a row per room. Now the writers put a part's people on its rows only. As decided, there is no dual-write to the item's columns.

Writers:

  • assignPart / unassignPart take the room being assigned (roomId). With none, it is the part's only or main room, which is what the page sends until PR 5 draws each room. They write that room's row. The item keeps its own fields (topic, duration) and its updatedAt moves, on the app's clock, because the board's content version and the calendar feed read it.
  • refreshConflictFlags flags each room a member holds, with batched itemRoom.updateMany, then touches those parts. Duties stay items.
  • deleteExternalSpeaker frees the planned talks in any room and counts the past ones by rows (an item's own column may still name a freed speaker).
  • Routes: assign-part reads an optional roomId (schema), remove-assignment an optional room. A form from the previous version posts none.
  • The room helpers (PART_ROOMS, inAnotherRoom, writeRoom) live in part-room-writes.server.ts, which keeps event-part-assignments.server.ts under its 350-line budget.

Visible today: nothing for one-room parts. A copy's one row gets the same people its columns used to. Unit (6,977) and integration (193 files) pass, and no reference snapshot moved (assignments, programme-pages, feeds…).

Tests:

  • assign-in-rooms integration, on the fixture's meeting with a row per room:
    • assigning « Salle B » writes its row, keeps the main room and touches the item;
    • no room named → the main room;
    • Paul (main room) refused on « Salle B »;
    • an outside speaker goes on « Salle B »;
    • a foreign room is refused;
    • unassigning « Salle B » keeps the main room;
    • an absence flags only the absent person's room;
    • deleting a retired speaker frees his planned « Salle B » talk.
  • The new cases fail without the change.
  • part-room-writes unit tests for inAnotherRoom.
  • Tests that read a part's hasConflict / outside speaker from the item now read its row: dashboard, absence-conflicts, days-off, draft-conflict-flow, external-speakers, and the refresh-conflict-flags / external-speakers unit mocks.

Lint: refreshConflictFlags was already over the complexity limit on main (25), and is 24 now.

Next: PR 5, the meeting page and assignment dialog per room (board « TourA-Salles-Reunion »). Then the archive with rooms (2.24, one copy per room for older versions, as decided), then creation with one item and a row per room.

Parallel rooms R4, the writers (no dual-write): a part's people go on its
room rows, its item keeping its own fields and marked changed (updatedAt,
on the app's clock).
- assignPart / unassignPart take the room being assigned (roomId; none, the
  part's only or main room) and write its row; a room that is not the
  part's is refused. Nobody holds two rooms of one part (user, 2026-11-28).
- refreshConflictFlags flags each room a member holds; duties stay items.
- deleteExternalSpeaker frees the planned talks in any room and counts the
  past ones by rows.
- assign-part and remove-assignment read an optional room.
- Tests reading a part's flag or outside speaker read its row.
@mindsers
mindsers merged commit 49e69e8 into main Nov 28, 2026
7 checks passed
@mindsers
mindsers deleted the feat/rooms-r4-4b-writers branch November 28, 2026 09:22
mindsers added a commit that referenced this pull request Nov 28, 2026
**On the meeting page**, a part held in several rooms at the same time
is:
- **one line**: its name, « 2 salles en même temps » (after its subject,
when it has one), its duration;
- **then a line per room**, indented: the room's name, its speaker and
second speaker, and its own actions;
- **on a phone**, a block per room under the part, with full-width
slots.

It sits under no room heading. Copies written before R4 (an item per
room) join their part the same way, since `partsInRooms` reads both
shapes.

**Production meetings change visibly, not only R4 data.** Meetings whose
parallel parts were written as copies, which is every one in production
today, used to show « Salle principale · 3 parties » / « Salle B · 3
parties » blocks. They now show each part once with its rooms under it,
as the board and the template-page note ask (parallel rooms count once).
Counts follow. For example, « Appliquons-nous au ministère · 6 sans
durée » becomes « 3 sans durée », and the footer « 15 parties · 8 sans
durée » becomes « 12 parties · 5 sans durée ».

**Navigation:** ↑/↓ stop on **each room line**, with « n sur N »
counting them, for parts with a row per room and for copies alike. The
side editor's target gains an optional \`sub\` (here, the room): another
room of the same part is another item, which asks before dropping
unsaved changes, and the editor remounts on it. A part held in several
rooms without a duration reads « — », like any part.

**Assigning a room:**
- Its « Assigner », or a click on its empty slot, opens the editor for
**that room**. The subtitle names it (« Joyaux spirituels · Salle B »),
it shows that room's people, and the form posts `roomId`. #696's writers
check that the room is one of the part's.
- The candidate facts, the publisher card and the outside-speaker card
ask for that room (`roomId`, read since #693/#694).
- « Retirer » frees that room alone (`&room=`).
- Share and S-89 buttons show where they are right today: on a copy's
own line, and on the main room's line. Per-room share texts and slips
come in the next PR.

**Data:** `listEventPartRooms` (new, `event-part-rooms.queries.ts`)
reads each part held in several rooms with its rooms' people, plus the
copies that join a part. It is read **beside** `getEventProgramme`,
whose shape stays, so no reference snapshot moves. The room line's type
lives in `model/part-room-view.ts`.

**Moved, for the size budgets:**
- `PartRow` / `PartActions` go to `PartRow.tsx`, with an optional room.
- The head and room lines are in `ParallelPartRows.tsx`.
- The editors' setup is in `assign-editors.ts`, and « Modifier le
planning » in `ScheduleEditLink.tsx`.
- `EventView.tsx` is 386 lines (budget 400).
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.

1 participant