Skip to content
Open
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
5 changes: 0 additions & 5 deletions desktop/src/features/messages/lib/useMentions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
coalesceAutocompleteCandidatesByKey,
getMentionableAgentPubkeys,
getSharedChannelIds,
isAgentIdentityInManagedList,
shouldHideAgentFromMentions,
} from "@/features/agents/lib/agentAutocompleteEligibility";
import {
Expand Down Expand Up @@ -246,9 +245,6 @@ export function useMentions(
if (isArchivedDiscovery(pubkey)) {
return;
}
if (!isAgentIdentityInManagedList(candidate, managedAgentPubkeys)) {
return;
}
if (
shouldHideAgentFromMentions({
isAgent: candidate.isAgent === true,
Expand Down Expand Up @@ -420,7 +416,6 @@ export function useMentions(
managedAgentNamesByPubkey,
managedAgentPersonaIds,
managedAgentPersonaIdsByPubkey,
managedAgentPubkeys,
managedAgentsQuery.data,
memberPubkeys,
members,
Expand Down
44 changes: 44 additions & 0 deletions desktop/tests/e2e/mentions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,50 @@ test("@ trigger prioritizes channel members before runnable personas and other m
expect(fizzIndex).toBeLessThan(charlieIndex);
});

test("@ includes channel-member agents that are not locally managed", async ({
page,
}) => {
await installMockBridge(page);
await page.goto("/");
await page.getByTestId("channel-general").click();
await expect(page.getByTestId("chat-title")).toHaveText("general");

const input = page.getByTestId("message-input");
await input.fill("@mi");

const row = autocomplete(page).locator("button", { hasText: "mira" });
await expect(row).toBeVisible();
await expect(row.getByTestId("mention-agent-icon")).toBeVisible();
await expect(row.getByText("not in channel")).toHaveCount(0);
});

test("@ hides channel-member agents when the viewer is outside their allowlist", async ({
page,
}) => {
await installMockBridge(page, {
relayAgents: [
{
pubkey: PROFILE_ONLY_AGENT_PUBKEY,
name: "mira",
channelNames: ["general"],
respondTo: "allowlist",
respondToAllowlist: [TEST_IDENTITIES.alice.pubkey],
},
],
});
await page.goto("/");
await page.getByTestId("channel-general").click();
await expect(page.getByTestId("chat-title")).toHaveText("general");

const input = page.getByTestId("message-input");
await input.fill("@mi");

await expect(autocomplete(page)).not.toBeVisible();
await expect(
page.getByTestId(`mention-suggestion-${PROFILE_ONLY_AGENT_PUBKEY}`),
).toHaveCount(0);
});

test("thread autocomplete keeps multiple long names readable in a narrow panel", async ({
page,
}) => {
Expand Down