diff --git a/src/app/components/dashboard/ActionsTab.tsx b/src/app/components/dashboard/ActionsTab.tsx index 577ea195..6d587ed5 100644 --- a/src/app/components/dashboard/ActionsTab.tsx +++ b/src/app/components/dashboard/ActionsTab.tsx @@ -204,6 +204,10 @@ export default function ActionsTab(props: ActionsTabProps) { const repoGroups = createMemo(() => orderRepoGroups(groupRuns(filteredRuns()), viewState.lockedRepos) ); + const visibleLockedRepos = createMemo(() => { + const rendered = new Set(repoGroups().map(g => g.repoFullName)); + return viewState.lockedRepos.filter(name => rendered.has(name)); + }); createEffect(() => { const names = activeRepoNames(); @@ -302,7 +306,7 @@ export default function ActionsTab(props: ActionsTabProps) { trailing={ <> - + } collapsedSummary={ diff --git a/src/app/components/dashboard/IssuesTab.tsx b/src/app/components/dashboard/IssuesTab.tsx index 60013914..d688f16b 100644 --- a/src/app/components/dashboard/IssuesTab.tsx +++ b/src/app/components/dashboard/IssuesTab.tsx @@ -194,6 +194,10 @@ export default function IssuesTab(props: IssuesTabProps) { const repoGroups = createMemo(() => orderRepoGroups(groupByRepo(filteredSorted()), viewState.lockedRepos) ); + const visibleLockedRepos = createMemo(() => { + const rendered = new Set(repoGroups().map(g => g.repoFullName)); + return viewState.lockedRepos.filter(name => rendered.has(name)); + }); const pageLayout = createMemo(() => computePageLayout(repoGroups(), config.itemsPerPage)); const pageCount = createMemo(() => pageLayout().pageCount); const pageGroups = createMemo(() => @@ -367,7 +371,7 @@ export default function IssuesTab(props: IssuesTabProps) { trailing={ <> - + } collapsedSummary={ diff --git a/src/app/components/dashboard/PullRequestsTab.tsx b/src/app/components/dashboard/PullRequestsTab.tsx index 094b7f1e..89ef011c 100644 --- a/src/app/components/dashboard/PullRequestsTab.tsx +++ b/src/app/components/dashboard/PullRequestsTab.tsx @@ -291,6 +291,10 @@ export default function PullRequestsTab(props: PullRequestsTabProps) { const repoGroups = createMemo(() => orderRepoGroups(groupByRepo(filteredSorted()), viewState.lockedRepos) ); + const visibleLockedRepos = createMemo(() => { + const rendered = new Set(repoGroups().map(g => g.repoFullName)); + return viewState.lockedRepos.filter(name => rendered.has(name)); + }); const pageLayout = createMemo(() => computePageLayout(repoGroups(), config.itemsPerPage)); const pageCount = createMemo(() => pageLayout().pageCount); const pageGroups = createMemo(() => @@ -474,7 +478,7 @@ export default function PullRequestsTab(props: PullRequestsTabProps) { trailing={ <> - + } collapsedSummary={ diff --git a/src/app/components/shared/RepoLockControls.tsx b/src/app/components/shared/RepoLockControls.tsx index be6cbf25..988b0896 100644 --- a/src/app/components/shared/RepoLockControls.tsx +++ b/src/app/components/shared/RepoLockControls.tsx @@ -5,16 +5,19 @@ import { withFlipAnimation } from "../../lib/scroll"; interface RepoLockControlsProps { repoFullName: string; + visibleLockedRepos: string[]; } export default function RepoLockControls(props: RepoLockControlsProps) { + const visibleSet = createMemo(() => new Set(props.visibleLockedRepos)); + const lockInfo = createMemo(() => { - const list = viewState.lockedRepos; - const idx = list.indexOf(props.repoFullName); + const isLocked = viewState.lockedRepos.indexOf(props.repoFullName) !== -1; + const visIdx = props.visibleLockedRepos.indexOf(props.repoFullName); return { - isLocked: idx !== -1, - isFirst: idx === 0, - isLast: idx !== -1 && idx === list.length - 1, + isLocked, + isFirst: visIdx === 0, + isLast: visIdx !== -1 && visIdx === props.visibleLockedRepos.length - 1, }; }); @@ -52,7 +55,7 @@ export default function RepoLockControls(props: RepoLockControlsProps) {