Repository navigation
Make RoomView invert and regroup its slots around what the user sees - #169
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closes #165. RoomView declares RoomSlots, RoomConnection and RoomServices in its own terms, with no defaults; LoadedRoomView moves to its own file as the composition root and passes in the real components, provider and services. ReceiptStore gains hydrateSeed, so useSeedImport no longer takes the Yjs document. RoomView's test runs the real exchange-rate service over a fake network and cache, and ShareModal, UnclaimedBanner, Toast and ItemList gain contract tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ItemList's contract tests check that it hands its rows editing, onClaimAll, onUpdate and onDelete; RoomView's test checks a fresh cached rate is used without asking the network; RoomStore's setMeta lists only the keys used; the lint disable's reason is accurate; four stale docs are updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fe632bf to
95a476f
Compare
|
Feedback given in a Claude Code session, 2026-11-27, after research on naming the component that was
|
As the owner chose on #169: the composition root takes the name the page and RoomApp already used for it, and the container that declares RoomSlots, RoomConnection and RoomServices becomes RoomViewRoot, with its test. Docs describing the current code follow; history and quotes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answering the owner's choice of names, in 7062c7c:
The branch was rebased onto The definition of done passes after the rebase: lint, format, typecheck, |
|
Feedback given in a Claude Code session, 2026-11-27:
|
As the owner asked on #169: each slot is a render function of only the props RoomViewRoot computes, and RoomView renders the real components in them, adding props of its own, such as RestaurantModal's roomId, which leaves RoomViewRoot's slot. Plain function types satisfy the readonly lint rule, so RoomViewRoot's disable goes. The testing docs describe render-function slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RoomViewRoot calls some render functions conditionally, so a hook inside one would break React's rules of hooks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaboration testing conventions bind nested code in a slot's render function, not once at module level; the render-function rule names the React Compiler and the remount hazard of a component created inside it; RoomView's comment says what TypeScript checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answering the owner's request for render-function slots, in b4825e6, 15fe9a4 and 6ba925a:
Self-review: no bug or behaviour change. Every slot gets the same props, the conditions and
For the owner: oxlint's Checks:
|
|
Feedback given in a Claude Code session, 2026-11-27, on applying #170 to this pull request, after a conversation:
The approved dependency is |
Applies #170 as the owner chose on #169. Header becomes AppBar. Slots take a snapshot and you in place of their fields, and a layout className their components merge with mergeClasses; components keep only their look and padding. The banner and item list become the nested RoomItems container, with its own slots and collaboration test; the drawer and its exchange-rate hook become the plain ReceiptEditor; the seed card becomes SeedCard. RoomViewRoot keeps the layout and what crosses its slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Dependency proposal:
|
The banner's padding was its outside spacing, so it goes, and the gaps match the old ones; RoomItems shows the editor between its progress and its list again, as before; RoomItems' slots take a className; the layout rule is scoped to slots in the page's flow; ReceiptEditor's tests cover the currency refetch and a typed rate; useIdentity's test covers having no you. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answering the owner's decisions on applying #170, in e8be6a7, 46079ba and fb40f07:
Self-review: an independent review found no bug in the running app. Its substantive findings are fixed:
One question for the owner, in the description: should Checks: the definition of done passes locally at fb40f07: lint, format, typecheck, |
|
Answering the request in e6ae09f:
The sidecar records the request and cites React's docs. Lint and format pass locally, and CI passed on e6ae09f. The change is docs only, so I didn't rerun the other checks locally. |
|
Decision given in a Claude Code session, 2026-11-27, on a review of this PR's room code against
The recommendation it approves:
|
A className only where a caller places a component: only the app bar keeps one, and the Layout rule now says so. RoomItems takes a mode union instead of editing and an optional editor. RoomView no longer computes the receipt for its participant notice, which moves to ParticipantCards. Dialog slots share DialogProps, which says the dialog shows the toast, and the fakes do. navigate joins RoomServices. Tests cover the app bar's placement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answering the decision, in 7e4a489: Fixed here:
Filed, since they were already on Questions for the owner, left open:
Checks: the definition of done passes locally at 7e4a489, including e2e (6 passed). |
|
Decision given in a Claude Code session, 2026-11-27, on research into the seven open questions:
The recommendations it approves:
|
RoomItems renders its real banner and list and is tested through them, since both are simple; collaboration conventions define simple by what a collaborator is like, not a count. The page column is one page-column class, used by the room's main area and inside the app bar. AppBar and SeedCard take separate props, not a Pick of the snapshot. The toast's duration is a constant again, tested with fake timers. Every optional property takes | undefined, option objects included, and no parameter does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answering the decision, in 7e2343d:
The sources are in components.md's sidecar, and the collaborator criterion's are in the collaboration conventions' sidecar. Checks: the definition of done passes locally at 7e2343d, including e2e (6 passed). |
As the owner chose on #169: the composition root takes the name the page and RoomApp already used for it, and the container that declares RoomSlots, RoomConnection and RoomServices becomes RoomViewRoot, with its test. Docs describing the current code follow; history and quotes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the owner asked on #169: each slot is a render function of only the props RoomViewRoot computes, and RoomView renders the real components in them, adding props of its own, such as RestaurantModal's roomId, which leaves RoomViewRoot's slot. Plain function types satisfy the readonly lint rule, so RoomViewRoot's disable goes. The testing docs describe render-function slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Applies #170 as the owner chose on #169. Header becomes AppBar. Slots take a snapshot and you in place of their fields, and a layout className their components merge with mergeClasses; components keep only their look and padding. The banner and item list become the nested RoomItems container, with its own slots and collaboration test; the drawer and its exchange-rate hook become the plain ReceiptEditor; the seed card becomes SeedCard. RoomViewRoot keeps the layout and what crosses its slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the owner asked on #169: ReceiptStore.removeParticipant's claim cleanup had no test. The test gives two participants claims, removes one, and checks the snapshot and the document's claims map keep only the other's. It fails with the cleanup removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the owner chose on #169: docs/engineering/component-layout.md holds the layout rules, with the component owning its root's whole display, and the caller owning margin, position, width, item placement and visibility, hiding only with hidden. Its sidecar holds the owner's decisions and the research. Component testing points to it, and #175 covers a lint guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the owner chose in review on #169: the container that accepts slots is RoomView, in RoomView.tsx, and its composition root is RoomViewRoot, in RoomView.root.tsx, so "root" means only the composition root. The browser project loads the app's stylesheet once, in app/browser-tests.setup.ts, in place of 18 per-test imports. Component testing documents both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation conventions general As the owner asked on #169: component-layout.md becomes components.md, with Layout and a new Containers section. Containers holds how a React container is written: slots, render functions, hooks, its composition root and .root.tsx, nested containers and context. Collaboration testing conventions name no framework, and component and hook testing keeps how a container is tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the owner asked on #169: components.md gains a Code design principles section, with one group of rules per principle, each linking to the principle rather than restating it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code layout names the renamed app bar folder. Components points to code layout for when a component moves, and to component and hook testing for how roots and hooks are tested, narrows the separate-props rule, and gives each bullet one instruction. The optional-property rule moves to types and schemas. The index sends agents to components for any component. RoomItems keeps the editor's 16px gap to the list. Tests check the app bar's look through the stylesheet rather than its classes, the room's toast timers are frozen, and an e2e scenario checks the details name the room the link opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #165 and #170.
RoomView, the room's container, follows collaboration testing conventions with true dependency inversion. It declares what it takes in its own terms, with no defaults, andRoomViewRoot, its composition root, passes in the real ones. Its slots are render functions shaped around what the user sees, and it lays them out.RoomView.tsx(the container)RoomSlots,RoomStore,RoomConnectionandRoomServices. Its slots are render functions given a snapshot andyouin place of their fields, and a layoutclassNamewhere they sit in the page. It keeps the layout, and what crosses its slots: who you are, editing, which dialog is open, and the toast.RoomView.root.tsx(its composition root)LoadedRoomView, then renamedRoomViewRoot. Renders the real components in the slots, and binds whatRoomViewneedn't see: the store for the items and the editor, the exchange-rate service, andRestaurantModal'sroomId.RoomItems.tsx, newUnclaimedBannerandItemList, and is tested through them, since both are simple. It owns the filter, and the claim, edit and delete operations, and shows the editor between its progress and its list.ReceiptEditor.tsx, newSeedCard.tsx, new_app-bar/AppBar.tsxHeaderrenamed, taking the snapshot andyousrc/utils/mergeClasses.ts, newtailwind-merge2.6.1classNameinto its root, and keeps only its look and padding.sticky top-0 z-20and the banner's centring moved to the caller.ReceiptStore.hydrateSeedRoomItems,ReceiptEditor,SeedCard,mergeClasses,useIdentity'syou, and four components that had nonecomponents.md, new, holds how a component is written: its Layout section (who places a component, and who owns its look), and its Containers section (slots, render functions, hooks, the composition root and.root.tsx). Its sidecar holds the reasons and research. Collaboration testing conventions name no framework and point to it for React. Component and hook testing keeps how a container is tested.What to look at
components.md:hidden;display.hydrateSeedonReceiptStore, the class the owner kept on Ban classes and this with lint, starting from eslint-plugin-functional #83.Decisions made
<Name>.tsx, and its composition root<Name>.root.tsx, exporting<Name>Root. So the container isRoomView, its composition rootRoomViewRoot, and the barAppBar.components.md, which points to them.tailwind-merge2.6.1, approved by the owner, behindmergeClasses. The proposal is on this pull request. Tailwind v4 is Migrate to Tailwind v4 and sort classes with oxfmt #172.page-columnclass sets the page's content width, used by the room's main area and inside the app bar.Pickof the snapshot.display, as the owner chose after research: Tailwind can't split the outer type from the inner, andtailwind-mergetreats display as one group. Lint the component layout rules #175 covers a lint guard for these rules.ToastContextstays inToast.tsx, and the four untested components got tests.For the owner to confirm
Nothing.
Changed test expectations
RoomView's tests no longer check the items, the drawer or the rates, which moved toRoomItemsandReceiptEditorwith their own tests. They now check that the items get who you are and whether you're editing, and that the editor's notices reach the toast.Verification
Every check passes locally: lint, format, typecheck,
npm test,npm run test:tooling, oxcrap, build and e2e (6 passed). The e2e tests run the real layout. An independent review found no bug in the running app, and its findings are fixed.🤖 Generated with Claude Code