Skip to content

Commit 6a7dfb5

Browse files
committed
fix(actions): adds loading guard for skeleton+stub render
ActionsTab groups Show lacked the loading guard that IssuesTab and PullRequestsTab have. During initial load with locked repos, ensureLockedRepoGroups injects stubs that made repoGroups().length > 0, rendering stubs alongside the loading skeleton.
1 parent ae28cba commit 6a7dfb5

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

src/app/components/dashboard/ActionsTab.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ export default function ActionsTab(props: ActionsTabProps) {
263263
<SkeletonRows label="Loading workflow runs" />
264264
</Show>
265265

266-
{/* Empty */}
266+
{/* Empty — only when no groups exist at all (locked stubs are handled by EmptyLockedRepoRow) */}
267267
<Show
268268
when={
269-
!props.loading && repoGroups().length === 0
269+
(!props.loading || props.workflowRuns.length > 0) && repoGroups().length === 0
270270
}
271271
>
272272
<div class="p-8 text-center text-base-content/50">
@@ -275,7 +275,7 @@ export default function ActionsTab(props: ActionsTabProps) {
275275
</Show>
276276

277277
{/* Repo groups */}
278-
<Show when={repoGroups().length > 0}>
278+
<Show when={(!props.loading || props.workflowRuns.length > 0) && repoGroups().length > 0}>
279279
<For each={repoGroups()}>
280280
{(repoGroup) => {
281281
const isEmpty = () => repoGroup.workflows.length === 0;

tests/components/dashboard/ActionsTab.test.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,26 @@ describe("ActionsTab — empty-repo state preservation", () => {
160160
// Empty-state message does NOT render alongside the stub
161161
expect(screen.queryByText("No workflow runs found.")).toBeNull();
162162
});
163+
164+
it("hides locked stubs during initial load (no skeleton + stub double render)", () => {
165+
setViewState(produce((s) => {
166+
s.lockedRepos = ["owner/locked-empty"];
167+
}));
168+
169+
const { container } = render(() => (
170+
<ActionsTab
171+
workflowRuns={[]}
172+
loading={true}
173+
configRepoNames={["owner/locked-empty"]}
174+
/>
175+
));
176+
177+
// Loading skeleton shows (label is aria-label, not visible text)
178+
screen.getByRole("status", { name: "Loading workflow runs" });
179+
// Locked stub does NOT render alongside the skeleton
180+
const stub = container.querySelector('[data-repo-group="owner/locked-empty"]');
181+
expect(stub).toBeNull();
182+
});
163183
});
164184

165185
// ── ActionsTab — RepoGroupHeader integration ──────────────────────────────────

0 commit comments

Comments
 (0)