Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/app/components/dashboard/ActionsTab.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { createMemo, For, Show } from "solid-js";
import { createStore } from "solid-js/store";
import type { WorkflowRun, ApiError } from "../../services/api";
import type { WorkflowRun } from "../../services/api";
import { config } from "../../stores/config";
import { viewState, setViewState, setTabFilter, resetTabFilter, resetAllTabFilters, ignoreItem, unignoreItem, type ActionsFilterField } from "../../stores/view";
import WorkflowRunRow from "./WorkflowRunRow";
import IgnoreBadge from "./IgnoreBadge";
import ErrorBannerList from "../shared/ErrorBannerList";
import SkeletonRows from "../shared/SkeletonRows";
import FilterChips from "../shared/FilterChips";
import type { FilterChipGroupDef } from "../shared/FilterChips";
Expand All @@ -14,7 +13,6 @@ import ChevronIcon from "../shared/ChevronIcon";
interface ActionsTabProps {
workflowRuns: WorkflowRun[];
loading?: boolean;
errors?: ApiError[];
}

interface WorkflowGroup {
Expand Down Expand Up @@ -199,13 +197,10 @@ export default function ActionsTab(props: ActionsTabProps) {
<SkeletonRows label="Loading workflow runs" />
</Show>

{/* Error */}
<ErrorBannerList errors={props.errors?.map((e) => ({ source: e.repo, message: e.message, retryable: e.retryable }))} />

{/* Empty */}
<Show
when={
!props.loading && (!props.errors || props.errors.length === 0) && repoGroups().length === 0
!props.loading && repoGroups().length === 0
}
>
<div class="p-8 text-center text-gray-500 dark:text-gray-400">
Expand Down
17 changes: 1 addition & 16 deletions src/app/components/dashboard/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import IssuesTab from "./IssuesTab";
import PullRequestsTab from "./PullRequestsTab";
import { config } from "../../stores/config";
import { viewState, updateViewState } from "../../stores/view";
import type { Issue, PullRequest, WorkflowRun, ApiError } from "../../services/api";
import type { Issue, PullRequest, WorkflowRun } from "../../services/api";
import { createPollCoordinator, fetchAllData, type DashboardData } from "../../services/poll";
import { clearAuth, user, onAuthCleared, DASHBOARD_STORAGE_KEY } from "../../stores/auth";
import { getErrors, dismissError } from "../../lib/errors";
import ErrorBannerList from "../shared/ErrorBannerList";

// ── Shared dashboard store (module-level to survive navigation) ─────────────

Expand All @@ -22,7 +20,6 @@ interface DashboardStore {
issues: Issue[];
pullRequests: PullRequest[];
workflowRuns: WorkflowRun[];
errors: ApiError[];
loading: boolean;
lastRefreshedAt: Date | null;
}
Expand All @@ -31,7 +28,6 @@ const initialDashboardState: DashboardStore = {
issues: [],
pullRequests: [],
workflowRuns: [],
errors: [],
loading: true,
lastRefreshedAt: null,
};
Expand All @@ -51,7 +47,6 @@ function loadCachedDashboard(): DashboardStore {
issues: parsed.issues as Issue[],
pullRequests: parsed.pullRequests as PullRequest[],
workflowRuns: parsed.workflowRuns as WorkflowRun[],
errors: [],
loading: false,
lastRefreshedAt: typeof parsed.lastRefreshedAt === "string" ? new Date(parsed.lastRefreshedAt) : null,
};
Expand Down Expand Up @@ -93,7 +88,6 @@ async function pollFetch(): Promise<DashboardData> {
issues: data.issues,
pullRequests: data.pullRequests,
workflowRuns: data.workflowRuns,
errors: data.errors,
loading: false,
lastRefreshedAt: now,
});
Expand Down Expand Up @@ -191,35 +185,26 @@ export default function DashboardPage() {
onRefresh={() => _coordinator()?.manualRefresh()}
/>

{/* Global error banner */}
<ErrorBannerList
errors={getErrors().map((e) => ({ source: e.source, message: e.message, retryable: e.retryable }))}
onDismiss={(index) => dismissError(getErrors()[index].id)}
/>

<main class="flex-1 overflow-auto">
<Switch>
<Match when={activeTab() === "issues"}>
<IssuesTab
issues={dashboardData.issues}
loading={dashboardData.loading}
errors={dashboardData.errors}
userLogin={userLogin()}
/>
</Match>
<Match when={activeTab() === "pullRequests"}>
<PullRequestsTab
pullRequests={dashboardData.pullRequests}
loading={dashboardData.loading}
errors={dashboardData.errors}
userLogin={userLogin()}
/>
</Match>
<Match when={activeTab() === "actions"}>
<ActionsTab
workflowRuns={dashboardData.workflowRuns}
loading={dashboardData.loading}
errors={dashboardData.errors}
/>
</Match>
</Switch>
Expand Down
6 changes: 1 addition & 5 deletions src/app/components/dashboard/IssuesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { createEffect, createMemo, createSignal, For, Show } from "solid-js";
import { createStore } from "solid-js/store";
import { config } from "../../stores/config";
import { viewState, setSortPreference, setTabFilter, resetTabFilter, resetAllTabFilters, ignoreItem, unignoreItem, type IssueFilterField } from "../../stores/view";
import type { Issue, ApiError } from "../../services/api";
import type { Issue } from "../../services/api";
import ItemRow from "./ItemRow";
import IgnoreBadge from "./IgnoreBadge";
import SortIcon from "../shared/SortIcon";
import ErrorBannerList from "../shared/ErrorBannerList";
import PaginationControls from "../shared/PaginationControls";
import FilterChips from "../shared/FilterChips";
import type { FilterChipGroupDef } from "../shared/FilterChips";
Expand All @@ -19,7 +18,6 @@ import { groupByRepo, computePageLayout, slicePageGroups } from "../../lib/group
export interface IssuesTabProps {
issues: Issue[];
loading?: boolean;
errors?: ApiError[];
userLogin: string;
}

Expand Down Expand Up @@ -162,8 +160,6 @@ export default function IssuesTab(props: IssuesTabProps) {

return (
<div class="flex flex-col h-full">
<ErrorBannerList errors={props.errors?.map((e) => ({ source: e.repo, message: e.message, retryable: e.retryable }))} />

{/* Column headers */}
<div
role="rowgroup"
Expand Down
6 changes: 1 addition & 5 deletions src/app/components/dashboard/PullRequestsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { createEffect, createMemo, createSignal, For, Show } from "solid-js";
import { createStore } from "solid-js/store";
import { config } from "../../stores/config";
import { viewState, setSortPreference, ignoreItem, unignoreItem, setTabFilter, resetTabFilter, resetAllTabFilters, type PullRequestFilterField } from "../../stores/view";
import type { PullRequest, ApiError } from "../../services/api";
import type { PullRequest } from "../../services/api";
import { deriveInvolvementRoles, prSizeCategory } from "../../lib/format";
import ItemRow from "./ItemRow";
import StatusDot from "../shared/StatusDot";
import IgnoreBadge from "./IgnoreBadge";
import SortIcon from "../shared/SortIcon";
import ErrorBannerList from "../shared/ErrorBannerList";
import PaginationControls from "../shared/PaginationControls";
import FilterChips from "../shared/FilterChips";
import type { FilterChipGroupDef } from "../shared/FilterChips";
Expand All @@ -22,7 +21,6 @@ import { groupByRepo, computePageLayout, slicePageGroups } from "../../lib/group
export interface PullRequestsTabProps {
pullRequests: PullRequest[];
loading?: boolean;
errors?: ApiError[];
userLogin: string;
}

Expand Down Expand Up @@ -244,8 +242,6 @@ export default function PullRequestsTab(props: PullRequestsTabProps) {

return (
<div class="flex flex-col h-full">
<ErrorBannerList errors={props.errors?.map((e) => ({ source: e.repo, message: e.message, retryable: e.retryable }))} />

{/* Column headers */}
<div
role="rowgroup"
Expand Down
Loading
Loading