Skip to content

Commit 22d69b1

Browse files
authored
Settings, memory and skills polish (#2710)
* Skills, skill detail, Settings menu and Vault polish - Skills: Your skills and Workspace skills come before the setting for who else's Bots use your skills. - A skill opens read first: its name, who wrote it and its command, the one-liner, the tools it needs and the instructions as text. Edit opens the form. Workspace skills open the same way, with no Edit. - The tools it needs sit in a small box beside the instructions when the panel has room, and under the heading when it does not. - Settings menu rows are 36px, with the text-sm step. - Vault: a "Saved logins (3)" heading over the list. * A skill opens on its own screen; review fixes - Every skill someone wrote opens at /skills/$slug, in both editions, and Admin's skill page is the same screen: read first, with Edit for the form on the same address (?edit=true). Cancel and Save come back to the overview, and Save replaces the form in the history. - The side panel no longer reads or edits skills. /skills?edit= opens the new screen, and "Put it on a Bot" links there. - The tools box moves beside the instructions from @2XL. - Tools from an app that isn't connected are named from the ref, under "Apps not connected", never shown raw. - Written-skill rows get a chevron, like learned and workspace rows. - Vault: the team edition's one section has no title again. The personal edition keeps "Saved logins (n)". - Settings menu rows keep their size. * Leave CHANGELOG.md to the release: the note is in the description
1 parent 7e097af commit 22d69b1

18 files changed

Lines changed: 886 additions & 461 deletions

‎app/src/components/manage/skill-page.tsx‎

Lines changed: 261 additions & 170 deletions
Large diffs are not rendered by default.

‎app/src/components/settings/learning-sharing.tsx‎

Lines changed: 83 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function SkillMark({ children }: { children: React.ReactNode }) {
124124
* the Skills learned from their recordings and conversations, each marked Learned.
125125
*
126126
* Every recording a person makes goes into their own Learning space, and the Skills learned there
127-
* reach every Bot they use. In the team edition they also choose, below the list, who else's Bots may
127+
* reach every Bot they use. In the team edition they also choose, below the lists, who else's Bots may
128128
* draw on them: none (the default), all, or the Skills they open one by one. Each change takes effect
129129
* when it is made; there is no save. Sharing waits for an administrator (Admin, Automatic learning,
130130
* Skill sharing): until then nothing can be opened, and what was opened can still be closed.
@@ -134,6 +134,7 @@ export function LearningSharing({
134134
writtenKnown = true,
135135
heldAbove = false,
136136
action,
137+
afterSkills = null,
137138
}: {
138139
/**
139140
* The page above has already said OpenBot is holding off (a move, or the database out of reach):
@@ -146,6 +147,11 @@ export function LearningSharing({
146147
writtenKnown?: boolean;
147148
/** The section's one verb: New skill. */
148149
action?: React.ReactNode;
150+
/**
151+
* The page's other lists of skills (Workspace skills), drawn right after Your skills and before
152+
* the sharing choice, so every list is read before the setting about them.
153+
*/
154+
afterSkills?: React.ReactNode;
149155
} = {}) {
150156
const sharing = useQuery(personalLearningQueryOptions());
151157
const setMode = useMutation(
@@ -165,24 +171,27 @@ export function LearningSharing({
165171
</React.Fragment>
166172
));
167173
// Which edition decides the layout, so nothing draws until it is known. A failed read counts as the team edition.
168-
if (capabilities.isPending) return null;
174+
if (capabilities.isPending) return afterSkills;
169175
// Nothing to list yet from either read.
170-
if (sharing.isPending && !writtenKnown) return null;
176+
if (sharing.isPending && !writtenKnown) return afterSkills;
171177
const personal = capabilities.data?.edition === "personal";
172178
/*
173179
* The skills a person wrote don't come from Learning, so they and New skill are drawn whether or
174180
* not it answered. Its failure is said inside the section, above what is still known.
175181
*/
176182
if (sharing.isPending || sharing.error) {
177183
return (
178-
<PageSection action={action} title="Your skills">
179-
{sharing.error && !(heldAbove && isHeld(sharing.error)) ? (
180-
<p className="text-destructive text-sm" role="alert">
181-
{failureSaid(sharing.error)}
182-
</p>
183-
) : null}
184-
{written.length > 0 ? <PageRows>{writtenRows}</PageRows> : null}
185-
</PageSection>
184+
<>
185+
<PageSection action={action} title="Your skills">
186+
{sharing.error && !(heldAbove && isHeld(sharing.error)) ? (
187+
<p className="text-destructive text-sm" role="alert">
188+
{failureSaid(sharing.error)}
189+
</p>
190+
) : null}
191+
{written.length > 0 ? <PageRows>{writtenRows}</PageRows> : null}
192+
</PageSection>
193+
{afterSkills}
194+
</>
186195
);
187196
}
188197
const data = sharing.data;
@@ -200,68 +209,71 @@ export function LearningSharing({
200209
const learned = data.skills ?? [];
201210
const none = learned.length === 0 && written.length === 0;
202211
return (
203-
<PageSection
204-
action={action}
205-
title="Your skills"
206-
// Said only over skills to open: above the empty state it would point at nothing.
207-
description={
208-
none
209-
? undefined
210-
: "Type / and a skill's name to give a Bot that instruction. Open one to read or change it."
211-
}
212-
>
213-
{none ? (
214-
writtenKnown ? (
215-
<PageEmpty>
216-
{data.skills === null
217-
? emptySentence(data, mode, true)
218-
: "No skills yet. Write one with New skill, or teach a Bot a task."}
219-
</PageEmpty>
220-
) : null
221-
) : (
222-
<PageRows>
223-
{writtenRows}
224-
{learned.map((skill, index) => (
225-
<React.Fragment key={skill.name}>
226-
{index > 0 || written.length > 0 ? <Separator /> : null}
227-
<Item
228-
size="sm"
229-
render={
230-
<button
231-
onClick={() => setReading(skill.name)}
232-
type="button"
233-
/>
234-
}
235-
>
236-
<ItemMedia variant="icon">
237-
<IconSparkles />
238-
</ItemMedia>
239-
<ItemContent>
240-
<ItemTitle>
241-
{skillTitle(skill.name, skill.description)}
242-
<SkillMark>Learned</SkillMark>
243-
</ItemTitle>
244-
<ItemDescription>{skill.description}</ItemDescription>
245-
</ItemContent>
246-
<ItemActions>
247-
<IconChevronRight className="size-4 text-muted-foreground" />
248-
</ItemActions>
249-
</Item>
250-
</React.Fragment>
251-
))}
252-
</PageRows>
253-
)}
254-
<LearnedSkillDialog
255-
name={reading}
256-
title={readingTitle}
257-
onClose={() => setReading(null)}
258-
source={{ kind: "personal" }}
259-
/>
260-
</PageSection>
212+
<>
213+
<PageSection
214+
action={action}
215+
title="Your skills"
216+
// Said only over skills to open: above the empty state it would point at nothing.
217+
description={
218+
none
219+
? undefined
220+
: "Type / and a skill's name to give a Bot that instruction. Open one to read or change it."
221+
}
222+
>
223+
{none ? (
224+
writtenKnown ? (
225+
<PageEmpty>
226+
{data.skills === null
227+
? emptySentence(data, mode, true)
228+
: "No skills yet. Write one with New skill, or teach a Bot a task."}
229+
</PageEmpty>
230+
) : null
231+
) : (
232+
<PageRows>
233+
{writtenRows}
234+
{learned.map((skill, index) => (
235+
<React.Fragment key={skill.name}>
236+
{index > 0 || written.length > 0 ? <Separator /> : null}
237+
<Item
238+
size="sm"
239+
render={
240+
<button
241+
onClick={() => setReading(skill.name)}
242+
type="button"
243+
/>
244+
}
245+
>
246+
<ItemMedia variant="icon">
247+
<IconSparkles />
248+
</ItemMedia>
249+
<ItemContent>
250+
<ItemTitle>
251+
{skillTitle(skill.name, skill.description)}
252+
<SkillMark>Learned</SkillMark>
253+
</ItemTitle>
254+
<ItemDescription>{skill.description}</ItemDescription>
255+
</ItemContent>
256+
<ItemActions>
257+
<IconChevronRight className="size-4 text-muted-foreground" />
258+
</ItemActions>
259+
</Item>
260+
</React.Fragment>
261+
))}
262+
</PageRows>
263+
)}
264+
<LearnedSkillDialog
265+
name={reading}
266+
title={readingTitle}
267+
onClose={() => setReading(null)}
268+
source={{ kind: "personal" }}
269+
/>
270+
</PageSection>
271+
{afterSkills}
272+
</>
261273
);
262274
}
263275

264-
// Below the list: it is a choice about the learned skills in it.
276+
// Below the lists: it is a choice about the learned skills in them.
265277
const choiceSection = (
266278
<PageSection
267279
title="Who else's Bots use your skills"
@@ -476,6 +488,7 @@ export function LearningSharing({
476488
source={{ kind: "personal" }}
477489
/>
478490
</PageSection>
491+
{afterSkills}
479492
{choiceSection}
480493
{failure ? (
481494
<p className="mt-4 text-destructive text-sm" role="alert">

‎app/src/components/skills/edit-skill.tsx‎

Lines changed: 0 additions & 102 deletions
This file was deleted.

‎app/src/components/skills/proposed-skill.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ function PutItOnABot({ slug }: { slug: string }) {
199199
return (
200200
<Link
201201
className="mt-2 inline-block text-sm underline underline-offset-4"
202-
search={{ edit: slug }}
203-
to="/skills"
202+
params={{ slug }}
203+
to="/skills/$slug"
204204
>
205205
Put it on a Bot
206206
</Link>

0 commit comments

Comments
 (0)