Skip to content

feat: revamp the project room and replace the rail with the sidebar - #345

Open
pratikbuilds wants to merge 316 commits into
room-revamp-componentsfrom
room-revamp
Open

pratikbuilds wants to merge 316 commits into
room-revamp-componentsfrom
room-revamp

Conversation

@pratikbuilds

@pratikbuilds pratikbuilds commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Why

In the room today, finding where a project stands and what it needs from you means looking in several places:

  • Where the project is: the app rail, a plan panel beside the chat with its own Plan button and meter, and a tab strip over the project view. The plan panel lists every step, including questions and checks that make nothing you'd open.
  • What needs you: questions, approvals and plugin screens such as choosing a design arrive as cards in the chat thread, over the whole room or as tabs, with a next-step line and a conversation map on top. As the conversation grows, they scroll out of view.
  • Reading: a written document opens in a plain viewer, and replying to it means closing the project view to get back to the chat.

This PR rebuilds the room so each of those has one place:

  • The sidebar lists what the project makes (the brief, the design, the build plan, the app, the published site), one row each, with its state and a click to open it. Steps that make nothing fold into the row they lead to. Outside a project, the same sidebar replaces the rail.
  • The prompt box holds whatever waits on you, one thing at a time, with its action where Send is. A status pill above it says what's happening. Plugin screens open in their own space beside the main area when you press Open, not in the thread. Over a running app, the box shrinks to a pill so it covers as little of the app as it can.
  • Written documents read as a printed page with their sections beside it, and the chat pulls up over the page as a sheet, so you can reply without leaving it.
  • Comments on a page: select a passage to leave a comment beside it. The box collects them in a "3 comments" token and sends them together, with anything typed beside them.

For the sidebar to list what the project makes, it has to know what each step produces. The hub's plan view now says so (makes, plus a ready-made plan's name and outcome), so the web app still names no plugin.

Plan: Builder UI revamp.

Summary

-<Rail>                            everywhere, with projects in progress and the workspace switcher
+<WorkspaceSidebar>                outside a project: New project, Connect a model, 5 recent projects
 <Room>
-  <PlanPanel> + Plan button and meter
+  <ProjectSidebarView>            one row per thing the project makes, the app line, links in the foot
   <Conversation>                  turns at a chat's measure (48rem), canvas edge to edge
-    question, approval and plugin cards in the thread
-    <NextStepLine>
-    conversation map
+  <PluginSpace>                   plugin screens, closed until Open: a column, or a sheet below 900px
   <ProjectView>
-    <PanelTabs> + tab menu + close button
+    plugin tabs such as Publish   their status in the room's top bar, beside Project
-    <DocumentView>                for written documents and the user manual
+    <WrittenDocument>             <DocumentPage> + <DocumentContents>
+      <CommentCard>               beside its passage, or over the page where the margin is narrow
   <PromptBox>                     floats over the project view, its bar upright
+    pill over the running app     what waits (or what is happening) in one line, its action at the end
+    <StatusPill>                  one line, one action
+    comments token                "3 comments": opens the page, × removes them (Undo)
+    waiting card                  question → approval → step to go ahead → plugin screen
+    <ChatSheet>                   the room's thread, pulled up over the project view

Each sidebar row is one thing the project makes, and steps that make nothing fold into the row they lead to:

Bakery orders
  [notebook] Problem brief          done: opens the brief
  [palette]  Design                 spinner while it is made
  [list]     Build plan             shaded: waits on you, with what for under its name
  [app]      App                    faint: not started
  [globe]    Published on Cloudflare

The icon comes from the plan view, so the host still names no plugin:

 PlanStepView
+  makes?: string[]          from the action's returns: filed:<kind> → kind, app_exists → "app"
 PlanGroupView
+  name?: string             the ready-made plan's short name, from its manifest
+  outcome?: "published"     what a plan that files no document ends in

The new logic is in plain files, each with tests:

  • project-outline.ts and project-sidebar.model.ts: the rows for what the project makes, their states and the sidebar's props.
  • waiting.ts: what waits on the person, and in what order.
  • room-status.ts: what the pill says and its one action, from the first rule that fits.
  • prompt-box.model.ts: the box's card, the pill's line and the space's screen.
  • comments.ts: which drafts exist, the message they make and the page they're on.
  • document-page.model.ts, plus version-reading.ts, approve-group.ts and version-notes.tsx, which it shares with the mockup, sheet and package views.

Removed in this PR:

  • PlanPanel.
  • The rail, in and outside a project, with its projects-in-progress list, its workspace switcher and the Back control in Settings.
  • The tab strip and its tab menu, and the project view's close button.
  • The next-step line and the conversation map.
  • The questions card's conversation layout, and plugin screens in the thread and over the room.
  • The Add to prompt offer on a selected passage and its quotes in the box, replaced by comments.
  • What's new.
  • The sidebar's file list, with the room's remove-attachment and print commands.
  • DocumentView and user-manual.view.tsx for written documents.

Reading the commits

This PR is stacked on #344. Together the two replace #303–#306 and #335–#338.

The 68 commits come in four runs.

The first 29 rebuild the old stack so it reads in order, and each makes one change in its final form:

  1. The sidebar in the room (7).
  2. What waits moves into the box (9).
  3. The room's measure (4).
  4. Written documents as a printed page (6).
  5. The chat sheet over the project view (3).

The largest commit is feat(web): move what waits on the person into the prompt box (21 files). It changes the room's slots and its model together, because the states in between don't typecheck.

The last 16 came from testing the PR:

  1. chore(web): merge the redesigned sidebar and chat sheet into the room merges in the base's new sidebar and its one-motion chat sheet, and deletes code that only the sidebar's file rows used.
  2. The sidebar outside a project (4): the two sidebars share a frame and foot, the rail is removed, and recent projects replace Get started.
  3. The chat and the project view (3): full screen opens the room's own chat, and one transition moves between the two.
  4. The sidebar's rows (8): the hub says what each step files and makes and what a ready-made plan ends in. The sidebar shows each row with an icon, and a done row opens what it made.

The last 9 came from using the running app, where the box covered its foot:

  1. The box over the app (9): over a running app the box shrinks to a pill that says what waits, with its action at the end; pressing the pill opens the box. A waiting plugin screen no longer opens a column by itself; Open brings it up, and Close or Escape puts it away. fix(web): end the running app above the prompt box docked the box under the app instead, and fix(web): let the running app run beneath the prompt box again reverts it, so the pair can be skipped. b0c081f0 fixes a story that checked the project view before its view transition ran.

The last 14 came from going through the comment flow against the Figma design:

  1. Comments on a page (14): the room-comments commits from the base, taken as they are, put a comment card beside each selected passage and a comments token in the box that sends them. feat(web): open the commented page from the box's comment token makes the token open the page, with × to remove the comments and Undo. feat(web): turn down a waiting screen from the box with Not now lets a plugin screen the coordinator asked about, such as Publish, be turned down from the box. The last two fix a comment field that scrolled the page up when it opened, and a selected passage that stayed selected until another was chosen.

Evidence

  • Before: feat(web): put the project sidebar in the room in place of the rail, plan panel and tab strip #335–feat(web): pull the chat up over the project view as a sheet #338 had 49 commits, several of which fixed earlier commits in the stack.
    After: the first 29 commits end on the same tree as feat(web): pull the chat up over the project view as a sheet #338 (git diff room-chat-sheet 83753084 is empty), and the last 16 build on it.
  • Every commit passed the pre-commit checks (format, oxlint --deny-warnings, dependency boundaries, typecheck).
  • At the head (0e97bb50), bun --conditions=intx-src test ./apps/web/src ./packages apps/hub/src/plugins apps/hub/src/plans reports 437 tests: 0 failing and 9 skipped. comments.test.ts covers the drafts, the message they make and Undo. That includes project-outline.test.ts (each row's makes, and the publish row as published) and execute.test.ts (a ready-made plan's group has its name and outcome). I haven't run the tests at each of the last 39 commits.
  • The sidebar, room and app stories render in light and dark. All 71 room stories pass their play functions at the head, including the pill over the app (AppScreenWaiting, AppApprovalWaiting, AppWorking, AppBoxOpens) and Open, Close and Escape on the plugin space (ScreenOpened). The comment and document stories pass at 1280 and 1920 wide, except the two that type (CommentPutAway, and EnterSaves, which fails before this PR's comment fixes too): in Storybook here, typed letters reach the field but React never sees them, as with the font picker's typing stories. Setting the field's text directly, a comment with words stays on a press elsewhere and an empty one goes, at both widths.

How to test: check out room-revamp, then run bun install, bun run dev and bun run dev:seed -- --fixture=habit-tracker --stage=ready_to_build. Connect a model provider in Settings to see questions, approvals and replies live.

  1. Sidebar outside a project. It shows New project, Connect a model while none is connected, and the five recent projects. It opens and closes with ⌘\, and below 900px it is a drawer.
  2. Sidebar in a project. Each row has an icon for what it makes, a spinner while its step runs and an alert if the step failed. A row waiting on you is shaded, with what it waits for underneath. A done row opens what it made. The … menu has Pause before this step and Skip this step. The app line has Open app.
  3. Prompt box. The pill says what is happening, with at most one button. A question, an approval or a step waiting for Go ahead shows in the box, with its green action where Send is. Typing brings back blue Send; sending answers the question or declines the approval. While work runs, Send changes to red Stop.
  4. Plugin screens. When a screen like choosing a design waits, the box lists it with Open, and its main action stands where Send is. Open brings up the plugin space, as a column beside the main area or below 900px as a sheet; Close or Escape puts it away. Publish is still a tab in the project view, and its status shows in the top bar beside Project.
  5. Box over the app. Open the running app. The box shrinks to a pill that says what waits, or what is happening, with the action or Stop at its end. Pressing the pill opens the box with the cursor in it; pressing the app with nothing typed shrinks it again. With the chat pulled up, the box stays open.
  6. Printed page. Each written document is a page with its sections beside it, and versions, Compare, Approve, zoom and download in its bar. The user manual says "As built".
  7. Chat sheet. Over the project view, the handle or the pill pulls the chat up around the box. Full screen moves to the room's own chat in one transition, and Project brings the page back. Escape puts the sheet back, and the cursor and any half-typed message are still there.
  8. Comments. On the brief, select a passage: a card opens beside it, or over the page on a narrow window, and the page doesn't move. Pressing elsewhere with nothing written puts it away and clears the passage; with words written it stays. Saved comments show in the box as "N comments": pressing it opens the page, × removes them with Undo, and Send sends them with anything typed beside them.
  9. Not now. When the coordinator asks about a plugin screen such as Publish, the box offers Not now beside Open, which answers it without opening the screen.
  10. Repeat 2, 3, 5, 7 and 8 in dark mode.

Storybook: Screens/Workspace/Room, ProjectSidebar, WrittenDocument and the plugin screens.

Merge Danger

Door: two-way

There is no migration and no change to stored data, so a revert brings back the old room as it was. On the hub, this PR only adds optional fields to the plan view (makes, name, outcome) and an optional outcome to the ready-made plan manifest, which three publish plugins set.

Blast Radius: every screen

Navigation changes on every page. In the room, the layout changes, questions and approvals move into the prompt box, and written documents read as a printed page. Known gaps:

  • The room has no way to remove an attachment or print now that the sidebar lists no files.
  • Over a running app, the pill still covers a strip in the middle of the app's foot.
  • Below 900px the pill shows only what waits; opening a plugin screen takes two presses, the pill and then Open.
  • A button with a text label makes the upright bar wider.
  • The contents list gets squeezed when the page is zoomed.
  • I haven't checked the mockup tweaks panel by eye.
  • After the last 39 commits I've checked only their stories, not the live room. Sending comments, the token, Undo and Not now are untested against a running coordinator.
  • A comment doesn't yet show Being changed or Changed once a new version addresses it, and the pill doesn't say "Working on N comments": the hub doesn't know which comments a version took in.

@corbitsdev corbitsdev deleted a comment from corbits-triage Bot Nov 22, 2026
@pratikbuilds
pratikbuilds added this pull request to stack #349 November 23, 2026 06:20
@pratikbuilds pratikbuilds changed the title feat(web): revamp the room: sidebar, prompt box, printed page and chat sheet feat: revamp the room and the sidebar: what the project makes, prompt box, printed page and chat sheet Nov 23, 2026
@pratikbuilds pratikbuilds changed the title feat: revamp the room and the sidebar: what the project makes, prompt box, printed page and chat sheet feat: revamp the room and replace the rail with the new sidebar Nov 23, 2026
@pratikbuilds pratikbuilds changed the title feat: revamp the room and replace the rail with the new sidebar feat: revamp the project room and replace the rail with the sidebar Nov 23, 2026
expect(view?.state).toBe("done");
});

test("a step says what it makes, as its action's returns name it for its input", () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All those tests are misplaced. planState tests should live in `plan.test.ts`. There should also be a proper catalog building step there.
This can be done in a separate "test cleanup" PR on top of the stack, to not interfere with it, since it'll move old tests too.

Comment on lines +2 to +5
* The bar's approval of the document being read: the version on show once approved, else Approve
* while it is the newest. An older version read from the menu is neither, since only the newest
* can be approved.
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always ask for a deslop step at the end of the process. Here's how this looks after I asked for a deslop:
```
/**
* What the bar shows for approving the document being read. If the version on screen is

* approved, it says so; if it isn't approved but is the newest, the bar offers Approve.

* An older version opened from the menu gets neither, because only the newest version

* can be approved.

*/
``` Not Shakespeare, but much better than the ", else Approve while..." weird sentence structure above.

import type { DocumentApprovalControl } from "./deliverable-block.tsx";
import type { PaneBarGroup } from "./pane-bar.tsx";

export function useApproveGroup(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in general, documentation above a function is better than the above style in the beginning of a file.

},
];
if (viewing !== newest) return [];
const approve = async () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something smells of stale captured scope related bugs here.

@@ -63,7 +65,6 @@ function render(selected: PaneDocument | null, state?: DeliverableState) {
onSelect={() => {}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This noise happens because all our onX events are non nullable, but often needed as null, so we end up passing those empty lambdas everywhere. This is really ugly and creates LOC bloat, as well as context spam for both humans and agents. This can be fixed on a cleanup PR on top of the stack.

@@ -85,8 +86,8 @@ describe("persistent artifact pane", () => {
const html = render(ready, document);
expect(html).toContain("Real output");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even know what those god-awful tests are testing. Nuke them all! This kind of test will churn really hard. Any change in copy will change the test. We shouldn't in general base tests on copy. See these principles:
https://testing-library.com/docs/queries/about#priority

]);

// Each document's tabs: one per document, two for the design.
/** The app's manual as a written page: no versions to pick, its pictures where it places them. */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this comment even mean? We must improve the prose or filter it out from our PRs

/** The design concepts the person compares, a tab each, until one is picked. */
concepts: readonly DesignConcept[];
/** A tab the conversation asks for that is not a filed document, such as a concept. */
/** The tab the room asks for, from the conversation or the sidebar; a new object asks again. */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also should avoid churning like crazy through comments. I'm not 100% sure why this comment here was touched. Also this comment is horrible. Let's pay attention to prose. We don't want to drown in so much slop we can never fix it again.

import { wording } from "../../config.ts";
import styles from "./box-cards.module.css";

const text = wording.promptBox.waiting;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

* the box's placeholder and what Send sends. A card waiting inside the box hands over its whole row
* of buttons; a screen covering the page hands over only its forward action, since its way back
* stays with the page.
* of buttons; a screen in the plugin space beside the box hands over its row and its forward action

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this diff?

{...parts}
/>,
);
expect(html).toContain("Weather design");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's nuke ALL tests that do this. This is nonsense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On it

React's autoFocus scrolled the page to where the card first sat, before the
page measured its place beside the passage, carrying the reader up the page.
Focus it without scrolling instead.
A passage selected to comment on stayed selected until another was chosen.
A press anywhere else now puts the card away, and its passage with it, when
nothing has been written; words written stay. Where the margin is too narrow,
the card over the page no longer closes on such a press, a blur or a scroll
while it is being written, so its field decides there too.
The pill over the running app said only "The app is running", and work going
on showed no dots there either. The pill now leads with the thinking dots
while work runs, folded or not, and with a green dot that sends out a slow
ring while the app is up, the green the sidebar marks the app with. Under
reduced motion the dot stays still.
Work going on now shows a light running clockwise round a ring of ink dots,
its head a touch larger with a fading tail, in place of the chat's three
dots. The running app shows a ring of green dots that gathers into one point
and opens again, turning a little with each breath, in place of the pulsing
dot. Under reduced motion the first stands as a ring fading round to its
head and the second stands open.
White on the lighter dark-mode blue and green was about 2.6:1, below WCAG AA for every Send, Approve, Continue and Use button. Black on the same fills is about 8:1.
The room rebuilt a ResizeObserver and read the box's layout on every render, so every keystroke and streamed word. It now sets the observer up once and measures again when the box resizes, when the grip above it comes or goes, or when the chat sheet opens or closes.
Escape closed the plugin screen and the pulled-up chat together, and after one screen replaced another it could miss the new one. The handler now reads the current screen through useEffectEvent and leaves the key to an open chat sheet.
Full screen from the chat over a plugin screen closed the screen but could leave the project view open. It now closes both.
Escape on "Approve and discard N comments?" cancelled the question and then reached the room, which closed the whole view. The confirmation now marks the key as used.
Saving an edited comment kept its old quote and occurrence, so dragging its handles while editing was lost. A moved passage is now quoted again from the version on show.
Dragging a passage handle onto the title gave the comment an occurrence of -1, which showed it as a missing passage. A handle now only follows the caret inside the document's text, where passages are counted.
The comment box opened on the first Shift+Arrow key-up, after one character, because the check also fired while Shift was still held.
With Use Concept in the prompt box and nothing unavailable, the concept choice drew no bar, so a failed send showed no error. The bar now also stands when the screen has a fault.
Buttons a screen draws through ActionsSlot were inert while sending, but its forward action through PromptAction was not, so Use Concept could be pressed twice. Both slots now wrap what they draw in the same inert hold.
Pulling the chat sheet or dragging a comment handle left listeners on window if the view unmounted mid-drag, and the sheet could keep springing. Each drag now owns an AbortController that its end and unmount abort, and the handle drag follows only its own pointer.
Switching versions quickly let a slower read of an earlier pick replace the one on show, and Compare could read changesOpen from before the await. Each read is numbered and only the latest is used, and changesOpen is read after the await.
Over the document it asks to approve, the box folded to the typing row
and Approve, so a person reading the page lost track of what Approve
agreed to. The box now keeps the card's title above the words. The
summary and document chip stay folded because the page shows them.
Comments on the document also answer the approval, and the old text
mentioned only typing a change.
The next-step line is gone, but the room still asked the hub for it every 5 seconds. Only the prompt box's placeholder read the answer. The placeholder now reads the facts behind the status pill, and the poll, its read and its query key are removed. The hub route is left for the e2e test that calls it.

One placeholder changes. The hub counted the coordinator as working, and an idle one often showed as starting, so a project with its app running asked "What do you want to say…". Now the coordinator counts only mid-turn, and that project asks "What needs to change…".
A decision screen sent feedback back through ReplyBox.stage and the room's stagedSend. Other screens used the PromptSend port. Send went down two paths.

Now PromptSend holds Send's label too, and its take may return a promise; the box clears once that resolves true. The review offers its send-back through the port and sets its placeholder with usePromptPlaceholder. The room's staging code is deleted.

usePromptPlaceholder sets nothing for a screen with no placeholder. Otherwise the host would clear the text its view set.

With files attached, Send used to send the feedback back and leave the files behind. It sends words and files as one message now.
The room kept four flags about the plugin space and asked the DOM
whether the chat sheet was up before Escape closed anything. It now
keeps only the person's last say about the screen, derives the cover
from it, and the chat sheet reports when it is pulled up.
Comments alone, a shell answer, a screen, comments with words, then an
ordinary message: the order lives in one tested function rather than
the Send handler's early returns.
The room wrote reply steps, run cards, hand-off sightings and the latest
reply time into refs while rendering, so a render React threw away
still left them behind. Each render now works out what it learned
without changing anything and stores it after commit.
The prompt box, the comment drafts and the project sidebar each took
their own copy of the project id, the open tab and how to send or
reload. They now share one RoomSession, so the comments see the same
open tab as the rest of the room.
The text, attached files, sent stand-ins and send faults leave useRoom
for a hook of their own. The room still decides where a send goes:
a question, an approval or the coordinator.
The workspace is keyed by project and the opening message is set before
it mounts, so these effects only ever set state to the values it
already started with.
Each move of a passage handle set state in WrittenDocument. DocumentView is not memoized, so the
whole Markdown was parsed and rendered again. Because the passages changed too, measure was rebuilt
and the page's two observers disconnected and reattached on every move.

The body is memoized on its text and images. The observers reach measure through useEffectEvent,
so they subscribe once. The layout effect still measures whenever the passages change.
paint set the history's height and then read two rects, forcing a layout on every spring frame
and drag move. It now reads first and writes after, so the fade trails the height by one frame.
Each spring step also reads openHeight once instead of twice.
The dock's MutationObserver watches its whole subtree. When the page covers the conversation, the
chat sheet in the dock holds the history, so every streamed word ran a querySelector and forced a
layout. Changes inside the chat's history move neither the grip nor the box. They are skipped now.
The thread filter, each call's parts and the specialist lists all called standing(unit), three or
more times per unit on every streamed word. A per-render cache keyed by the unit's key answers
the repeats.
The link opened the project view on the live app while the coder was still writing it, and that
page was broken mid-build. Nothing else used the row's watch action, so it goes with the link: its
wording, the model's watch field and the room's onWatch.

Refs CL-12475
Since eccbfc0 the saved app is the tip of the app repository's main, and the coder pushes there
in the background while it builds. Publish showed a few seconds into the first build, with a
half-written app behind it.

Publishing now also needs the app_exists fact, which the hub records once the coder files an app
after its checks pass. A project with a release or a holding keeps its status either way.

Refs CL-12473
The corner's label was muted grey in an outlined box, so Published and Publish looked disabled.
Its text is now full strength like Download and Share, and it fills on hover. A status that needs
the person shows a dot before its words.

Two labels change. The paused state said "Carry on publishing", but the button only opens the
Publish page, so it now says "Publishing paused". "Time to keep it is up" is now "Check your app",
marked as needing the person: only they know whether they kept it. Screen readers hear "Publish"
once instead of "Publish: Publish", and the hover says "Open the Publish page".
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.

3 participants