Skip to content

Make RoomView invert and regroup its slots around what the user sees - #169

Merged
DetweilerRyan merged 17 commits into
mainfrom
refactor/room-view-inversion
Nov 28, 2026
Merged

DetweilerRyan merged 17 commits into
mainfrom
refactor/room-view-inversion

Conversation

@DetweilerRyan

@DetweilerRyan DetweilerRyan commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

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, and RoomViewRoot, its composition root, passes in the real ones. Its slots are render functions shaped around what the user sees, and it lays them out.

What Change
RoomView.tsx (the container) Declares RoomSlots, RoomStore, RoomConnection and RoomServices. Its slots are render functions given a snapshot and you in place of their fields, and a layout className where 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) Moved out of the container's file as LoadedRoomView, then renamed RoomViewRoot. Renders the real components in the slots, and binds what RoomView needn't see: the store for the items and the editor, the exchange-rate service, and RestaurantModal's roomId.
RoomItems.tsx, new The items: it renders the real UnclaimedBanner and ItemList, 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, new A plain component, the edit drawer with its exchange-rate hook, tested through the real drawer, store and rate service
SeedCard.tsx, new The seed card, which was markup in the container
_app-bar/AppBar.tsx Header renamed, taking the snapshot and you
src/utils/mergeClasses.ts, new Merges a component's own classes with the layout classes it's given, over tailwind-merge 2.6.1
Slot components Each merges its className into its root, and keeps only its look and padding. sticky top-0 z-20 and the banner's centring moved to the caller.
ReceiptStore.hydrateSeed Writes a seed into the store's own document, so no interface holds the Yjs document
Tests New tests for RoomItems, ReceiptEditor, SeedCard, mergeClasses, useIdentity's you, and four components that had none
Docs components.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

  • The layout rules, in components.md:
    • the caller places a component: margin, position, width against the parent, grid or flex item placement, and visibility, hiding only with hidden;
    • the component owns its look, its padding, and its root's whole display.
  • Visible changes: the claim progress sits at the top of the items column, not full width above the grid. It lost its own padding, which had served as outside spacing, so it lines up with the cards. The gaps match the old 12px.
  • hydrateSeed on ReceiptStore, the class the owner kept on Ban classes and this with lint, starting from eslint-plugin-functional #83.

Decisions made

  • Names, as the owner chose in review: a container is <Name>.tsx, and its composition root <Name>.root.tsx, exporting <Name>Root. So the container is RoomView, its composition root RoomViewRoot, and the bar AppBar.
  • The browser project loads the app's stylesheet once, in a setup file, in place of 18 per-test imports, as the owner asked in review.
  • Slots are render functions where the container computes the props, and elements where it only places or shows what the caller rendered, as the toast is. Keys are lowercase. The composition root can add props the container never sees.
  • Collaboration testing conventions stay general, as the owner asked: React's specifics live in components.md, which points to them.
  • tailwind-merge 2.6.1, approved by the owner, behind mergeClasses. The proposal is on this pull request. Tailwind v4 is Migrate to Tailwind v4 and sort classes with oxfmt #172.
  • The items are a plain component tested through its real children. The owner first asked for a nested container, then reversed it after research found no source that counts collaborators: both its children are simple.
  • One page-column class sets the page's content width, used by the room's main area and inside the app bar.
  • The app bar and the seed card take separate props, not a Pick of the snapshot.
  • The toast's duration is a constant again, tested with fake timers.
  • The editor is a plain component, and the four dialogs stay separate slots, as the owner chose. Both are to revisit after this lands.
  • The component owns its root's whole display, as the owner chose after research: Tailwind can't split the outer type from the inner, and tailwind-merge treats display as one group. Lint the component layout rules #175 covers a lint guard for these rules.
  • Make RoomView invert its slots, store and services, and give its untested components tests #165's proposals: ToastContext stays in Toast.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 to RoomItems and ReceiptEditor with 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

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
split Ready Ready Preview Nov 27, 2026 6:56pm UTC

agent and others added 2 commits November 26, 2026 23:06
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>
@DetweilerRyan
DetweilerRyan force-pushed the refactor/room-view-inversion branch from fe632bf to 95a476f Compare November 27, 2026 04:06
@DetweilerRyan
DetweilerRyan marked this pull request as draft November 27, 2026 04:18
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Feedback given in a Claude Code session, 2026-11-27, after research on naming the component that was LoadedRoomView:

i'm not a big fan of the Loaded naming convetion of LoadedRoomView. can you do a little research on naming conventions for these types of components.

LoadedRoomView should be come RoomView and RoomView should become RoomViewRoot

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>
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Answering the owner's choice of names, in 7062c7c:

  • LoadedRoomView is now RoomView, the composition root, in RoomView.tsx. That's the name the page and RoomApp.tsx already rendered it by, so RoomApp's dynamic export no longer shadows a different component.
  • The container is now RoomViewRoot, in RoomViewRoot.tsx, with its test in RoomViewRoot.browser.test.tsx. It still declares RoomSlots, RoomConnection and RoomServices.
  • Docs that describe the code as it is now follow: component and hook testing, code design principles, code layout, and the sidecars' current-state lines. History and owner quotes are unchanged.
  • The research behind the question:
    • no source reserves a name for this role;
    • FooContainer and ConnectedFoo belong to the container/presentational split, which its author withdrew;
    • Next's community page-client.tsx assumes a server page.tsx, which this repository doesn't have;
    • Seemann puts a composition root "as close as possible to the application's entry point".

The branch was rebased onto main with #168 while this was in progress. I moved the rename onto it rather than overwriting it. The rebased commits differ from mine only by #168's files.

The definition of done passes after the rebase: lint, format, typecheck, npm test, tooling tests, oxcrap, build and e2e (6 passed).

@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 04:23
@DetweilerRyan
DetweilerRyan marked this pull request as draft November 27, 2026 04:25
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Feedback given in a Claude Code session, 2026-11-27:

refactor the slots to use render functions instead of actual components. this way RoomView can pass additional props into the real components via the render functions and those additional props do not need to be in RoomViewRoot's perview.

agent and others added 3 commits November 26, 2026 23:28
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>
@DetweilerRyan

DetweilerRyan commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner Author

Answering the owner's request for render-function slots, in b4825e6, 15fe9a4 and 6ba925a:

  • RoomSlots holds render functions: each is (props) => ReactNode, given only the props RoomViewRoot computes. The keys are lowercase, such as header and itemList.
  • RoomView renders the real components in them, and can add props of its own. RestaurantModal's roomId now comes from there, so it has left RoomViewRoot's slot type.
  • The readonly lint disable on RoomViewRoot is gone: plain function types pass the rule.
  • The test passes render functions of fakes. Its restaurant-details test no longer checks the room ID, which is now RoomView's to supply. RestaurantModal's own test, and the e2e tests, cover it.
  • Docs:
    • collaboration testing conventions describe a render-function slot, and bind nested code in the slot's render function;
    • component and hook testing says a render function returns elements of components defined outside it, and calls no hooks.

Self-review: no bug or behaviour change. Every slot gets the same props, the conditions and ToastContext are kept, and rebuilding the render functions causes no remounts. It found two doc problems, both fixed in 6ba925a:

  • A stale rule: the old "bind it once, at module level" rule for nested code was left over from component slots.
  • An incomplete reason: the no-hooks rule now names the React Compiler, which may skip a call, and the remount a component created inside a render function would cause.

For the owner: oxlint's react/rules-of-hooks isn't enabled, so nothing lints a hook inside a render function. Enabling it would change the lint config, so it's your call.

Checks:

  • At b4825e6: the definition of done passes, including e2e (6 passed).
  • After that: only docs and a comment changed, and lint, format and typecheck pass on them.

@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 04:34
@DetweilerRyan
DetweilerRyan marked this pull request as draft November 27, 2026 15:03
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Feedback given in a Claude Code session, 2026-11-27, on applying #170 to this pull request, after a conversation:

apply 170 to 169. before you do it i wan't to have a conversation. only proceed when i give the ok

the goal is to maximize testability in line with the collaboration-testing-conventions while minimizing artifictial seams and abstractions. the abstractions and interfaces should be built with the domain and end user as the primary usecase while keeping in mind Earned Complexity and Least Power prinicples. Additionally, I want RoomView to be responsible for the layout (not their styling) of it's constituent slots and the real components that fill the slots should have zero responsiblitie of their own layout (margin padding display ect) aroudn their root element. therefore, the slit render functions must accept layout styling compatiple with tailwind and the components that fill the slots must be able to merge the classnames passed in with their own.

  • Research standard ways to merge tailwind classnames. we will add a new dependency for this.
  • I missspoke, RoomViewRoot owns layout not RoomView.
  • consider splitting Items into it's own container with it's own collaboration test and it's own slots.
  • explore reducing the props surfice area for each of the room slots. this will mean moving a bit more complexity into RoomView and probably reshaping room view's hooks.
  • fyi, i'm going to correct my ealier statment, padding should be the responsitibity of the component iteself and should be considere'd internal layout since it's inside the border and boxshadow.
  • we should be on the latest version of tailwind v4 so file an issue to migrate to v4 and turn on tailwind sorting via oxfmt.
  • go with tailwind-merge for now. since it's behind a mergeClasses facad we'll be able to change it out without having to update a lot of code.
  • rename header to app bar, in the ui it's clearly not a header.
    1: i approve the tailwind-merge dependency
    2: you have my ok
    3.1: a plain component but let's revisit after the plan has been implemented to see if it might make sense
    3.2: go with your recommendation and like 3.1 we will revisit after implementation

The approved dependency is tailwind-merge, exact version 2.6.1, behind a mergeClasses helper. The Tailwind v4 migration is #172.

agent and others added 2 commits November 27, 2026 10:03
As the owner approved on #169: one helper joins a component's own classes with the layout classes it's given, letting a later Tailwind utility win. tailwind-merge 2.6.1 is the last line that supports Tailwind 3; #172 covers moving to v4.

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>
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Dependency proposal: tailwind-merge 2.6.1, approved by the owner (recorded), per docs/engineering/dependencies.md. Answers dated 2026-11-27.

  • The need: a slot's component merges the layout className it's given with its own classes, and a caller's utility must win over a conflicting one. For example, p-2 against p-4. A plain join can't resolve that.
  • The candidates:
    • tailwind-merge 2.6.1: the last line that supports Tailwind 3.0 to 3.4.
      • No dependencies, no install scripts, MIT.
      • About 7.1 KB gzipped in the client bundle.
      • Maintained: 2.6.2 and 3.7.1 were released this month.
    • tailwind-merge 3.x and shadcn's cn: Tailwind v4 only.
    • clsx: adds only object syntax, which twMerge doesn't need, and it has had no release in over 12 months.
    • class-variance-authority and tailwind-variants: variant systems, more than this needs.
    • Writing it ourselves: can't resolve conflicts.
    • Already installed: nothing does this.
  • The trial, outside the repository:
    • installed cleanly, with 0 vulnerabilities;
    • twMerge('p-2 mt-1', 'p-4') gives mt-1 p-4;
    • the app's own classes, such as card, are kept, and need no configuration.
  • The recommendation: 2.6.1, the newest release older than two weeks. 2.6.2 is the same code with npm provenance. It's behind src/utils/mergeClasses.ts, so moving it to 3.x with Tailwind v4 (Migrate to Tailwind v4 and sort classes with oxfmt #172) touches one file.

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>
@DetweilerRyan DetweilerRyan changed the title Make RoomView invert its slots, store and services Make RoomViewRoot invert and regroup its slots around what the user sees Nov 27, 2026
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Answering the owner's decisions on applying #170, in e8be6a7, 46079ba and fb40f07:

  • mergeClasses, over tailwind-merge 2.6.1, is in src/utils/ with a unit test. It's the library's only importer.
  • Header is now AppBar, taking the snapshot and you in place of eight fields.
  • Layout:
    • RoomViewRoot lays out its slots.
    • Each slot's component merges the className it's given, and keeps only its look and padding.
    • What moved to the caller: the app bar's sticky top-0 z-20, and the banner's centring and border-less padding.
  • RoomItems is a nested container with its own slots and collaboration test. It owns the filter and the item operations, and RoomViewRoot passes it who you are, whether you're editing, and the editor.
  • ReceiptEditor is a plain component, the drawer with its exchange-rate hook, as you chose.
  • SeedCard replaces markup the container held.
  • RoomViewRoot keeps the layout and what crosses its slots. Its slots dropped from 56 props to about 35.

Self-review: an independent review found no bug in the running app. Its substantive findings are fixed:

  • The banner's spacing: its padding had become an inset inside the column.
  • The drawer's position: while editing, it had moved above the banner. It's back between the banner and the list.
  • The layout rule said more than the code did.
  • A false doc line about rates.
  • ReceiptEditor's tests missed its currency refetch and a typed rate.

One question for the owner, in the description: should flex on a component's root, which arranges its own children, stay the component's? Your first message listed display among what it mustn't own.

Checks: the definition of done passes locally at fb40f07: lint, format, typecheck, npm test, tooling tests, oxcrap, build and e2e (6 passed).

@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Answering the request in e6ae09f: components.md gains a Code design principles section, with one group per principle. Each links to the principle rather than restating it:

  • Core and shell: a component reads business results from the domain, keeps UI-only decisions, and takes stores and services as narrow props.
  • Contained state: derive during render instead of copying into useState; read room data through the snapshot; keep UI state low; props are readonly.
  • Least power: element slots before render functions, className before a variant, JSX conditions or a switch rather than a component table.
  • Earned complexity: add a prop, variant or slot for a current caller; real components until a collaboration test earns slots; a component moves to src/components/ once two folders import it.
  • Deep modules: the interface is props, contexts and what the user sees; few props; remove pass-through wrappers; containers wire and components present; fakes keep the slot's contract; user-facing messages say what to do.
  • Honest types: union props instead of contradictory booleans; no literal true/false flag props; parse input where it enters; ?: T | undefined for optional props.

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.

@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 17:59
@DetweilerRyan
DetweilerRyan marked this pull request as draft November 27, 2026 18:16
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Decision given in a Claude Code session, 2026-11-27, on a review of this PR's room code against components.md:

go with your recommendation

The recommendation it approves:

  • Fix on this PR: the unused className props, and the Layout rule that led to them ("when a caller places it"); the container computing the receipt for its participant notice; RoomItems' contradicting editing/editor props; the unstated toast contract for modal slots; navigate outside RoomServices, and toastMs among them; no test of the app bar's placement.
  • File as issues (already on main): claimed-ness and the item total computed outside the domain; modals hiding themselves with open; the force flag argument; ModalDialog's className; useToast not clearing its previous timer.
  • Leave to the owner: the column width in two files, and doc gaps D2–D7.

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>
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Answering the decision, in 7e4a489:

Fixed here:

  • className only where a caller places a component. Only the app bar keeps one, as a required slot prop. Eight components and seven slot types lose theirs. components.md's Layout rule now says "When a caller places a component, take its classes as an optional className".
  • RoomItems takes mode: { kind: 'claiming' } | { kind: 'editing'; editor } instead of editing and an optional editor, which could contradict each other.
  • RoomView no longer computes the receipt. It did so only for its "No participants yet." notice, which moved to ParticipantCards, with tests there.
  • The dialog slots share DialogProps, which says each dialog shows the toast while the page hides its own. The fake dialogs show it, and the test checks the toast appears in the open dialog, and only there.
  • navigate joined RoomServices. Its comment now says toastMs is there for a test to lengthen.
  • The app bar's placement is tested: RoomView's test checks it's given sticky top-0, and AppBar's test checks it merges what it's given with its own classes.

Filed, since they were already on main: #176 (claimed and totals in the domain), #177 (render dialogs conditionally), #178 (the force flag), #179 (ModalDialog's className), #180 (useToast's timer).

Questions for the owner, left open:

  1. The page column (mx-auto max-w-6xl) is set in both AppBar and RoomView's <main>, with padding 0.25rem apart. Should RoomView pass the column to the bar, or should they share a constant?
  2. "Take the snapshot's fields a component needs": a Pick<RoomSnapshot, …>, or separate props? The code does both.
  3. "One or two simple" collaborators is undefined, and RoomItems has two but was inverted. Define "simple", or drop the count?
  4. Config values such as toastMs: should components.md give them a home, a services prop or their own?
  5. A full-width bar whose content lines up with the page column: should components.md cover it? It ties to question 1.
  6. Dialogs: an open prop or conditional rendering? Render dialogs conditionally instead of passing them open #177 depends on this.
  7. Does ?: T | undefined reach option objects and function parameters, or only props?

Checks: the definition of done passes locally at 7e4a489, including e2e (6 passed).

@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 18:22
@DetweilerRyan
DetweilerRyan marked this pull request as draft November 27, 2026 18:51
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Decision given in a Claude Code session, 2026-11-27, on research into the seven open questions:

go with your recommendation and evisit RoomItems as a container. 4: go with the recommendation

The recommendations it approves:

  • 1 and 5: define the page column once, as a PageColumn layout component used by the room's <main> and inside AppBar; components.md says a full-width component lines up with the page through it.
  • 2: a component takes the snapshot's fields as separate props, not a Pick<RoomSnapshot, …> object.
  • 3: replace "one or two simple ones" with what the collaborator is like (volatile, awkward to set up), and revisit RoomItems as a container: test it through its real children.
  • 4: toastMs goes back to a module constant, tested with fake timers.
  • 6: fold into Render dialogs conditionally instead of passing them open #177, with a check that focus returns to the opener when a dialog closes by a button.
  • 7: ?: T | undefined applies to every optional property, option objects included, and never to optional parameters.

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>
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Answering the decision, in 7e2343d:

  • 1 and 5, the page column: a page-column class in app/index.css (mx-auto max-w-6xl px-4), used by the room's <main> and inside AppBar. The bar's content now lines up with the page; it was 0.25rem off. components.md: "Line a full-width component's content up with the page through the page-column class." A class rather than a component, as least power asks, since it only sets classes.
  • 2, separate props: AppBar takes title, purchasedAt, mealType, connection and peers, and SeedCard takes participantCount and itemCount, instead of a Pick of the snapshot. components.md says why: a Pick narrows only the type.
  • 3, RoomItems: no longer a container. It renders the real UnclaimedBanner and ItemList, and its test goes through them over a real store; breaking onClaim fails two of its tests. Collaboration conventions now say a collaborator is simple when it's "fast, deterministic, yours, and easy to set up, with no effects outside the process", however many there are.
  • 4, the toast's duration: useToast() reads TOAST_MS again, and RoomServices no longer has toastMs. useToast's test checks the timing with fake timers, as it already did.
  • 6, dialogs: added to Render dialogs conditionally instead of passing them open #177, with the research and a check that focus returns to the opener when a dialog closes by a button.
  • 7, | undefined: components.md now says every optional property takes it, option objects included, and no optional parameter does. Keep ?: T only where code checks whether the property is there. HydrationOptions.forceReset and RoomStore's matching type now follow it.

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).

@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 18:58
@DetweilerRyan
DetweilerRyan merged commit 9305452 into main Nov 28, 2026
3 checks passed
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
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>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
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>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
As the owner approved on #169: one helper joins a component's own classes with the layout classes it's given, letting a later Tailwind utility win. tailwind-merge 2.6.1 is the last line that supports Tailwind 3; #172 covers moving to v4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
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>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
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>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
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>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
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>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
…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>
DetweilerRyan pushed a commit that referenced this pull request Nov 28, 2026
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>
DetweilerRyan pushed a commit that referenced this pull request Nov 30, 2026
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>
@DetweilerRyan
DetweilerRyan deleted the refactor/room-view-inversion branch November 30, 2026 18:05
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.

Make RoomView invert its slots, store and services, and give its untested components tests

1 participant