oneslash-design-system 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/DESIGN.md +26 -3
- package/dist/cases/accept-invite/signed-in.jsx +1 -1
- package/dist/cases/accept-invite/signed-out.jsx +1 -1
- package/dist/cases/accept-invite.md +2 -2
- package/dist/cases/agent-options/cards.d.ts +1 -0
- package/dist/cases/agent-options/cards.jsx +91 -0
- package/dist/cases/agent-options.md +168 -0
- package/dist/cases/agent-pending-reply/steps.d.ts +1 -0
- package/dist/cases/agent-pending-reply/steps.jsx +149 -0
- package/dist/cases/agent-pending-reply/streaming.d.ts +1 -0
- package/dist/cases/agent-pending-reply/streaming.jsx +146 -0
- package/dist/cases/agent-pending-reply.md +432 -0
- package/dist/cases/agent-plan-proposal/changes.d.ts +1 -0
- package/dist/cases/agent-plan-proposal/changes.jsx +224 -0
- package/dist/cases/agent-plan-proposal/steps.d.ts +1 -0
- package/dist/cases/agent-plan-proposal/steps.jsx +211 -0
- package/dist/cases/agent-plan-proposal.md +656 -0
- package/dist/cases/agent-question/choices.d.ts +1 -0
- package/dist/cases/agent-question/choices.jsx +132 -0
- package/dist/cases/agent-question/free-text.d.ts +1 -0
- package/dist/cases/agent-question/free-text.jsx +81 -0
- package/dist/cases/agent-question.md +338 -0
- package/dist/cases/agent-shows-sources.md +2 -2
- package/dist/cases/artifact-card/card.d.ts +1 -0
- package/dist/cases/artifact-card/card.jsx +45 -0
- package/dist/cases/artifact-card.md +103 -0
- package/dist/cases/composer-limit/notice-with-action.d.ts +1 -0
- package/dist/cases/composer-limit/notice-with-action.jsx +87 -0
- package/dist/cases/composer-limit/notice.d.ts +1 -0
- package/dist/cases/composer-limit/notice.jsx +84 -0
- package/dist/cases/composer-limit.md +286 -0
- package/dist/cases/conversation-starters/chips.d.ts +1 -0
- package/dist/cases/conversation-starters/chips.jsx +69 -0
- package/dist/cases/conversation-starters/none.d.ts +1 -0
- package/dist/cases/conversation-starters/none.jsx +45 -0
- package/dist/cases/conversation-starters.md +208 -0
- package/dist/cases/mention-list/in-composer.d.ts +1 -0
- package/dist/cases/mention-list/in-composer.jsx +169 -0
- package/dist/cases/mention-list.md +252 -0
- package/dist/cases/message-actions/hover-toolbar.d.ts +1 -0
- package/dist/cases/message-actions/hover-toolbar.jsx +229 -0
- package/dist/cases/message-actions/menu.d.ts +1 -0
- package/dist/cases/message-actions/menu.jsx +258 -0
- package/dist/cases/message-actions.md +651 -0
- package/dist/cases/message-attachments/in-composer.d.ts +1 -0
- package/dist/cases/message-attachments/in-composer.jsx +134 -0
- package/dist/cases/message-attachments/in-message.d.ts +1 -0
- package/dist/cases/message-attachments/in-message.jsx +46 -0
- package/dist/cases/message-attachments.md +310 -0
- package/dist/cases/message-composer/plain.d.ts +1 -0
- package/dist/cases/message-composer/plain.jsx +57 -0
- package/dist/cases/message-composer/with-tools.d.ts +1 -0
- package/dist/cases/message-composer/with-tools.jsx +182 -0
- package/dist/cases/message-composer.md +356 -0
- package/dist/cases/message-edit/in-place.d.ts +1 -0
- package/dist/cases/message-edit/in-place.jsx +99 -0
- package/dist/cases/message-edit.md +179 -0
- package/dist/cases/message-reactions/chips.d.ts +1 -0
- package/dist/cases/message-reactions/chips.jsx +118 -0
- package/dist/cases/message-reactions/quick-pick.d.ts +1 -0
- package/dist/cases/message-reactions/quick-pick.jsx +155 -0
- package/dist/cases/message-reactions.md +371 -0
- package/dist/cases/message-row/grouped.d.ts +1 -0
- package/dist/cases/message-row/grouped.jsx +56 -0
- package/dist/cases/message-row/person-and-agent.d.ts +1 -0
- package/dist/cases/message-row/person-and-agent.jsx +41 -0
- package/dist/cases/message-row.md +189 -0
- package/dist/cases/reply-feedback/thumbs.d.ts +1 -0
- package/dist/cases/reply-feedback/thumbs.jsx +191 -0
- package/dist/cases/reply-feedback/with-reason.d.ts +1 -0
- package/dist/cases/reply-feedback/with-reason.jsx +221 -0
- package/dist/cases/reply-feedback.md +552 -0
- package/dist/cases/reply-sources/cards.d.ts +1 -0
- package/dist/cases/reply-sources/cards.jsx +83 -0
- package/dist/cases/reply-sources/tag-only.d.ts +1 -0
- package/dist/cases/reply-sources/tag-only.jsx +45 -0
- package/dist/cases/reply-sources.md +247 -0
- package/dist/cases/slash-command-list/in-composer.d.ts +1 -0
- package/dist/cases/slash-command-list/in-composer.jsx +162 -0
- package/dist/cases/slash-command-list.md +247 -0
- package/dist/cases/success-feedback.md +1 -1
- package/dist/cases/typing-and-status/line.d.ts +1 -0
- package/dist/cases/typing-and-status/line.jsx +50 -0
- package/dist/cases/typing-and-status.md +96 -0
- package/dist/cases.json +1276 -14
- package/dist/components/button.d.ts +3 -2
- package/dist/components/button.jsx +9 -7
- package/dist/components/composer.d.ts +74 -0
- package/dist/components/composer.jsx +122 -0
- package/dist/components/fileChip.d.ts +33 -0
- package/dist/components/fileChip.jsx +61 -0
- package/dist/components/iconButton.d.ts +3 -3
- package/dist/components/iconButton.jsx +9 -7
- package/dist/components/layout.d.ts +7 -1
- package/dist/components/layout.jsx +5 -2
- package/dist/components/menu.d.ts +21 -0
- package/dist/components/menu.jsx +27 -3
- package/dist/components/menuItem.d.ts +9 -1
- package/dist/components/menuItem.jsx +5 -4
- package/dist/components/message.d.ts +28 -0
- package/dist/components/message.jsx +25 -0
- package/dist/components/paragraph.d.ts +3 -1
- package/dist/components/paragraph.jsx +2 -2
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.jsx +35 -9
- package/dist/components/radioGroup.d.ts +8 -1
- package/dist/components/radioGroup.jsx +19 -8
- package/dist/components/sourceCard.d.ts +23 -0
- package/dist/components/sourceCard.jsx +56 -0
- package/dist/components/stepList.d.ts +17 -0
- package/dist/components/stepList.jsx +79 -0
- package/dist/components/tag.d.ts +9 -1
- package/dist/components/tag.jsx +6 -4
- package/dist/components/textarea.jsx +3 -18
- package/dist/components/userImage.d.ts +9 -1
- package/dist/components/userImage.jsx +10 -3
- package/dist/internal/autoGrow.d.ts +11 -0
- package/dist/internal/autoGrow.js +28 -0
- package/dist/internal/composer.d.ts +16 -0
- package/dist/internal/composer.js +18 -0
- package/dist/internal/menu.d.ts +6 -0
- package/dist/internal/menu.js +31 -0
- package/dist/native-mapping.json +32 -1
- package/dist/stories/Button.stories.d.ts +1 -0
- package/dist/stories/Button.stories.jsx +17 -1
- package/dist/stories/Cases.generated.stories.d.ts +30 -0
- package/dist/stories/Cases.generated.stories.jsx +60 -0
- package/dist/stories/Composer.stories.d.ts +23 -0
- package/dist/stories/Composer.stories.jsx +121 -0
- package/dist/stories/FileChip.stories.d.ts +7 -0
- package/dist/stories/FileChip.stories.jsx +35 -0
- package/dist/stories/IconButton.stories.d.ts +1 -0
- package/dist/stories/IconButton.stories.jsx +18 -1
- package/dist/stories/Menu.stories.d.ts +4 -0
- package/dist/stories/Menu.stories.jsx +46 -1
- package/dist/stories/MenuItem.stories.d.ts +1 -0
- package/dist/stories/MenuItem.stories.jsx +8 -0
- package/dist/stories/Message.stories.d.ts +10 -0
- package/dist/stories/Message.stories.jsx +77 -0
- package/dist/stories/PageComponents.stories.d.ts +1 -0
- package/dist/stories/PageComponents.stories.jsx +21 -0
- package/dist/stories/RadioGroup.stories.d.ts +2 -0
- package/dist/stories/RadioGroup.stories.jsx +40 -1
- package/dist/stories/SourceCard.stories.d.ts +8 -0
- package/dist/stories/SourceCard.stories.jsx +33 -0
- package/dist/stories/StepList.stories.d.ts +8 -0
- package/dist/stories/StepList.stories.jsx +35 -0
- package/dist/stories/UserImage.stories.d.ts +2 -0
- package/dist/stories/UserImage.stories.jsx +19 -0
- package/package.json +4 -3
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
# Plan proposal
|
|
2
|
+
|
|
3
|
+
The agent is about to change shared work and needs the person to approve it first.
|
|
4
|
+
|
|
5
|
+
**Not built yet:** Scindo's plan button reads 'Proceed' and comes first, and its buttons change label while loading, such as 'Proceeding...' and 'Cancelling...'. Its plan card has no View Changes button and shows no waiting time. Scindo's Apple app shows no plan card.
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Follow the rule 'An agent asks before a risky action': the agent does nothing until the person presses 'Approve'.
|
|
10
|
+
- Put the card in the agent's `Message`, in a `Surface` with a heading, the plan, then the buttons.
|
|
11
|
+
- List every step in a `<StepList numbered>`, in the order the agent will do them, each one waiting.
|
|
12
|
+
- Offer 'View Changes' when the changes are ready, so the person sees them before they approve. It opens a `Modal` that lists them.
|
|
13
|
+
- List each changed file in that Modal with one line on what changes in it. ODS has no diff part yet.
|
|
14
|
+
- Order the steps card's buttons 'Cancel', 'Edit', then 'Approve' as the primary Button, at the start of the row under the plan.
|
|
15
|
+
- Order the changes card's buttons 'Cancel', 'Request Changes', then 'Approve' as the primary Button.
|
|
16
|
+
- Let the product write the label 'Approve'. The agent never writes the label of an approve or merge button.
|
|
17
|
+
- Show the waiting time on the card while it waits, and while the person edits: 'Waits 10 more minutes, then cancels.'
|
|
18
|
+
- Notify the person who asked when the agent needs their answer.
|
|
19
|
+
- Make the pressed Button `loading` and keep its label. Disable the others while the request runs.
|
|
20
|
+
- Keep the card and its buttons when a request fails. Show an inline error `Alert` above the buttons, as the rule 'A form error shows next to the problem' says.
|
|
21
|
+
- Mark the card with an 'Approved' or 'Cancelled' `Tag` once it is decided, and remove its buttons.
|
|
22
|
+
- Announce the decided `Tag` politely: the app wraps it in a polite live region.
|
|
23
|
+
- Keep an approved card as the record: the steps as they were approved, none running, and no buttons.
|
|
24
|
+
- Move the run to its own progress row under the card, as the case 'Agent at work' shows, with its 'Stop'.
|
|
25
|
+
- Say how far a stopped run got: 'Stopped after 2 of 4 steps. The rest of the plan was not done.' Take the count from the server's answer, not from the list on screen.
|
|
26
|
+
- Add one compact agent row under a cancelled card that says what was not done: 'Cancelled. Nothing was changed.'
|
|
27
|
+
- Mark the card Cancelled when the waiting time is up, with the same row on what was not done.
|
|
28
|
+
- Turn the steps into a `Textarea` on 'Edit', one step per line, with 'Discard' and 'Save'.
|
|
29
|
+
- Use 'Discard' to leave an edit on an agent card, since 'Cancel' there cancels the proposal. Editing your own message keeps 'Cancel'.
|
|
30
|
+
- Send the edited steps to the agent on 'Save'. The plan comes back with the new steps, still waiting for a yes.
|
|
31
|
+
- Open a `Textarea` labelled 'What should change?' on 'Request Changes', with 'Discard' and 'Send'.
|
|
32
|
+
- Say on the card that the agent is redoing the changes once the request is sent, and remove its buttons.
|
|
33
|
+
- Move focus to the field when 'Edit' or 'Request Changes' opens it, and back to that button after 'Discard', or after 'Save' in an edit.
|
|
34
|
+
- Move focus to 'Stop' when the run's progress row appears.
|
|
35
|
+
- Move focus to the message box when the card's buttons or 'Stop' go away and nothing takes their place.
|
|
36
|
+
|
|
37
|
+
## Don't
|
|
38
|
+
|
|
39
|
+
- Do not carry out any step before the person approves.
|
|
40
|
+
- Do not replace the steps or the changes with a one-line summary.
|
|
41
|
+
- Do not label the approve button 'Proceed', 'Confirm' or 'OK', or let the agent choose its label.
|
|
42
|
+
- Do not change a Button's label while it is loading, such as to 'Proceeding...'.
|
|
43
|
+
- Do not let a second click on a decided card approve or cancel it again.
|
|
44
|
+
- Do not treat no answer as approval.
|
|
45
|
+
- Do not show the run's steps as running on the card. The run has its own row.
|
|
46
|
+
|
|
47
|
+
## Option: Steps
|
|
48
|
+
|
|
49
|
+
Use when: The agent will carry out a list of steps.
|
|
50
|
+
|
|
51
|
+
Uses: `Button`, `Center`, `Cluster`, `Heading`, `Message`, `Paragraph`, `Stack`, `StepList`, `Surface`, `Tag`, `Textarea`, `TimeStamp`, `UserImage`
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
'use client';
|
|
55
|
+
import { useEffect, useRef, useState } from 'react';
|
|
56
|
+
import { Bot } from 'lucide-react';
|
|
57
|
+
import Message from 'oneslash-design-system/components/message';
|
|
58
|
+
import UserImage from 'oneslash-design-system/components/userImage';
|
|
59
|
+
import Tag from 'oneslash-design-system/components/tag';
|
|
60
|
+
import TimeStamp from 'oneslash-design-system/components/timeStamp';
|
|
61
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
62
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
63
|
+
import Button from 'oneslash-design-system/components/button';
|
|
64
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
65
|
+
import StepList, { type StepListStep } from 'oneslash-design-system/components/stepList';
|
|
66
|
+
import Textarea from 'oneslash-design-system/components/textarea';
|
|
67
|
+
import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
68
|
+
|
|
69
|
+
type Focusable = HTMLButtonElement | HTMLAnchorElement | null;
|
|
70
|
+
|
|
71
|
+
const agentName = 'Acme Agent';
|
|
72
|
+
|
|
73
|
+
const request = { from: 'Dana Lee', at: new Date('2025-01-15T11:40:00Z'), text: 'Can you update the pricing page for the new plans?' };
|
|
74
|
+
const proposedAt = new Date('2025-01-15T11:41:00Z');
|
|
75
|
+
|
|
76
|
+
const firstSteps = [
|
|
77
|
+
'Change the Pro price from $12 to $15',
|
|
78
|
+
'Add the Team plan at $25 per seat',
|
|
79
|
+
'Update the plan table on the pricing page',
|
|
80
|
+
'Open a pull request for review',
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const reply = 'The pricing page is updated, and the pull request is open for review.';
|
|
84
|
+
|
|
85
|
+
type Status = 'open' | 'editing' | 'approved' | 'cancelled';
|
|
86
|
+
type Run = 'running' | 'stopping' | 'stopped' | 'done';
|
|
87
|
+
|
|
88
|
+
// Finished steps keep a check, the current one runs, and steps the agent has not started are not shown.
|
|
89
|
+
function stepsUpTo(steps: string[], current: number): StepListStep[] {
|
|
90
|
+
return steps.slice(0, current + 1).map((label, i) => ({ label, status: i < current ? 'done' : 'running' }));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function secondsLine(seconds: number) {
|
|
94
|
+
return `Working for ${seconds} ${seconds === 1 ? 'second' : 'seconds'}`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// The agent's marks, as the rule 'An agent says what it is' says.
|
|
98
|
+
function agentMeta(at: Date) {
|
|
99
|
+
return (
|
|
100
|
+
<>
|
|
101
|
+
<Tag variant="contained" size="small" label="Agent" />
|
|
102
|
+
<TimeStamp createdAt={at} dateFormat="absolute" data="time" />
|
|
103
|
+
<Paragraph size="caption" tone="secondary" measure="none">Model name</Paragraph>
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default function AgentPlanProposalSteps() {
|
|
109
|
+
const [steps, setSteps] = useState(firstSteps);
|
|
110
|
+
const [status, setStatus] = useState<Status>('open');
|
|
111
|
+
const [pending, setPending] = useState<'approve' | 'cancel' | 'save' | null>(null);
|
|
112
|
+
const [draft, setDraft] = useState('');
|
|
113
|
+
// The run after 'Approve', in its own progress row under the card.
|
|
114
|
+
const [run, setRun] = useState<Run | null>(null);
|
|
115
|
+
const [current, setCurrent] = useState(0);
|
|
116
|
+
const [seconds, setSeconds] = useState(0);
|
|
117
|
+
const [startedAt, setStartedAt] = useState(proposedAt);
|
|
118
|
+
const timer = useRef<ReturnType<typeof setTimeout>>();
|
|
119
|
+
const tick = useRef<ReturnType<typeof setInterval>>();
|
|
120
|
+
const step = useRef<ReturnType<typeof setTimeout>>();
|
|
121
|
+
const cancel = useRef<ReturnType<typeof setTimeout>>();
|
|
122
|
+
const editButton = useRef<Focusable>(null);
|
|
123
|
+
const stopButton = useRef<Focusable>(null);
|
|
124
|
+
// Where focus goes after the next render, once the element it goes to is on screen.
|
|
125
|
+
const focusNext = useRef<() => void>();
|
|
126
|
+
|
|
127
|
+
// On unmount it stops the requests, the run and its clock.
|
|
128
|
+
useEffect(() => () => {
|
|
129
|
+
clearTimeout(timer.current);
|
|
130
|
+
clearInterval(tick.current);
|
|
131
|
+
clearTimeout(step.current);
|
|
132
|
+
clearTimeout(cancel.current);
|
|
133
|
+
}, []);
|
|
134
|
+
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
const move = focusNext.current;
|
|
137
|
+
focusNext.current = undefined;
|
|
138
|
+
move?.();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Stands in for the agent's run: one step every 1.5 seconds.
|
|
142
|
+
function advance(at: number) {
|
|
143
|
+
step.current = setTimeout(() => {
|
|
144
|
+
if (at === steps.length - 1) {
|
|
145
|
+
clearInterval(tick.current);
|
|
146
|
+
setRun('done');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
setCurrent(at + 1);
|
|
150
|
+
advance(at + 1);
|
|
151
|
+
}, 1500);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// The card stays as the record, and the run shows in its own progress row below it.
|
|
155
|
+
// 'Approve' is gone and 'Stop' is the control that took its place, so focus goes to 'Stop'.
|
|
156
|
+
function startRun() {
|
|
157
|
+
setRun('running');
|
|
158
|
+
setCurrent(0);
|
|
159
|
+
setSeconds(0);
|
|
160
|
+
setStartedAt(new Date());
|
|
161
|
+
tick.current = setInterval(() => setSeconds((s) => s + 1), 1000);
|
|
162
|
+
advance(0);
|
|
163
|
+
focusNext.current = () => stopButton.current?.focus();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Decided once: the buttons go away, so a second click cannot approve or cancel it again.
|
|
167
|
+
// After 'Cancel' nothing takes their place: a real app moves focus to the message box.
|
|
168
|
+
function decide(action: 'approve' | 'cancel') {
|
|
169
|
+
if (pending || status !== 'open') return;
|
|
170
|
+
setPending(action);
|
|
171
|
+
// Stands in for the request to the server.
|
|
172
|
+
timer.current = setTimeout(() => {
|
|
173
|
+
setPending(null);
|
|
174
|
+
if (action === 'cancel') {
|
|
175
|
+
setStatus('cancelled');
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
setStatus('approved');
|
|
179
|
+
startRun();
|
|
180
|
+
}, 1200);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Stop asks the server to end the run. The row says it stopped only once the run has ended.
|
|
184
|
+
function stop() {
|
|
185
|
+
if (run !== 'running') return;
|
|
186
|
+
clearTimeout(step.current);
|
|
187
|
+
setRun('stopping');
|
|
188
|
+
// Stands in for the request to the server.
|
|
189
|
+
cancel.current = setTimeout(() => {
|
|
190
|
+
clearInterval(tick.current);
|
|
191
|
+
setRun('stopped');
|
|
192
|
+
}, 1200);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function startEditing() {
|
|
196
|
+
if (pending) return;
|
|
197
|
+
setDraft(steps.join('\n'));
|
|
198
|
+
setStatus('editing');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// 'Discard' leaves the edit and keeps the plan as it was. 'Cancel' would cancel the whole proposal.
|
|
202
|
+
function discard() {
|
|
203
|
+
setStatus('open');
|
|
204
|
+
focusNext.current = () => editButton.current?.focus();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const draftSteps = draft.split('\n').map((s) => s.trim()).filter((s) => s !== '');
|
|
208
|
+
|
|
209
|
+
// 'Save' sends the edited steps to the agent. The plan comes back with them, still waiting for a yes.
|
|
210
|
+
function save() {
|
|
211
|
+
if (pending || draftSteps.length === 0) return;
|
|
212
|
+
setPending('save');
|
|
213
|
+
// Stands in for the request to the server.
|
|
214
|
+
timer.current = setTimeout(() => {
|
|
215
|
+
setPending(null);
|
|
216
|
+
setSteps(draftSteps);
|
|
217
|
+
setStatus('open');
|
|
218
|
+
focusNext.current = () => editButton.current?.focus();
|
|
219
|
+
}, 1200);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// A stop says how far the run got, so it never says nothing changed when something did.
|
|
223
|
+
// A real app takes the count from the server's answer, not from the list on screen.
|
|
224
|
+
const stoppedNote = current === 0
|
|
225
|
+
? 'Stopped. Nothing was changed.'
|
|
226
|
+
: `Stopped after ${current} of ${steps.length} steps. The rest of the plan was not done.`;
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
<Center width="page">
|
|
230
|
+
<Stack gap="large">
|
|
231
|
+
<Heading level={1} size="h5">Launch plan</Heading>
|
|
232
|
+
{/* A real app gives the list that holds the rows role="log". */}
|
|
233
|
+
<Stack gap="small">
|
|
234
|
+
<Message
|
|
235
|
+
aria-label={request.from}
|
|
236
|
+
avatar={<UserImage userHandle={request.from} decorative />}
|
|
237
|
+
name={request.from}
|
|
238
|
+
meta={<TimeStamp createdAt={request.at} dateFormat="absolute" data="time" />}
|
|
239
|
+
>
|
|
240
|
+
<Paragraph measure="none">{request.text}</Paragraph>
|
|
241
|
+
</Message>
|
|
242
|
+
<Message
|
|
243
|
+
aria-label={`${agentName}, agent`}
|
|
244
|
+
avatar={<UserImage userHandle={agentName} icon={Bot} decorative />}
|
|
245
|
+
name={agentName}
|
|
246
|
+
meta={agentMeta(proposedAt)}
|
|
247
|
+
>
|
|
248
|
+
<Surface padding="small">
|
|
249
|
+
<Stack gap="medium">
|
|
250
|
+
{/* A real app announces the decided Tag in a polite live region. */}
|
|
251
|
+
<Cluster gap="small">
|
|
252
|
+
<Heading level={2} size="subtitle1">Proposed plan</Heading>
|
|
253
|
+
{status === 'approved' && <Tag variant="contained" size="small" color="success" label="Approved" />}
|
|
254
|
+
{status === 'cancelled' && <Tag variant="contained" size="small" label="Cancelled" />}
|
|
255
|
+
</Cluster>
|
|
256
|
+
{status === 'editing' ? (
|
|
257
|
+
<Textarea
|
|
258
|
+
id="agent-plan-proposal-steps"
|
|
259
|
+
label="Steps, one per line"
|
|
260
|
+
value={draft}
|
|
261
|
+
onChange={(e) => setDraft(e.target.value)}
|
|
262
|
+
onSubmit={save}
|
|
263
|
+
autoFocus
|
|
264
|
+
maxRows={10}
|
|
265
|
+
disabled={pending === 'save'}
|
|
266
|
+
/>
|
|
267
|
+
) : (
|
|
268
|
+
// Every step, in the order the agent will do them. Once decided, the card is the record:
|
|
269
|
+
// an approved plan keeps its steps as they were, and a cancelled one marks each step cancelled.
|
|
270
|
+
<StepList
|
|
271
|
+
numbered
|
|
272
|
+
aria-label="Proposed plan"
|
|
273
|
+
steps={steps.map((label) => ({ label, status: status === 'cancelled' ? 'cancelled' : 'waiting' }))}
|
|
274
|
+
/>
|
|
275
|
+
)}
|
|
276
|
+
{/* The product sets the waiting time and counts it down. When it is up, the card is marked Cancelled. */}
|
|
277
|
+
{(status === 'open' || status === 'editing') && (
|
|
278
|
+
<Paragraph size="caption" tone="secondary" measure="none">Waits 10 more minutes, then cancels.</Paragraph>
|
|
279
|
+
)}
|
|
280
|
+
{status === 'open' && (
|
|
281
|
+
<Cluster gap="small">
|
|
282
|
+
<Button size="small" type="tertiary" state={pending === 'approve' ? 'disabled' : 'enabled'} label="Cancel" loading={pending === 'cancel'} onClickButton={() => decide('cancel')} />
|
|
283
|
+
<Button ref={editButton} size="small" type="secondary" state={pending ? 'disabled' : 'enabled'} label="Edit" onClickButton={startEditing} />
|
|
284
|
+
{/* The product writes this label, never the agent. */}
|
|
285
|
+
<Button size="small" type="primary" state={pending === 'cancel' ? 'disabled' : 'enabled'} label="Approve" loading={pending === 'approve'} onClickButton={() => decide('approve')} />
|
|
286
|
+
</Cluster>
|
|
287
|
+
)}
|
|
288
|
+
{status === 'editing' && (
|
|
289
|
+
<Cluster gap="small">
|
|
290
|
+
<Button size="small" type="tertiary" state={pending === 'save' ? 'disabled' : 'enabled'} label="Discard" onClickButton={discard} />
|
|
291
|
+
<Button size="small" type="primary" state={draftSteps.length === 0 ? 'disabled' : 'enabled'} label="Save" loading={pending === 'save'} onClickButton={save} />
|
|
292
|
+
</Cluster>
|
|
293
|
+
)}
|
|
294
|
+
</Stack>
|
|
295
|
+
</Surface>
|
|
296
|
+
</Message>
|
|
297
|
+
{status === 'cancelled' && (
|
|
298
|
+
// One line in the thread on what was not done, under the card.
|
|
299
|
+
<Message compact aria-label={`${agentName}, agent`}>
|
|
300
|
+
<Paragraph measure="none">Cancelled. Nothing was changed.</Paragraph>
|
|
301
|
+
</Message>
|
|
302
|
+
)}
|
|
303
|
+
{run && (
|
|
304
|
+
// The run's own progress row, as the case 'Agent at work' shows.
|
|
305
|
+
<Message
|
|
306
|
+
aria-label={`${agentName}, agent`}
|
|
307
|
+
avatar={<UserImage userHandle={agentName} icon={Bot} decorative />}
|
|
308
|
+
name={agentName}
|
|
309
|
+
meta={agentMeta(startedAt)}
|
|
310
|
+
footer={
|
|
311
|
+
run === 'running' || run === 'stopping' ? (
|
|
312
|
+
// The only Stop, on the row for the whole run. It shows loading while the run is stopping.
|
|
313
|
+
// When it goes, a real app moves focus to the message box.
|
|
314
|
+
<Cluster>
|
|
315
|
+
<Button ref={stopButton} size="small" type="secondary" state="enabled" label="Stop" loading={run === 'stopping'} onClickButton={stop} />
|
|
316
|
+
</Cluster>
|
|
317
|
+
) : undefined
|
|
318
|
+
}
|
|
319
|
+
>
|
|
320
|
+
{run === 'done' ? (
|
|
321
|
+
<Paragraph measure="none">{reply}</Paragraph>
|
|
322
|
+
) : run === 'stopped' ? (
|
|
323
|
+
<Paragraph measure="none">{stoppedNote}</Paragraph>
|
|
324
|
+
) : (
|
|
325
|
+
// A real app wraps this part in a polite live region, since StepList has none.
|
|
326
|
+
<Stack gap="medium">
|
|
327
|
+
<Paragraph size="caption" tone="secondary" measure="none">{secondsLine(seconds)}</Paragraph>
|
|
328
|
+
<StepList aria-label="Acme Agent's steps" steps={stepsUpTo(steps, current)} />
|
|
329
|
+
</Stack>
|
|
330
|
+
)}
|
|
331
|
+
</Message>
|
|
332
|
+
)}
|
|
333
|
+
</Stack>
|
|
334
|
+
</Stack>
|
|
335
|
+
</Center>
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## Option: Changes
|
|
341
|
+
|
|
342
|
+
Use when: The agent has changes ready to apply.
|
|
343
|
+
|
|
344
|
+
Uses: `Button`, `Center`, `Cluster`, `Heading`, `List`, `Message`, `Modal`, `Paragraph`, `Stack`, `StepList`, `Surface`, `Tag`, `Textarea`, `TimeStamp`, `UserImage`
|
|
345
|
+
|
|
346
|
+
```tsx
|
|
347
|
+
'use client';
|
|
348
|
+
import { useEffect, useRef, useState } from 'react';
|
|
349
|
+
import { Bot } from 'lucide-react';
|
|
350
|
+
import Message from 'oneslash-design-system/components/message';
|
|
351
|
+
import UserImage from 'oneslash-design-system/components/userImage';
|
|
352
|
+
import Tag from 'oneslash-design-system/components/tag';
|
|
353
|
+
import TimeStamp from 'oneslash-design-system/components/timeStamp';
|
|
354
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
355
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
356
|
+
import Button from 'oneslash-design-system/components/button';
|
|
357
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
358
|
+
import Modal from 'oneslash-design-system/components/modal';
|
|
359
|
+
import List from 'oneslash-design-system/components/list';
|
|
360
|
+
import StepList, { type StepListStep } from 'oneslash-design-system/components/stepList';
|
|
361
|
+
import Textarea from 'oneslash-design-system/components/textarea';
|
|
362
|
+
import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
363
|
+
|
|
364
|
+
type Focusable = HTMLButtonElement | HTMLAnchorElement | null;
|
|
365
|
+
|
|
366
|
+
const agentName = 'Acme Agent';
|
|
367
|
+
|
|
368
|
+
const request = { from: 'Dana Lee', at: new Date('2025-01-15T11:40:00Z'), text: 'Can you update the pricing page for the new plans?' };
|
|
369
|
+
const proposedAt = new Date('2025-01-15T11:44:00Z');
|
|
370
|
+
|
|
371
|
+
// ODS has no diff part yet, so the changes are a list of the files they touch, each with what changes in it.
|
|
372
|
+
const changedFiles = [
|
|
373
|
+
{ path: 'pages/pricing.tsx', change: 'Adds the Team plan to the page.' },
|
|
374
|
+
{ path: 'data/plans.json', change: 'Sets the Pro price to $15 and adds the Team plan at $25 per seat.' },
|
|
375
|
+
{ path: 'components/planTable.tsx', change: 'Adds a column for the Team plan.' },
|
|
376
|
+
];
|
|
377
|
+
|
|
378
|
+
// The run after 'Approve': one step per file.
|
|
379
|
+
const runSteps = changedFiles.map((f) => `Change ${f.path}`);
|
|
380
|
+
|
|
381
|
+
const reply = 'The three files are changed. The pricing page shows the new plans.';
|
|
382
|
+
|
|
383
|
+
type Status = 'open' | 'requesting' | 'redoing' | 'approved' | 'cancelled';
|
|
384
|
+
type Run = 'running' | 'stopping' | 'stopped' | 'done';
|
|
385
|
+
|
|
386
|
+
// Finished steps keep a check, the current one runs, and steps the agent has not started are not shown.
|
|
387
|
+
function stepsUpTo(current: number): StepListStep[] {
|
|
388
|
+
return runSteps.slice(0, current + 1).map((label, i) => ({ label, status: i < current ? 'done' : 'running' }));
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function secondsLine(seconds: number) {
|
|
392
|
+
return `Working for ${seconds} ${seconds === 1 ? 'second' : 'seconds'}`;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// The agent's marks, as the rule 'An agent says what it is' says.
|
|
396
|
+
function agentMeta(at: Date) {
|
|
397
|
+
return (
|
|
398
|
+
<>
|
|
399
|
+
<Tag variant="contained" size="small" label="Agent" />
|
|
400
|
+
<TimeStamp createdAt={at} dateFormat="absolute" data="time" />
|
|
401
|
+
<Paragraph size="caption" tone="secondary" measure="none">Model name</Paragraph>
|
|
402
|
+
</>
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export default function AgentPlanProposalChanges() {
|
|
407
|
+
const [status, setStatus] = useState<Status>('open');
|
|
408
|
+
const [pending, setPending] = useState<'approve' | 'cancel' | 'send' | null>(null);
|
|
409
|
+
const [viewing, setViewing] = useState(false);
|
|
410
|
+
const [draft, setDraft] = useState('');
|
|
411
|
+
// The run after 'Approve', in its own progress row under the card.
|
|
412
|
+
const [run, setRun] = useState<Run | null>(null);
|
|
413
|
+
const [current, setCurrent] = useState(0);
|
|
414
|
+
const [seconds, setSeconds] = useState(0);
|
|
415
|
+
const [startedAt, setStartedAt] = useState(proposedAt);
|
|
416
|
+
const timer = useRef<ReturnType<typeof setTimeout>>();
|
|
417
|
+
const tick = useRef<ReturnType<typeof setInterval>>();
|
|
418
|
+
const step = useRef<ReturnType<typeof setTimeout>>();
|
|
419
|
+
const cancel = useRef<ReturnType<typeof setTimeout>>();
|
|
420
|
+
const requestButton = useRef<Focusable>(null);
|
|
421
|
+
const stopButton = useRef<Focusable>(null);
|
|
422
|
+
// Where focus goes after the next render, once the element it goes to is on screen.
|
|
423
|
+
const focusNext = useRef<() => void>();
|
|
424
|
+
|
|
425
|
+
// On unmount it stops the requests, the run and its clock.
|
|
426
|
+
useEffect(() => () => {
|
|
427
|
+
clearTimeout(timer.current);
|
|
428
|
+
clearInterval(tick.current);
|
|
429
|
+
clearTimeout(step.current);
|
|
430
|
+
clearTimeout(cancel.current);
|
|
431
|
+
}, []);
|
|
432
|
+
|
|
433
|
+
useEffect(() => {
|
|
434
|
+
const move = focusNext.current;
|
|
435
|
+
focusNext.current = undefined;
|
|
436
|
+
move?.();
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
// Stands in for the agent's run: one step every 1.5 seconds.
|
|
440
|
+
function advance(at: number) {
|
|
441
|
+
step.current = setTimeout(() => {
|
|
442
|
+
if (at === runSteps.length - 1) {
|
|
443
|
+
clearInterval(tick.current);
|
|
444
|
+
setRun('done');
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
setCurrent(at + 1);
|
|
448
|
+
advance(at + 1);
|
|
449
|
+
}, 1500);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// The card stays as the record, and the run shows in its own progress row below it.
|
|
453
|
+
// 'Approve' is gone and 'Stop' is the control that took its place, so focus goes to 'Stop'.
|
|
454
|
+
function startRun() {
|
|
455
|
+
setRun('running');
|
|
456
|
+
setCurrent(0);
|
|
457
|
+
setSeconds(0);
|
|
458
|
+
setStartedAt(new Date());
|
|
459
|
+
tick.current = setInterval(() => setSeconds((s) => s + 1), 1000);
|
|
460
|
+
advance(0);
|
|
461
|
+
focusNext.current = () => stopButton.current?.focus();
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Decided once: the buttons go away, so a second click cannot approve or cancel it again.
|
|
465
|
+
// After 'Cancel' nothing takes their place: a real app moves focus to the message box.
|
|
466
|
+
function decide(action: 'approve' | 'cancel') {
|
|
467
|
+
if (pending || status !== 'open') return;
|
|
468
|
+
setPending(action);
|
|
469
|
+
// Stands in for the request to the server.
|
|
470
|
+
timer.current = setTimeout(() => {
|
|
471
|
+
setPending(null);
|
|
472
|
+
if (action === 'cancel') {
|
|
473
|
+
setStatus('cancelled');
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
setStatus('approved');
|
|
477
|
+
startRun();
|
|
478
|
+
}, 1200);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// Stop asks the server to end the run. The row says it stopped only once the run has ended.
|
|
482
|
+
function stop() {
|
|
483
|
+
if (run !== 'running') return;
|
|
484
|
+
clearTimeout(step.current);
|
|
485
|
+
setRun('stopping');
|
|
486
|
+
// Stands in for the request to the server.
|
|
487
|
+
cancel.current = setTimeout(() => {
|
|
488
|
+
clearInterval(tick.current);
|
|
489
|
+
setRun('stopped');
|
|
490
|
+
}, 1200);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
function startRequest() {
|
|
494
|
+
if (pending) return;
|
|
495
|
+
setDraft('');
|
|
496
|
+
setStatus('requesting');
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// 'Discard' leaves the sub-form and keeps the proposal open. 'Cancel' would cancel the whole proposal.
|
|
500
|
+
function discard() {
|
|
501
|
+
setStatus('open');
|
|
502
|
+
focusNext.current = () => requestButton.current?.focus();
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
const empty = draft.trim() === '';
|
|
506
|
+
|
|
507
|
+
// 'Send' gives the agent what should change. The card's buttons go, and the agent redoes the changes.
|
|
508
|
+
// Nothing takes their place: a real app moves focus to the message box.
|
|
509
|
+
function send() {
|
|
510
|
+
if (pending || empty) return;
|
|
511
|
+
setPending('send');
|
|
512
|
+
// Stands in for the request to the server.
|
|
513
|
+
timer.current = setTimeout(() => {
|
|
514
|
+
setPending(null);
|
|
515
|
+
setStatus('redoing');
|
|
516
|
+
}, 1200);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// A real app takes the count from the server's answer. Here the file that was being changed when the run
|
|
520
|
+
// stopped may be partly changed, so the note says so and does not claim it is untouched.
|
|
521
|
+
const partFile = changedFiles[current].path;
|
|
522
|
+
const stoppedNote = current === 0
|
|
523
|
+
? `Stopped before any file was done. ${partFile} may be partly changed. Check it.`
|
|
524
|
+
: `Stopped after ${current} of ${runSteps.length} files. ${partFile} may be partly changed. Check it.`;
|
|
525
|
+
|
|
526
|
+
return (
|
|
527
|
+
<Center width="page">
|
|
528
|
+
<Stack gap="large">
|
|
529
|
+
<Heading level={1} size="h5">Launch plan</Heading>
|
|
530
|
+
{/* A real app gives the list that holds the rows role="log". */}
|
|
531
|
+
<Stack gap="small">
|
|
532
|
+
<Message
|
|
533
|
+
aria-label={request.from}
|
|
534
|
+
avatar={<UserImage userHandle={request.from} decorative />}
|
|
535
|
+
name={request.from}
|
|
536
|
+
meta={<TimeStamp createdAt={request.at} dateFormat="absolute" data="time" />}
|
|
537
|
+
>
|
|
538
|
+
<Paragraph measure="none">{request.text}</Paragraph>
|
|
539
|
+
</Message>
|
|
540
|
+
<Message
|
|
541
|
+
aria-label={`${agentName}, agent`}
|
|
542
|
+
avatar={<UserImage userHandle={agentName} icon={Bot} decorative />}
|
|
543
|
+
name={agentName}
|
|
544
|
+
meta={agentMeta(proposedAt)}
|
|
545
|
+
>
|
|
546
|
+
<Surface padding="small">
|
|
547
|
+
<Stack gap="medium">
|
|
548
|
+
{/* A real app announces the decided Tag in a polite live region. */}
|
|
549
|
+
<Cluster gap="small">
|
|
550
|
+
<Heading level={2} size="subtitle1">Changes ready</Heading>
|
|
551
|
+
{status === 'approved' && <Tag variant="contained" size="small" color="success" label="Approved" />}
|
|
552
|
+
{status === 'cancelled' && <Tag variant="contained" size="small" label="Cancelled" />}
|
|
553
|
+
</Cluster>
|
|
554
|
+
<Paragraph measure="none">These changes set the Pro price to $15 and add the Team plan to the pricing page. Three files change.</Paragraph>
|
|
555
|
+
{(status === 'open' || status === 'requesting') && (
|
|
556
|
+
<Cluster>
|
|
557
|
+
<Button size="small" type="secondary" state="enabled" label="View Changes" onClickButton={() => setViewing(true)} />
|
|
558
|
+
</Cluster>
|
|
559
|
+
)}
|
|
560
|
+
{status === 'requesting' && (
|
|
561
|
+
<Textarea
|
|
562
|
+
id="agent-plan-proposal-change-request"
|
|
563
|
+
label="What should change?"
|
|
564
|
+
value={draft}
|
|
565
|
+
onChange={(e) => setDraft(e.target.value)}
|
|
566
|
+
onSubmit={send}
|
|
567
|
+
autoFocus
|
|
568
|
+
disabled={pending === 'send'}
|
|
569
|
+
/>
|
|
570
|
+
)}
|
|
571
|
+
{status === 'redoing' && (
|
|
572
|
+
<Paragraph measure="none">Acme Agent is redoing the changes. It posts a new card when they are ready.</Paragraph>
|
|
573
|
+
)}
|
|
574
|
+
{/* The product sets the waiting time and counts it down. When it is up, the card is marked Cancelled. */}
|
|
575
|
+
{(status === 'open' || status === 'requesting') && (
|
|
576
|
+
<Paragraph size="caption" tone="secondary" measure="none">Waits 10 more minutes, then cancels.</Paragraph>
|
|
577
|
+
)}
|
|
578
|
+
{status === 'open' && (
|
|
579
|
+
<Cluster gap="small">
|
|
580
|
+
<Button size="small" type="tertiary" state={pending === 'approve' ? 'disabled' : 'enabled'} label="Cancel" loading={pending === 'cancel'} onClickButton={() => decide('cancel')} />
|
|
581
|
+
<Button ref={requestButton} size="small" type="secondary" state={pending ? 'disabled' : 'enabled'} label="Request Changes" onClickButton={startRequest} />
|
|
582
|
+
{/* The product writes this label, never the agent. */}
|
|
583
|
+
<Button size="small" type="primary" state={pending === 'cancel' ? 'disabled' : 'enabled'} label="Approve" loading={pending === 'approve'} onClickButton={() => decide('approve')} />
|
|
584
|
+
</Cluster>
|
|
585
|
+
)}
|
|
586
|
+
{status === 'requesting' && (
|
|
587
|
+
<Cluster gap="small">
|
|
588
|
+
<Button size="small" type="tertiary" state={pending === 'send' ? 'disabled' : 'enabled'} label="Discard" onClickButton={discard} />
|
|
589
|
+
<Button size="small" type="primary" state={empty ? 'disabled' : 'enabled'} label="Send" loading={pending === 'send'} onClickButton={send} />
|
|
590
|
+
</Cluster>
|
|
591
|
+
)}
|
|
592
|
+
</Stack>
|
|
593
|
+
</Surface>
|
|
594
|
+
</Message>
|
|
595
|
+
{status === 'cancelled' && (
|
|
596
|
+
// One line in the thread on what was not done, under the card.
|
|
597
|
+
<Message compact aria-label={`${agentName}, agent`}>
|
|
598
|
+
<Paragraph measure="none">Cancelled. Nothing was changed.</Paragraph>
|
|
599
|
+
</Message>
|
|
600
|
+
)}
|
|
601
|
+
{run && (
|
|
602
|
+
// The run's own progress row, as the case 'Agent at work' shows.
|
|
603
|
+
<Message
|
|
604
|
+
aria-label={`${agentName}, agent`}
|
|
605
|
+
avatar={<UserImage userHandle={agentName} icon={Bot} decorative />}
|
|
606
|
+
name={agentName}
|
|
607
|
+
meta={agentMeta(startedAt)}
|
|
608
|
+
footer={
|
|
609
|
+
run === 'running' || run === 'stopping' ? (
|
|
610
|
+
// The only Stop, on the row for the whole run. It shows loading while the run is stopping.
|
|
611
|
+
// When it goes, a real app moves focus to the message box.
|
|
612
|
+
<Cluster>
|
|
613
|
+
<Button ref={stopButton} size="small" type="secondary" state="enabled" label="Stop" loading={run === 'stopping'} onClickButton={stop} />
|
|
614
|
+
</Cluster>
|
|
615
|
+
) : undefined
|
|
616
|
+
}
|
|
617
|
+
>
|
|
618
|
+
{run === 'done' ? (
|
|
619
|
+
<Paragraph measure="none">{reply}</Paragraph>
|
|
620
|
+
) : run === 'stopped' ? (
|
|
621
|
+
<Paragraph measure="none">{stoppedNote}</Paragraph>
|
|
622
|
+
) : (
|
|
623
|
+
// A real app wraps this part in a polite live region, since StepList has none.
|
|
624
|
+
<Stack gap="medium">
|
|
625
|
+
<Paragraph size="caption" tone="secondary" measure="none">{secondsLine(seconds)}</Paragraph>
|
|
626
|
+
<StepList aria-label="Acme Agent's steps" steps={stepsUpTo(current)} />
|
|
627
|
+
</Stack>
|
|
628
|
+
)}
|
|
629
|
+
</Message>
|
|
630
|
+
)}
|
|
631
|
+
</Stack>
|
|
632
|
+
</Stack>
|
|
633
|
+
<Modal
|
|
634
|
+
isOpen={viewing}
|
|
635
|
+
title="Changed Files"
|
|
636
|
+
onClose={() => setViewing(false)}
|
|
637
|
+
actions={<Button size="small" type="tertiary" state="enabled" label="Close" onClickButton={() => setViewing(false)} />}
|
|
638
|
+
>
|
|
639
|
+
<Paragraph measure="none">Approve changes these files.</Paragraph>
|
|
640
|
+
<List
|
|
641
|
+
marker="dot"
|
|
642
|
+
size="body1"
|
|
643
|
+
items={changedFiles.map((f) => (
|
|
644
|
+
<Stack key={f.path} gap="small">
|
|
645
|
+
<Paragraph mono measure="none">{f.path}</Paragraph>
|
|
646
|
+
<Paragraph size="body2" tone="secondary" measure="none">{f.change}</Paragraph>
|
|
647
|
+
</Stack>
|
|
648
|
+
))}
|
|
649
|
+
/>
|
|
650
|
+
</Modal>
|
|
651
|
+
</Center>
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
Seen in: Scindo.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AgentQuestionChoices(): import("react").JSX.Element;
|