Add open issues status filter
Build / build (push) Successful in 12s

This commit is contained in:
2026-07-18 12:49:15 -05:00
parent 389afb3162
commit c9c2a71dcd
9 changed files with 80 additions and 16 deletions
+15 -2
View File
@@ -8,6 +8,7 @@ import {
type AddUrlMode,
type AppView,
type OpenIssue,
type OpenIssuesStateFilter,
type ScreenshotAttachment
} from "./store";
import type { GiteaIssueAttachment, GiteaIssueComment, GiteaIssueSummary, GiteaRepoSummary } from "./api";
@@ -656,6 +657,14 @@ function renderOpenIssues(): string {
<input id="limit-open-issues" type="checkbox" ${state.openIssuesLimitToCurrentRepo ? "checked" : ""} />
<span>Only current repo</span>
</label>
<label class="compact-select-label">
<span>Status</span>
<select id="open-issues-state-filter">
<option value="open"${state.openIssuesStateFilter === "open" ? " selected" : ""}>Open</option>
<option value="closed"${state.openIssuesStateFilter === "closed" ? " selected" : ""}>Closed</option>
<option value="all"${state.openIssuesStateFilter === "all" ? " selected" : ""}>Open + Closed</option>
</select>
</label>
<button id="refresh-target-issues" class="secondary-button compact-button" type="button" ${state.isLoadingTargetIssues ? "disabled" : ""}>
${state.isLoadingTargetIssues ? "Loading..." : "Refresh"}
</button>
@@ -862,6 +871,10 @@ function bindViewActions(): void {
appStore.getState().setOpenIssuesLimit((event.target as HTMLInputElement).checked);
});
viewContent?.querySelector<HTMLSelectElement>("#open-issues-state-filter")?.addEventListener("change", (event) => {
appStore.getState().setOpenIssuesStateFilter((event.target as HTMLSelectElement).value as OpenIssuesStateFilter);
});
viewContent?.querySelector<HTMLInputElement>("#issue-subject")?.addEventListener("input", (event) => {
appStore.getState().setIssueDraft({
subject: (event.target as HTMLInputElement).value
@@ -1253,8 +1266,8 @@ function render(): void {
function ensureOpenIssuesLoaded(): void {
const state = appStore.getState();
const scopeKey = state.openIssuesLimitToCurrentRepo
? `current:${getActiveKnownUrl()?.giteaRepo?.fullName ?? "none"}`
: "all";
? `current:${getActiveKnownUrl()?.giteaRepo?.fullName ?? "none"}:${state.openIssuesStateFilter}`
: `all-repos:${state.openIssuesStateFilter}`;
if (
state.activeView === "open-issues" &&