Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
e263b93
fix(people): open profiles from Solo Share access and "N others" lists
matt2e Nov 4, 2026
d051897
fix(messages): resolve "N others" names only while the list is open
matt2e Nov 4, 2026
edbe338
fix(people): return focus to the Solo opener when its profile closes
matt2e Nov 4, 2026
f62c2fc
fix(people): return Solo profile focus only to the opener that opened it
matt2e Nov 4, 2026
8df1496
fix(people): keep the Solo opener through a profile's own openings
matt2e Nov 4, 2026
2de4331
fix(people): key the Solo opener on the visits it opened
matt2e Nov 4, 2026
541d2be
fix(people): return focus when Share access reopens the shown profile
matt2e Nov 4, 2026
54b37c2
test(people): pin side-tab Share access reopening the shown profile
matt2e Nov 4, 2026
d31e067
refactor(people): fold the Solo opener return into the dismissal record
matt2e Nov 4, 2026
b017c11
test(people): find Solo Share access in the unified header
matt2e Nov 6, 2026
74e265c
fix(people): bind a queued Solo reopen's opener to its fresh visit
matt2e Nov 6, 2026
0b71130
fix(people): keep the Solo opener when a queued profile closes first
matt2e Nov 6, 2026
5bff7d3
test(people): subscribe the side-tab profile test's navigation stub
matt2e Nov 16, 2026
6b927ed
test(people): follow main's sidebar selectors and DM drafts
matt2e Nov 19, 2026
fe5da4b
test(people): cover Send message from every Solo Share access opener
matt2e Nov 19, 2026
fffbd9c
test(people): follow main's inline link name for a shared Solo chat
matt2e 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
2 changes: 2 additions & 0 deletions docs/buzz-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ if that desktop app is up and running.
Anyone who can post can pin or unpin any message. Forum posts can't be
pinned. A community that doesn't take pins refuses them, and Buzz says so.
Agents pin with the `pin` tool.
- **Membership changes.** Open “N others” to see the full list of names;
choose a name to open that person's profile.
- **Composer.** **#** links a channel. On desktop, **!** gives your agents a
folder and **/** a skill. Attach files by pasting or dragging them in.
- **Drafts.** Every message box open on a conversation shares its draft. A box
Expand Down
6 changes: 5 additions & 1 deletion src/bundled/channels/ChannelMembersDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,14 @@ export function ChannelMembersButton({
owner,
label = "Access",
conversationName,
trigger: hostTrigger,
}: {
session: RelaySession;
channelId: string;
label?: string;
conversationName?: string;
/** The button's ref, for a host that returns focus to it. */
trigger?: RefObject<HTMLButtonElement | null> | undefined;
/** Someone else's Solo chat names its owner on the Access control. */
owner?: { name: string; picture?: string | undefined } | undefined;
agents?: Agents | undefined;
Expand All @@ -477,7 +480,8 @@ export function ChannelMembersButton({
const [localOpen, setLocalOpen] = useState(false);
const open = presentation ? presentation.open : localOpen;
const setOpen = presentation ? presentation.onOpenChange : setLocalOpen;
const trigger = useRef<HTMLButtonElement>(null);
const ownTrigger = useRef<HTMLButtonElement>(null);
const trigger = hostTrigger ?? ownTrigger;
const access = useHeaderChannel(session.channels, channelId, memberAccess);
return (
<>
Expand Down
124 changes: 122 additions & 2 deletions src/bundled/channels/ChannelsPage.solo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { composerDOMFixture } from "../../features/messages/composer-testing";
import { ChannelNavigationProvider } from "../../features/channel-navigation/ChannelNavigationState";
import {
conversationTarget,
newMessageTarget,
soloDraftTarget,
} from "../../features/channel-navigation/routes";
import { linkedDraftKey } from "../../features/solo/linked-chat";
Expand All @@ -45,6 +46,7 @@ import { SoloWorkspaces } from "./SoloWorkspaces";
import type { RelaySession } from "../../features/relay/session";
import type { RegisteredSidebarRows } from "../../features/channel-navigation/sidebar-rows-service";
import type { ReadTarget } from "../../features/relay/read-state-model";
import type { RegisteredPanel } from "../../features/panels/service";

vi.mock(
"../../features/messages/solo-model-picks-storage",
Expand Down Expand Up @@ -476,6 +478,17 @@ function fixture({
} as unknown as Navigation;
const archive: ArchiveShortcut = {};
const read: ReadShortcut = {};
const profilePanel = {
id: "profile",
key: "fixture:profile",
pluginId: "fixture",
revision: "1",
title: "Profile",
matches: (target: string) => target.startsWith("nostr:npub"),
component: () => <p>Profile content</p>,
} as RegisteredPanel;
// A stable snapshot, as useSyncExternalStore requires.
const available = [profilePanel];
const page = (sidebar = false) => (
<ChannelNavigationProvider relay={relay}>
{sidebar && (
Expand All @@ -498,9 +511,11 @@ function fixture({
Workspace: () => null,
useSplit: vi.fn(),
},
...contribution,
snapshot: () => available,
subscribe: () => () => {},
register() {},
resolve: () => undefined,
resolve: (target) =>
profilePanel.matches(target) ? profilePanel : undefined,
requestOpen: () => false,
handleOpenRequests: () => () => {},
}}
Expand Down Expand Up @@ -1891,6 +1906,111 @@ it.each([
expect(screen.queryByText(/’s chat/)).toBeNull();
});

// This fixture's visit never changes, so the header never remounts here as it
// does for each visit in the app. solo-workspace.spec.mjs covers focus
// returning to the opener when the profile closes.
it("opens a profile from the header's Share access", async () => {
const person = "e".repeat(64);
const f = fixture({ people: [person] });
// The dialog lists members once their names settle.
Object.assign(f.session.profiles, { ensure: async () => {} });
f.mount();
const user = userEvent.setup();
await user.click(
await screen.findByRole("button", { name: "Share access to Planning" }),
);
const dialog = await screen.findByRole("dialog", { name: /Share access/ });
await user.click(
await within(dialog).findByRole("button", {
name: /^Open profile for Teammate/,
}),
);
expect(screen.queryByRole("dialog")).toBeNull();
expect(await screen.findByText("Profile content")).toBeVisible();
});

// The header's Share access and Chat actions → Share access are wired apart.
it.each(["the header's Share access", "Chat actions → Share access"])(
"offers the team's member actions from %s",
async (opener) => {
const person = "e".repeat(64);
const dm = "22222222-2222-4222-8222-222222222222";
const f = fixture({ people: [person], viewerNamed: true });
const openDm = vi.fn(async () => dm);
Object.assign(f.session.profiles, { ensure: async () => {} });
Object.assign(f.session, {
directMessages: {
...f.session.directMessages,
available: true,
open: openDm,
},
});
f.mount();
const user = userEvent.setup();
const share = async () => {
if (opener === "Chat actions → Share access") {
await user.click(
await screen.findByRole("button", { name: "Chat actions" }),
);
await user.click(
await screen.findByRole("menuitem", { name: "Share access" }),
);
} else
await user.click(
await screen.findByRole("button", {
name: "Share access to Planning",
}),
);
return within(
await screen.findByRole("dialog", { name: /Share access/ }),
);
};
const actions = async (dialog: ReturnType<typeof within>, name: string) => {
await user.click(
await dialog.findByRole("button", { name: `Actions for ${name}` }),
);
return within(await screen.findByRole("menu"));
};
let dialog = await share();
// An agent and the viewer get no Send message, as in team channels.
for (const name of ["Scout", "Viewer"]) {
const menu = await actions(dialog, name);
expect(
menu.getByRole("menuitem", { name: "View profile" }),
).not.toHaveAttribute("aria-disabled", "true");
expect(menu.queryByRole("menuitem", { name: "Send message" })).toBeNull();
await user.keyboard("{Escape}");
await waitFor(() => expect(screen.queryByRole("menu")).toBeNull());
}
await user.click(
(await actions(dialog, "Teammate")).getByRole("menuitem", {
name: "Send message",
}),
);
// The viewer has no DM with them, so this opens a New message draft
// addressed to them. Only a send creates the DM.
await waitFor(() =>
expect(f.open).toHaveBeenLastCalledWith(
newMessageTarget(
splitPartition(f.scope) as never,
person,
expect.any(Number),
),
),
);
expect(openDm).not.toHaveBeenCalled();
await waitFor(() => expect(screen.queryByRole("dialog")).toBeNull());
dialog = await share();
await user.click(
(await actions(dialog, "Teammate")).getByRole("menuitem", {
name: "View profile",
}),
);
await waitFor(() => expect(screen.queryByRole("dialog")).toBeNull());
expect(await screen.findByText("Profile content")).toBeVisible();
},
);

it("marks an archived chat once and keeps only its lifecycle actions", async () => {
fixture({ archived: true }).mount();
await screen.findByRole("button", { name: "Chat actions" });
Expand Down
108 changes: 104 additions & 4 deletions src/bundled/channels/ChannelsPage.tabs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ import type {
} from "../../features/panels/service";
import type { PageNavigation } from "../../features/navigation/service";
import type { OpenTarget } from "../../features/navigation/targets";
import { soloDraftTarget } from "../../features/channel-navigation/routes";
import {
newMessageTarget,
soloDraftTarget,
} from "../../features/channel-navigation/routes";
import { splitPartition } from "../../features/relay/partition";
import {
createRelaySession,
type RelaySession,
Expand Down Expand Up @@ -92,6 +96,8 @@ function relayQuery(
];
}
const owners: ReturnType<typeof createRelaySession>[] = [];
// Makes direct messages available, so member lists offer Send message.
const openDirectMessage = vi.fn(async () => "dm");
const visitSnapshot = { entry: { id: "visit" }, attempt: {} };
const threadVisitSnapshot = { entry: { id: "thread-visit" }, attempt: {} };
beforeEach(() => {
Expand Down Expand Up @@ -128,7 +134,8 @@ async function page(
linkedPanel?: Partial<RegisteredPanel>,
) {
const viewer = keypair(),
authority = keypair();
authority = keypair(),
teammate = keypair();
const channelId = "alpha";
const events = [
roster(authority, channelId, [viewer.pubkey]),
Expand All @@ -143,7 +150,12 @@ async function page(
),
roster(authority, "beta", [viewer.pubkey]),
metadata(authority, "beta", "Beta", undefined, [["t", "stream"]]),
roster(authority, "gamma", [viewer.pubkey]),
roster(authority, "gamma", [viewer.pubkey, teammate.pubkey]),
signed(teammate, {
kind: 0,
tags: [],
content: JSON.stringify({ name: "Teammate" }),
}),
metadata(authority, "gamma", "Gamma", undefined, [
["t", "stream"],
["private"],
Expand All @@ -157,6 +169,7 @@ async function page(
media: () => undefined,
...(uploadAttachment && { uploadAttachment }),
query: async (filters) => relayQuery(authority, events, filters),
openDirectMessage,
writer: {
sign: async (template) => signed(viewer, template),
publish: async () => {},
Expand Down Expand Up @@ -229,7 +242,16 @@ async function page(
component: appComponent ?? (() => <p>App content</p>),
...linkedPanel,
};
const available = [panel, app];
const profile: RegisteredPanel = {
id: "profile",
key: "fixture:profile",
pluginId: "fixture",
revision: "1",
title: "Profile",
matches: (target) => target.startsWith("nostr:npub"),
component: () => <p>Profile content</p>,
};
const available = [panel, app, profile];
let handleOpen: ((request: PanelOpenRequest) => boolean) | undefined;
const panels: Panels = {
ui: { Workspace: () => null, useSplit: vi.fn() },
Expand Down Expand Up @@ -298,6 +320,7 @@ async function page(
session: snapshot.session,
scope,
viewer: viewer.pubkey,
teammate: teammate.pubkey,
panels,
root: root?.id,
navigation,
Expand Down Expand Up @@ -1212,6 +1235,83 @@ it("gives a Solo chat's side tab its own header actions, opening it in the main
expect(screen.queryByRole("button", { name: "Chat actions" })).toBeNull();
});

// This fixture's profile isn't a history panel and its visit never changes, so
// closing it has no dismissal's return. solo-workspace.spec.mjs covers focus
// returning to the side tab's opener when the profile closes.
it.each(["Share access", "Chat actions"])(
"opens a profile from a Solo side tab's %s",
async (opener) => {
const snapshot = { entry: { id: "visit" }, attempt: {} };
const h = await page("stream", {
open: vi.fn(async () => ({ status: "opened" as const })),
snapshot: () => snapshot,
subscribe: () => () => {},
} as unknown as Navigation);
const tabs = renderHook(() => useChannelTabState(h.session, "alpha"));
act(() =>
tabs.result.current.setTabs((items) => [
...items,
{ id: "conversation:gamma", kind: "conversation", channelId: "gamma" },
]),
);
await h.user.click(await screen.findByRole("tab", { name: "Gamma" }));
await h.user.click(await screen.findByRole("button", { name: opener }));
if (opener === "Chat actions")
await h.user.click(
await screen.findByRole("menuitem", { name: "Share access" }),
);
const dialog = await screen.findByRole("dialog", { name: /Share access/ });
await h.user.click(
await within(dialog).findByRole("button", {
name: /^Open profile for Teammate/,
}),
);
await vi.waitFor(() => expect(screen.queryByRole("dialog")).toBeNull());
expect(await screen.findByText("Profile content")).toBeVisible();
},
);

it("sends a message from a Solo side tab's Share access", async () => {
const open = vi.fn(async () => ({ status: "opened" as const }));
const snapshot = { entry: { id: "visit" }, attempt: {} };
const h = await page("stream", {
open,
snapshot: () => snapshot,
subscribe: () => () => {},
} as unknown as Navigation);
const tabs = renderHook(() => useChannelTabState(h.session, "alpha"));
act(() =>
tabs.result.current.setTabs((items) => [
...items,
{ id: "conversation:gamma", kind: "conversation", channelId: "gamma" },
]),
);
await h.user.click(await screen.findByRole("tab", { name: "Gamma" }));
await h.user.click(
await screen.findByRole("button", { name: "Share access" }),
);
const dialog = await screen.findByRole("dialog", { name: /Share access/ });
await h.user.click(
await within(dialog).findByRole("button", { name: "Actions for Teammate" }),
);
await h.user.click(
await screen.findByRole("menuitem", { name: "Send message" }),
);
// The viewer has no DM with them, so this opens a New message draft
// addressed to them. Only a send creates the DM.
await vi.waitFor(() =>
expect(open).toHaveBeenLastCalledWith(
newMessageTarget(
splitPartition(h.scope) as never,
h.teammate,
expect.any(Number),
),
),
);
expect(openDirectMessage).not.toHaveBeenCalled();
await vi.waitFor(() => expect(screen.queryByRole("dialog")).toBeNull());
});

it("keeps a side tab's failed move recoverable after switching tabs", async () => {
const base = {
status: "ready",
Expand Down
Loading
Loading