Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
520e07c
feat(web): say what waits on the person, in order
pratikbuilds Nov 20, 2026
84c031a
feat(web): say what the status line shows, first rule that fits
pratikbuilds Nov 20, 2026
f949fb8
feat(web): add the plugin space and the box's step and screen cards
pratikbuilds Nov 20, 2026
a421701
feat(web): move what waits on the person out of the chat
pratikbuilds Nov 20, 2026
ff92ef0
refactor(web): remove the next-step line
pratikbuilds Nov 20, 2026
20b5e98
test(web): draw the room's waiting states in Storybook
pratikbuilds Nov 20, 2026
eddd7ae
refactor(web): draw an open question only in the prompt box
pratikbuilds Nov 20, 2026
7199663
fix(web): keep the document's floating bar clear of the status pill
pratikbuilds Nov 20, 2026
10a5d01
fix(web): put the cursor back in the box once the plugin sheet goes
pratikbuilds Nov 20, 2026
c54e460
fix(web): name a held step as the plan names it
pratikbuilds Nov 20, 2026
914b032
refactor(web): leave the go-ahead to the prompt box
pratikbuilds Nov 20, 2026
fbe93c4
fix(web): keep the page on the window's midline beside the plugin space
pratikbuilds Nov 20, 2026
d994f62
refactor(web): remove the conversation map
pratikbuilds Nov 20, 2026
94244d6
feat(web): widen the turns and the box to a chat's measure
pratikbuilds Nov 20, 2026
b24aa8d
feat(web): keep the box's notices on its measure, their buttons quiet
pratikbuilds Nov 20, 2026
898d04f
feat(web): lay the room's canvas edge to edge beside the sidebar
pratikbuilds Nov 20, 2026
7b1c814
fix(web): raise the way back to the latest message above the pill
pratikbuilds Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 39 additions & 35 deletions apps/web/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,6 @@ export const wording = {
checklistDone: "Checked",
checklistOpen: "Not checked yet",
},
nextStep: {
action: {
open_app: "Open the preview",
reply: "Reply",
resume_coordinator: "Start the coordinator",
},
},
paneBar: {
hide: "Hide the controls",
show: "Show the controls",
Expand Down Expand Up @@ -591,16 +584,6 @@ export const wording = {
},
conversation: {
label: "Conversation",
map: "Conversation map",
/** A map entry for a filed document: "Requirements v1". */
mapDocument: (name: string, version: number) =>
`${name} v${String(version)}`,
/** A map entry with where it ended: "Pick a font · Answered". */
mapMarked: (label: string, mark: string) => `${label} · ${mark}`,
/** How the map marks a question or approval once answered. */
mapAnswered: "Answered",
/** A map marker's accessible name, saying it jumps there, so it never shares a name with the card's own controls. */
mapGoTo: (label: string) => `Go to: ${label}`,
empty: "Nothing in the conversation yet",
emptyLead:
"Replies show here, and each saved document opens from where it was saved.",
Expand All @@ -614,9 +597,8 @@ export const wording = {
/** A plugin tab's status in the room's top bar, for a screen reader, which otherwise hears only it. */
tabStatus: (tab: string, status: string) => `${tab}: ${status}`,
openTab: (tab: string) => `Open ${tab}`,
/** A plan step's settings and go-ahead, in its row's menu in the project sidebar. */
/** A plan step's settings, in its row's menu in the project sidebar. */
plan: {
goAhead: "Go ahead",
askFirst: "Ask me first",
notChanged: "That step could not be changed.",
},
Expand All @@ -635,6 +617,43 @@ export const wording = {
open: "Open",
seeChanges: "See what changed",
},
/** The pill's one line, and its button, as room-status.ts picks them. */
status: {
sending: "Sending your message",
thinking: "Thinking…",
/** One piece of work, and how many more go on beside it. */
andMore: (doing: string, more: number) =>
`${doing} and ${String(more)} more`,
didNotFinish: (doing: string) => `${doing} did not finish`,
stepFailed: (step: string) => `${step} did not finish`,
/** The hub has no retry, so the button asks for one, and says so. */
tryAgain: "Ask to try again",
tryAgainMessage: "That did not finish. Please try again.",
ready: (title: string, version: number) =>
version > 1
? `${title} version ${String(version)} is ready`
: `${title} is ready`,
appRunning: "The app is running",
appFailed: "The app did not start",
open: "Open",
},
/** The box's card for what waits on the person, where no card of its own says it. */
waiting: {
/** A step the person asked to be consulted on, held until they say go ahead. */
step: (title: string) => `Go ahead with “${title}”?`,
stepDetail: "You asked to be asked first.",
goAhead: "Yes, go ahead",
/** A plugin's screen waiting in the plugin space. */
screen: (title: string) => `${title} is waiting for you`,
openScreen: "Open",
/** The placeholder while a step waits: words sent instead go to the coordinator. */
stepPlaceholder: "Or say what to do instead…",
},
/** The space beside the main area where plugin screens open. */
space: {
label: "Waiting for you",
close: "Close",
},
/** The token in the typing row while comments on a document wait to be made. */
comments: (count: number) =>
count === 1 ? "1 comment" : `${String(count)} comments`,
Expand Down Expand Up @@ -1128,23 +1147,14 @@ export const wording = {
/** Where the open question sits among them, beside the heading. */
position: (at: number, count: number) =>
`${String(at)} of ${String(count)}`,
/** The list of questions, answered ones above the open one. */
thread: "Questions",
pickOne: "Pick one",
pickAny: "Pick any that apply",
selected: (picked: number, count: number) =>
`${String(picked)} of ${String(count)} selected`,
/** The row where the person types their own answer instead. */
other: "Something else…",
/** The field where the person types their own answer. */
otherAnswer: "Your own answer",
/** The field of a question with no options to pick from. */
typed: "Type your answer…",
changeAnswer: (prompt: string, answer: string) =>
`Change your answer to "${prompt}": ${answer}`,
earlier: (count: number) =>
count === 1 ? "1 earlier answer" : `${String(count)} earlier answers`,
/** After the next question, how many more follow it. */
more: (count: number) => `+${String(count)} more`,
back: "Back",
next: "Continue",
backKeys: "Previous question (←)",
Expand All @@ -1156,7 +1166,6 @@ export const wording = {
addDetails: (picked: string) => `Add details for ${picked}…`,
/** The tag on the option the coordinator recommends. */
recommended: "Recommended",
send: "Send answers",
sending: "Sending…",
/** Closes an open question without choosing; the reply is what the settled card then shows. */
cancel: "Cancel",
Expand Down Expand Up @@ -1185,11 +1194,6 @@ export const wording = {
screenUnavailable:
"This question cannot be shown here. Answer it in your own words below.",
screenLoading: "Loading…",
/** In the conversation while a screen placed over the room is open but closed for now. */
pageScreenOpen: "Waiting for your review.",
pageScreenReopen: "Open",
/** On a screen placed over the room, back to the conversation without answering. */
pageScreenClose: "Back to the conversation",
/** Beside Send, and its name, while a screen's decision has items to send back, such as "2 comments". */
sendBack: (items: string) => `Send feedback · ${items}`,
/** What the prompt box asks meanwhile. */
Expand Down
43 changes: 43 additions & 0 deletions apps/web/src/pages/workspace/box-cards.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Laid out like the box's other waiting cards: the ask on top, a quiet line under it. */
.card {
display: grid;
gap: var(--space-1);
padding: var(--space-4) var(--space-4) 14px;
}

.head {
display: flex;
align-items: center;
gap: var(--space-3);
}

.ask {
flex: 1 1 0;
min-width: 0;
margin: 0;
font-size: var(--text-sm);
font-weight: 600;
line-height: 20px;
overflow-wrap: anywhere;
}

.detail {
margin: 0;
color: var(--wb-muted-foreground);
font-size: var(--text-sm);
line-height: 20px;
}

/* The pill shape of the row's buttons; a way to the screen, not the step forward. */
.open {
flex: none;
height: 32px;
padding-inline: 14px;
border-radius: 9999px;
}

.answers {
display: flex;
align-items: center;
gap: var(--space-2);
}
85 changes: 85 additions & 0 deletions apps/web/src/pages/workspace/box-cards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/**
* The prompt box's cards for what waits on the person where nothing else draws one: a step held for
* their go-ahead, and a plugin's screen waiting in the plugin space. Each heads the box with what it
* asks; its one forward action stands where Send does.
*/
import { useContext } from "react";
import { Button } from "@corbits/react-ui";
import {
ActionsSlot,
usePromptPlaceholder,
} from "@corbits-builder/plugin-ui/screen-actions";
import { wording } from "../../config.ts";
import styles from "./box-cards.module.css";

const text = wording.promptBox.waiting;

/** A step the person asked to be consulted on: Yes, go ahead stands where Send is. */
export function StepCard({
title,
busy,
onGoAhead,
}: {
title: string;
/** The go-ahead is on its way, so the card holds until it lands. */
busy: boolean;
onGoAhead: () => void;
}) {
const slot = useContext(ActionsSlot);
usePromptPlaceholder(text.stepPlaceholder);
const ask = text.step(title);
const yes = (
<div className={styles.answers} inert={busy}>
<Button type="button" size="sm" onClick={onGoAhead}>
{text.goAhead}
</Button>
</div>
);
return (
<section
className={styles.card}
aria-label={ask}
data-slot="box-card"
data-kind="step"
>
<p className={styles.ask}>{ask}</p>
<p className={styles.detail}>{text.stepDetail}</p>
{slot === null ? yes : slot(yes)}
</section>
);
}

/**
* A plugin's screen waiting in the plugin space: Open takes the person to it. The screen's own
* forward action reaches the box from the space.
*/
export function ScreenCard({
title,
onOpen,
}: {
title: string;
onOpen: () => void;
}) {
const ask = text.screen(title);
return (
<section
className={styles.card}
aria-label={ask}
data-slot="box-card"
data-kind="screen"
>
<header className={styles.head}>
<p className={styles.ask}>{ask}</p>
<Button
type="button"
size="sm"
variant="outline"
className={styles.open}
onClick={onOpen}
>
{text.openScreen}
</Button>
</header>
</section>
);
}
12 changes: 6 additions & 6 deletions apps/web/src/pages/workspace/box-ports.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* What a screen can reach in the prompt box from wherever it is drawn: the slot where Send stands,
* 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
* alike, whichever it draws, so the box keeps the one main action.
*/
import { useCallback, useMemo, useState, type ReactNode } from "react";
import { createPortal } from "react-dom";
Expand Down Expand Up @@ -46,20 +46,20 @@ export function useBoxPorts(): BoxPorts {
);
}

/** Connects what it holds to the box: as the card waiting in it, as the page over it, or not. */
/** Connects what it holds to the box: as the card waiting in it, as the screen beside it, or not. */
export function InBox({
ports,
as,
children,
}: {
ports: BoxPorts;
as: "card" | "page" | null;
as: "card" | "space" | null;
children: ReactNode;
}) {
const on = as !== null;
return (
<ActionsSlot value={as === "card" ? ports.toRow : null}>
<PromptAction value={as === "page" ? ports.toRow : null}>
<ActionsSlot value={on ? ports.toRow : null}>
<PromptAction value={as === "space" ? ports.toRow : null}>
<PromptPlaceholder value={on ? ports.setPlaceholder : null}>
<PromptSend value={on ? ports.setTake : null}>{children}</PromptSend>
</PromptPlaceholder>
Expand Down
10 changes: 9 additions & 1 deletion apps/web/src/pages/workspace/chat-sheet.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ function Page({ children }: { children: ReactNode }) {
return (
<div style={{ position: "relative", height: "100vh" }}>
<div className={room.page} style={{ background: "var(--wb-frame)" }}>
<div className={room.pageScreen} style={{ overflow: "auto" }}>
<div
style={{
display: "flex",
flex: 1,
flexDirection: "column",
minHeight: 0,
overflow: "auto",
}}
>
<article
style={{
width: "min(640px, calc(100% - 32px))",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/pages/workspace/colour-picker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export const Open: Story = {
).toHaveFocus();
},
};
export const PageSubmission: Story = {
args: { state: "chosen", placed: "page" },
export const SubmitFromSpace: Story = {
args: { state: "chosen" },
play: async ({ canvas, userEvent }) => {
await userEvent.click(await canvas.findByRole("button", { name: SEND }));
await expect(
Expand Down
16 changes: 7 additions & 9 deletions apps/web/src/pages/workspace/concept-choice.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ const screen = storyScreen(
},
);

// Placed on the page: the room covers the conversation with it, and the conversation keeps a card
// that opens it again.
// In the plugin space beside the room's main area.
const meta = {
title: "Screens/Plugins/ConceptChoice",
component: ScreenStory,
parameters: { layout: "fullscreen" },
args: {
screen,
state: "open",
placed: "page",
input: {},
project: {},
draft: {
Expand Down Expand Up @@ -83,26 +81,26 @@ export const Refused: Story = {
},
};
export const Answered: Story = {
args: { state: "answered", placed: "conversation" },
args: { state: "answered" },
};
export const Replied: Story = {
args: { state: "replied", placed: "conversation" },
args: { state: "replied" },
};
export const Closed: Story = {
args: { state: "closed", placed: "conversation" },
args: { state: "closed" },
};
/** This interface has no view for the screen. */
export const NotInstalled: Story = {
args: { state: "missing", placed: "conversation" },
args: { state: "missing" },
};

// The picker over the page with the prompt box beneath it, sharing the box as the room does.
// The picker in the plugin space with the prompt box beside it, sharing the box as the room does.
function OverTheBox(props: ComponentProps<typeof ScreenStory>) {
const ports = useBoxPorts();
return (
<>
<div style={{ flex: 1, minHeight: 0, overflow: "auto" }}>
<InBox ports={ports} as="page">
<InBox ports={ports} as="space">
<ScreenStory {...props} />
</InBox>
</div>
Expand Down
Loading
Loading