Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions docs/buzz-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ if that desktop app is up and running.
**Load earlier activity** to see more history.
- **Instructions** change how an agent behaves. They don't give it new tools,
accounts or permissions.
- **Settings → Agent setup → Base instructions** shows the instructions Buzz
gives agents on this device. Open a section to read it. For editable
sections, use **Save** or **Cancel**. **Options** lets you disable or enable
a section, or put the default text back in the editor for you to save.
- **Sessions.** By default an agent starts a fresh conversation for each
thread. Its settings can make it one per channel or one per community.
- **While it works**, the agent shows typing dots, and you can stop it. If it
Expand Down
24 changes: 20 additions & 4 deletions src/app/AgentSettings.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// @vitest-environment jsdom
import "@testing-library/jest-dom/vitest";
import { act, cleanup, render, screen, waitFor } from "@testing-library/react";
import {
act,
cleanup,
render,
screen,
waitFor,
within,
} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { afterEach, expect, it, vi } from "vitest";
import { ToastProvider } from "../shared/design-system/ui/Toast";
Expand Down Expand Up @@ -88,9 +95,18 @@ it("shows the base instructions, kept in the agents' storage", async () => {
/>,
{ wrapper: ToastProvider },
);
await user.click(screen.getByRole("combobox", { name: "Progress" }));
await user.click(await screen.findByRole("option", { name: "Off" }));
await user.click(screen.getByRole("button", { name: "Save" }));
await user.click(screen.getByRole("button", { name: /^Show all \(\d+\)$/ }));
await user.click(screen.getByRole("button", { name: "Progress" }));
await user.click(
screen.getByRole("button", { name: "Options for Progress" }),
);
await user.click(await screen.findByRole("menuitem", { name: "Disable" }));
const confirmation = screen.getByRole("alertdialog", {
name: "Save instruction change?",
});
await user.click(
within(confirmation).getByRole("button", { name: "Disable" }),
);
await waitFor(() =>
expect(ownerChoices(storage)).toEqual({ progress: { mode: "off" } }),
);
Expand Down
60 changes: 60 additions & 0 deletions src/features/agents/BaseInstructions.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.rowTitle {
opacity: 1;
}

button[aria-expanded="true"] .rowTitle {
opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
html:not([data-keyboard-input]) .rowTitle {
transition: opacity var(--duration-state) var(--easing-enter);
}
}

.markdown > p:has(+ p) {
margin-block-end: var(--space-2);
}

.markdown > p + p {
margin-block-start: var(--space-2);
}

.sectionPreview > [data-layout="rows"] {
border-block-end-color: transparent;
border-end-start-radius: 0;
border-end-end-radius: 0;
}

.sectionPreview:not(:has(:focus-visible, [aria-expanded="true"])) {
mask-image: linear-gradient(
to bottom,
black calc(100% - var(--space-16)),
calc(100% - var(--space-6)),
transparent
);

@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
mask-image: none;
}
}

.editor,
.readingArea {
--instruction-text-max-height: min(16rem, 32dvh);
}

.editor {
--document-field-max-height: var(--instruction-text-max-height);
}

.readingArea {
max-block-size: var(--instruction-text-max-height);
overflow-y: auto;
}

html[data-keyboard-navigation] .readingArea:focus-visible {
mask-image: none;
outline: 2px solid var(--border-focus);
outline-offset: -2px;
}
Loading
Loading