feat(ui): R3 S2 — loading rows for blank-flash pages, error paths for forever-loading ones

- Blank-flash (showed an empty state on first load before data): DownloadCenter (queue + library
  tabs), AdminUsers (roles + invites), ChatThread, PlaylistsRail now show a loading indicator
  (and an error+retry) instead of a false-empty flash — guarded on `&& !data` so live data isn't
  disturbed on refetch.
- Forever-loading (`isLoading || !data` loops forever on a failed fetch): ConfigPanel, the three
  PlexBrowse subviews (playlist/show/season), and Stats' admin dashboard get an `isError && !data`
  error+retry path before the loading branch.
- Playlists' detail pane already had an error path (isError+retry); its list lives in PlaylistsRail
  (now covered), so no change needed there.
This commit is contained in:
2026-07-22 04:24:38 +02:00
parent a393fd2fb1
commit bf96318dea
7 changed files with 92 additions and 20 deletions
+25 -10
View File
@@ -19,6 +19,7 @@ import {
import clsx from "clsx";
import Tabs, { usePersistedTab } from "./Tabs";
import { PageToolbar } from "./PageShell";
import { StateMessage } from "./QueryState";
import Modal from "./Modal";
// Lazy: these dialogs/editors open on demand, so they stay out of the Downloads page chunk until
// used (the video editor in particular is heavy — filmstrip + scrubber).
@@ -803,11 +804,18 @@ export default function DownloadCenter() {
</IconBtn>
</DownloadRow>
))}
{queue.length === 0 && (
<div className="text-sm text-muted py-10 text-center">
{t("downloads.empty.queue")}
</div>
)}
{queue.length === 0 &&
(jobsQ.isError && !jobsQ.data ? (
<StateMessage tone="error" onRetry={() => jobsQ.refetch()}>
{t("common.loadError")}
</StateMessage>
) : jobsQ.isLoading ? (
<div className="text-sm text-muted py-10 text-center">{t("common.loading")}</div>
) : (
<div className="text-sm text-muted py-10 text-center">
{t("downloads.empty.queue")}
</div>
))}
</div>
</>
)}
@@ -860,11 +868,18 @@ export default function DownloadCenter() {
</IconBtn>
</DownloadRow>
))}
{library.length === 0 && (
<div className="text-sm text-muted py-10 text-center">
{t("downloads.empty.done")}
</div>
)}
{library.length === 0 &&
(jobsQ.isError && !jobsQ.data ? (
<StateMessage tone="error" onRetry={() => jobsQ.refetch()}>
{t("common.loadError")}
</StateMessage>
) : jobsQ.isLoading ? (
<div className="text-sm text-muted py-10 text-center">{t("common.loading")}</div>
) : (
<div className="text-sm text-muted py-10 text-center">
{t("downloads.empty.done")}
</div>
))}
</div>
</>
)}