fix(ui): a picker whose list failed says so, and takes no pick while one is being written

- Combobox gains `error` (said in the list, not "No matches") and a soft `disabled` (keeps the
  focus, announced, opens and changes nothing).
- UserPicker passes both: the share dialog's recipient picker is off while a share is pending, and
  the share and quota pickers say when the user list failed to load.
- ChannelPicker and the Plex playlist/collection pickers say a failed load too.
- The channel menu's Tags row says loading / failed instead of "no tags yet".
This commit is contained in:
2026-09-27 14:47:46 +02:00
parent 70f98b352f
commit 17bb14fb18
10 changed files with 102 additions and 6 deletions
+13 -2
View File
@@ -23,6 +23,7 @@ export function useChannelActions({
onView,
onOpenWizard,
tags,
tagsState = "ready",
onToggleTag,
onPickPriority,
}: {
@@ -30,6 +31,9 @@ export function useChannelActions({
onOpenWizard: () => void;
/** The reader's own tags (no system tags) — the Tags submenu lists them A–Z. */
tags: readonly Tag[];
/** Whether `tags` is the answer yet: loading or failed is said as such, never as "no tags yet"
* (E28 review J3). */
tagsState?: "loading" | "error" | "ready";
onToggleTag: (c: ManagedChannel, tagId: number) => void;
/** A priority step picked: the caller re-sorts its list and follows the row. */
onPickPriority: (c: ManagedChannel, priority: number) => void;
@@ -149,8 +153,15 @@ export function useChannelActions({
label: t("channels.tags.label"),
icon: <Tags className="w-4 h-4" />,
};
if (tags.length === 0)
return { ...base, disabled: true, note: t("channels.row.noTagsYet"), onSelect: () => {} };
if (tags.length === 0) {
const note =
tagsState === "loading"
? t("common.loading")
: tagsState === "error"
? t("common.loadError")
: t("channels.row.noTagsYet");
return { ...base, disabled: true, note, onSelect: () => {} };
}
const on = new Set(c.tag_ids);
return {
...base,