@@ -108,9 +63,6 @@
{assignee && assignedToAuthor ? "opened by and assigned to" : "opened by"}
{/if}
{@render person({ did: authorDid, handle: authorHandle })}
- {#if assignee && assignedToAuthor && canEditAssignee}
- {@render assigneePencil()}
- {/if}
{#if assignee && !assignedToAuthor}
@@ -118,9 +70,6 @@
assigned to
{@render person(assignee)}
- {#if canEditAssignee}
- {@render assigneePencil()}
- {/if}
{/if}
diff --git a/web/src/lib/components/ui/MarkdownTypeahead.svelte b/web/src/lib/components/ui/MarkdownTypeahead.svelte
index 8cf3fa8c0..51d4980ef 100644
--- a/web/src/lib/components/ui/MarkdownTypeahead.svelte
+++ b/web/src/lib/components/ui/MarkdownTypeahead.svelte
@@ -15,8 +15,7 @@
import {
filterTickets,
loadTickets,
- RECOMMENDATION_LIMIT,
- recommendUsers,
+ recommendPeople,
suggestUsers,
type Suggestion,
type TicketSuggestion
@@ -90,14 +89,8 @@
return collaborators;
};
- const recommendations = async () => {
- const known = mentionPeople?.() ?? [];
- const exclude = auth?.currentDid ?? undefined;
- const participants = recommendUsers(known, exclude);
- if (participants.length >= RECOMMENDATION_LIMIT) return participants;
- const members = await collaboratorList().catch(() => []);
- return recommendUsers([...known, ...members], exclude);
- };
+ const recommendations = () =>
+ recommendPeople(mentionPeople?.() ?? [], collaboratorList, auth?.currentDid ?? undefined);
const settle = async (controller: AbortController, pending: Promise
) => {
try {
diff --git a/web/src/lib/components/ui/markdownSuggestions.ts b/web/src/lib/components/ui/markdownSuggestions.ts
index 8f1ddf285..2dd7b8e75 100644
--- a/web/src/lib/components/ui/markdownSuggestions.ts
+++ b/web/src/lib/components/ui/markdownSuggestions.ts
@@ -34,7 +34,7 @@ export interface TicketRepo {
}
const SUGGESTION_LIMIT = 8;
-export const RECOMMENDATION_LIMIT = 5;
+const RECOMMENDATION_LIMIT = 5;
const TICKET_FETCH_LIMIT = 100;
export const suggestUsers = async (
@@ -74,6 +74,17 @@ export const recommendUsers = (
return picked;
};
+export const recommendPeople = async (
+ known: MentionPerson[],
+ members: () => Promise,
+ exclude: string | undefined
+): Promise => {
+ const participants = recommendUsers(known, exclude);
+ if (participants.length >= RECOMMENDATION_LIMIT) return participants;
+ const others = await members().catch(() => []);
+ return recommendUsers([...known, ...others], exclude);
+};
+
const ticket = (
repo: TicketRepo,
isPull: boolean,
diff --git a/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte b/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte
index 8b1bc4f43..4c082ccde 100644
--- a/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte
+++ b/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte
@@ -45,6 +45,7 @@
import { renderMarkup } from "$lib/markup";
import RepoTabs from "$lib/components/repo/RepoTabs.svelte";
import Ticket from "$lib/components/repo/tickets/Ticket.svelte";
+ import type { Person } from "$lib/components/repo/tickets/TicketInfoBar.svelte";
import Card from "$lib/components/ui/Card.svelte";
import type { ResolvedPathname } from "$app/types";
import type { Did } from "@atcute/lexicons/syntax";
@@ -253,11 +254,7 @@
return people;
});
- let mockAssigneeDid = $state();
-
- const mockAssignee = $derived(
- participants.find((person) => person.did === mockAssigneeDid) ?? pull.author
- );
+ let mockAssignee = $state();
const targetBranchLives = createLoad(async () => {
if (!browser || !data.repo.repoDid) return false;
@@ -690,10 +687,10 @@
ticket={pull}
markup={data.markup}
{targetBranchHref}
- assignee={mockAssignee}
+ assignee={mockAssignee ?? pull.author}
assigneeOptions={participants}
canEditAssignee={canPush}
- onAssigneeChange={(did) => (mockAssigneeDid = did)}
+ onAssigneeChange={(person) => (mockAssignee = person)}
onedit={updatePull}
ondelete={removePull}
>