Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Bar menus: tabs and group names without counts

Adarsh7c52d39d3405
diff --git a/src/components/nav/mega-panel.tsx b/src/components/nav/mega-panel.tsx
index 22c9ebba..b67fccf5 100644
--- a/src/components/nav/mega-panel.tsx
+++ b/src/components/nav/mega-panel.tsx
@@ -264,13 +264,13 @@ export function MegaGrid({ model, current, now, kind }: { model: MegaModel; curr
}
return (
<div ref={root}>
- {/* One row of names: All, then each group (its count beside it). Pinned under the panel's header as it scrolls. */}
+ {/* One row of names: All, then each group (the header line above says how many). Pinned under the panel's header as it scrolls. */}
<div role="group" aria-label={`Show in ${MEGA_AREAS[model.id].label}`} className="sticky top-[var(--mega-head,0px)] z-10 -mx-6 mb-4 flex gap-1 overflow-x-auto border-b bg-popover px-6 [scrollbar-width:none]">
- {[{ label: "All", n: all.length }, ...model.columns.map((c) => ({ label: c.label, n: groupItems(c).length }))].map((t, i) => {
+ {["All", ...model.columns.map((c) => c.label)].map((label, i) => {
const on = tab === i - 1;
return (
<button
- key={t.label}
+ key={label}
type="button"
aria-pressed={on}
onClick={() => pick(i - 1)}
@@ -279,8 +279,7 @@ export function MegaGrid({ model, current, now, kind }: { model: MegaModel; curr
on ? "border-brand-text text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
)}
>
- {t.label}
- <span className="text-[12px] font-normal text-muted-foreground tabular-nums">{t.n}</span>
+ {label}
</button>
);
})}
@@ -297,13 +296,12 @@ export function MegaGrid({ model, current, now, kind }: { model: MegaModel; curr
<Fragment key={c.id}>
{famHead && (
<p data-family={famHead.id} className="break-after-avoid pt-1 pb-2 font-heading text-[22px] leading-7 text-brand-text">
- {famHead.label} <span className="font-sans text-[12px] text-muted-foreground tabular-nums">{famHead.count}</span>
+ {famHead.label}
</p>
)}
<p id={`${ids}-${c.id}`} data-group={c.id} className="break-inside-avoid break-after-avoid pb-2">
<button type="button" onClick={() => pick(ci)} aria-label={`Show only ${c.label}`} className="nav-row -mx-1.5 flex w-[calc(100%+12px)] min-w-0 items-baseline gap-1.5 rounded-[8px] px-1.5 py-1 text-left">
<span className="truncate text-[13.5px] font-semibold">{c.label}</span>
- <span className="text-[12px] text-muted-foreground tabular-nums">{items.length}</span>
<ChevronRight aria-hidden className="ml-auto size-3.5 shrink-0 self-center text-muted-foreground" />
</button>
</p>
diff --git a/tests/nav-bar.test.ts b/tests/nav-bar.test.ts
index d6c3c1e2..0dd5c8d2 100644
--- a/tests/nav-bar.test.ts
+++ b/tests/nav-bar.test.ts
@@ -159,10 +159,11 @@ describe("the Studios menu's tiles", () => {
expect(launcherColumns(undefined).map((c) => c.lead.id)).toEqual(["cinema", "shorts", "marketing", "fashion-factory", "audio", "upscale"]);
// "All": every tile flows down balanced columns (three, four from lg, five from xl), each group starting with its name.
expect(html).toContain("columns-3 lg:columns-4 xl:columns-5");
- // One row of names above them: All, then each group with its count (each a button that shows that group alone).
- expect(html).toMatch(/aria-pressed="true"[^>]*>All<span[^>]*>27</);
- for (const [label, n] of [["Film &amp; video", 4], ["Social &amp; shorts", 6], ["Sell &amp; advertise", 5], ["People &amp; fashion", 4], ["Sound", 5], ["Finish &amp; convert", 3]] as const)
- expect(html, label).toMatch(new RegExp(`aria-pressed="false"[^>]*>${label}<span[^>]*>${n}<`));
+ // One row of names above them: All, then each group (each a button that shows that group alone). No counts in
+ // it: the header line says how many.
+ expect(html).toMatch(/aria-pressed="true"[^>]*>All<\/button>/);
+ for (const label of ["Film &amp; video", "Social &amp; shorts", "Sell &amp; advertise", "People &amp; fashion", "Sound", "Finish &amp; convert"])
+ expect(html, label).toMatch(new RegExp(`aria-pressed="false"[^>]*>${label}</button>`));
// Every link is in the arrow keys' set (their places are set from where the tiles land, in the browser).
for (const a of anchors(html)) expect(a.tag, a.href).toContain("data-key");
expect(studioCount()).toBe(23);