mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 19:30:38 +08:00
Remove dead issue/patch list from detail views
The second column that displayed the sibling list was removed long ago, so the issue/patch lists loaded into the detail views are never rendered.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import type { IssueStatus } from "./router";
|
||||
import type { Author } from "@bindings/cob/Author";
|
||||
import type { Action } from "@bindings/cob/issue/Action";
|
||||
import type { Issue } from "@bindings/cob/issue/Issue";
|
||||
@@ -45,33 +44,15 @@
|
||||
interface Props {
|
||||
repo: RepoInfo;
|
||||
issue: Issue;
|
||||
issues: Issue[];
|
||||
activity: Operation<Action>[];
|
||||
config: Config;
|
||||
threads: Thread[];
|
||||
status: IssueStatus;
|
||||
}
|
||||
|
||||
/* eslint-disable prefer-const */
|
||||
let {
|
||||
repo,
|
||||
issue,
|
||||
issues: initialIssues,
|
||||
activity,
|
||||
config,
|
||||
threads,
|
||||
status: initialStatus,
|
||||
}: Props = $props();
|
||||
let { repo, issue, activity, config, threads }: Props = $props();
|
||||
/* eslint-enable prefer-const */
|
||||
|
||||
// Parent reuses this component across issue navigations; a sibling $effect
|
||||
// resets local state when issue.id changes.
|
||||
// svelte-ignore state_referenced_locally
|
||||
let issues = $state(initialIssues);
|
||||
// The initial status filter is captured at mount so it stays fixed while
|
||||
// navigating between sibling issues.
|
||||
// svelte-ignore state_referenced_locally
|
||||
const status = initialStatus;
|
||||
let labelSaveInProgress: boolean = $state(false);
|
||||
let assigneesSaveInProgress: boolean = $state(false);
|
||||
let hideTimeline = $state(true);
|
||||
@@ -129,7 +110,7 @@
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
[issue, activity, threads, issues] = await Promise.all([
|
||||
[issue, activity, threads] = await Promise.all([
|
||||
invoke<Issue>("issue_by_id", {
|
||||
rid: repo.rid,
|
||||
id: issue.id,
|
||||
@@ -142,10 +123,6 @@
|
||||
rid: repo.rid,
|
||||
id: issue.id,
|
||||
}),
|
||||
invoke<Issue[]>("list_issues", {
|
||||
rid: repo.rid,
|
||||
status,
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -160,12 +137,6 @@
|
||||
new: { id: issue.id, body, embeds, replyTo },
|
||||
opts: { announce: $nodeRunning && $announce },
|
||||
});
|
||||
// Update second column issue comment count without reloading the whole
|
||||
// issue list.
|
||||
const issueIndex = issues.findIndex(i => i.id === issue.id);
|
||||
if (issueIndex !== -1) {
|
||||
issues[issueIndex].commentCount += 1;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Comment creation failed: ", error);
|
||||
} finally {
|
||||
@@ -205,11 +176,6 @@
|
||||
},
|
||||
opts: { announce: $nodeRunning && $announce },
|
||||
});
|
||||
// Update second column issue title without reloading the whole issue list.
|
||||
const issueIndex = issues.findIndex(i => i.id === issue.id);
|
||||
if (issueIndex !== -1) {
|
||||
issues[issueIndex].title = newTitle;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Issue title editing failed: ", error);
|
||||
} finally {
|
||||
@@ -254,11 +220,6 @@
|
||||
},
|
||||
opts: { announce: $nodeRunning && $announce },
|
||||
});
|
||||
// Update second column issue icon without reloading the whole issue list.
|
||||
const issueIndex = issues.findIndex(i => i.id === issue.id);
|
||||
if (issueIndex !== -1) {
|
||||
issues[issueIndex].state = state;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Changing issue state failed", error);
|
||||
} finally {
|
||||
|
||||
+36
-53
@@ -98,8 +98,6 @@ export interface LoadedRepoIssueRoute {
|
||||
repo: RepoInfo;
|
||||
config: Config;
|
||||
issue: Issue;
|
||||
issues: Issue[];
|
||||
status: IssueStatus;
|
||||
activity: Operation<IssueAction>[];
|
||||
threads: Thread[];
|
||||
sidebarData: SidebarData;
|
||||
@@ -138,7 +136,6 @@ export interface LoadedRepoPatchRoute {
|
||||
repo: RepoInfo;
|
||||
config: Config;
|
||||
patch: Patch;
|
||||
patches: PaginatedQuery<Patch[]>;
|
||||
status: PatchStatus | undefined;
|
||||
review: Review | DraftReview | undefined;
|
||||
revisions: Revision[];
|
||||
@@ -183,30 +180,24 @@ export type LoadedRepoRoute =
|
||||
export async function loadPatch(
|
||||
route: RepoPatchRoute,
|
||||
): Promise<LoadedRepoPatchRoute> {
|
||||
const [sidebarData, repo, patches, patch, revisions, activity] =
|
||||
await Promise.all([
|
||||
loadSidebarData(),
|
||||
invoke<RepoInfo>("repo_by_id", {
|
||||
rid: route.rid,
|
||||
}),
|
||||
invoke<PaginatedQuery<Patch[]>>("list_patches", {
|
||||
rid: route.rid,
|
||||
status: route.status,
|
||||
take: DEFAULT_TAKE,
|
||||
}),
|
||||
invoke<Patch>("patch_by_id", {
|
||||
rid: route.rid,
|
||||
id: route.patch,
|
||||
}),
|
||||
invoke<Revision[]>("revisions_by_patch", {
|
||||
rid: route.rid,
|
||||
id: route.patch,
|
||||
}),
|
||||
invoke<Operation<PatchAction>[]>("activity_by_patch", {
|
||||
rid: route.rid,
|
||||
id: route.patch,
|
||||
}),
|
||||
]);
|
||||
const [sidebarData, repo, patch, revisions, activity] = await Promise.all([
|
||||
loadSidebarData(),
|
||||
invoke<RepoInfo>("repo_by_id", {
|
||||
rid: route.rid,
|
||||
}),
|
||||
invoke<Patch>("patch_by_id", {
|
||||
rid: route.rid,
|
||||
id: route.patch,
|
||||
}),
|
||||
invoke<Revision[]>("revisions_by_patch", {
|
||||
rid: route.rid,
|
||||
id: route.patch,
|
||||
}),
|
||||
invoke<Operation<PatchAction>[]>("activity_by_patch", {
|
||||
rid: route.rid,
|
||||
id: route.patch,
|
||||
}),
|
||||
]);
|
||||
|
||||
const config = sidebarData.config;
|
||||
|
||||
@@ -229,7 +220,6 @@ export async function loadPatch(
|
||||
repo,
|
||||
config,
|
||||
patch,
|
||||
patches,
|
||||
revisions,
|
||||
status: route.status,
|
||||
review,
|
||||
@@ -376,29 +366,24 @@ export async function loadRepoCommit(
|
||||
export async function loadIssue(
|
||||
route: RepoIssueRoute,
|
||||
): Promise<LoadedRepoIssueRoute> {
|
||||
const [sidebarData, repo, issue, activity, issues, threads] =
|
||||
await Promise.all([
|
||||
loadSidebarData(),
|
||||
invoke<RepoInfo>("repo_by_id", {
|
||||
rid: route.rid,
|
||||
}),
|
||||
invoke<Issue>("issue_by_id", {
|
||||
rid: route.rid,
|
||||
id: route.issue,
|
||||
}),
|
||||
invoke<Operation<IssueAction>[]>("activity_by_issue", {
|
||||
rid: route.rid,
|
||||
id: route.issue,
|
||||
}),
|
||||
invoke<Issue[]>("list_issues", {
|
||||
rid: route.rid,
|
||||
status: route.status,
|
||||
}),
|
||||
invoke<Thread[]>("comment_threads_by_issue_id", {
|
||||
rid: route.rid,
|
||||
id: route.issue,
|
||||
}),
|
||||
]);
|
||||
const [sidebarData, repo, issue, activity, threads] = await Promise.all([
|
||||
loadSidebarData(),
|
||||
invoke<RepoInfo>("repo_by_id", {
|
||||
rid: route.rid,
|
||||
}),
|
||||
invoke<Issue>("issue_by_id", {
|
||||
rid: route.rid,
|
||||
id: route.issue,
|
||||
}),
|
||||
invoke<Operation<IssueAction>[]>("activity_by_issue", {
|
||||
rid: route.rid,
|
||||
id: route.issue,
|
||||
}),
|
||||
invoke<Thread[]>("comment_threads_by_issue_id", {
|
||||
rid: route.rid,
|
||||
id: route.issue,
|
||||
}),
|
||||
]);
|
||||
|
||||
return {
|
||||
resource: "repo.issue",
|
||||
@@ -408,9 +393,7 @@ export async function loadIssue(
|
||||
config: sidebarData.config,
|
||||
issue,
|
||||
activity,
|
||||
issues,
|
||||
threads,
|
||||
status: route.status,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user