Skip to content

The agent that grows with you

refactor(desktop): name the catalog's inline page sizes, stall timeout and gaps

Austin Pickett07d79250097c
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
index 5cc39393caf..c1e12350d2b 100644
--- a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
+++ b/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
@@ -61,6 +61,8 @@ interface CatalogBrowserProps {
}
const PAGE_SIZE = 60
+/** Related entries listed under a detail. */
+const RELATED_COUNT = 3
// The skills hub carries ~10k distinct tags; the rail is for browsing, search covers the tail.
const TAG_LIMIT = 16
/** On: masonry lanes. Off: fallback grid whose rows share one height (`.catalog-grid`). */
@@ -253,7 +255,7 @@ function CatalogFilteredCards({
/** Related picks are only worth computing while a detail is on screen. */
const detailRelated = (entries: CatalogEntry[], selected: CatalogEntry | undefined, shown: boolean) =>
- selected && shown ? relatedEntries(entries, selected, 3) : []
+ selected && shown ? relatedEntries(entries, selected, RELATED_COUNT) : []
/** Discovery shelves show only while browsing everything. */
const isDiscoverView = (facets: CatalogFacets, query: string) =>
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-discovery.css b/apps/desktop/src/app/capabilities/catalog/catalog-discovery.css
index 38fc1ca366e..371753dab34 100644
--- a/apps/desktop/src/app/capabilities/catalog/catalog-discovery.css
+++ b/apps/desktop/src/app/capabilities/catalog/catalog-discovery.css
@@ -14,7 +14,7 @@
[data-catalog-variant=compact] .catalog-card-footer { padding-bottom: 20px; }
[data-catalog-results] { container-type: inline-size; }
.catalog-search-header { padding-top: 20px; }
-.catalog-filter-bar { padding-block: var(--capabilities-gap-controls) 12px; }
+.catalog-filter-bar { padding-block: var(--capabilities-gap-controls) var(--capabilities-gap-sticky); }
.catalog-filter-row { display: flex; align-items: center; gap: 15px; min-width: 0; }
.catalog-filter-chips { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; overflow-x: auto; padding-block: 4px; }
.catalog-filter-row > :first-child { flex-shrink: 0; }
@@ -23,7 +23,7 @@
.catalog-card-footer > span:first-child { min-width: 0; width: auto; flex: 1; justify-content: flex-start; }
.catalog-card-footer [data-slot=badge] { max-width: none; }
.catalog-discovery { padding-bottom: 48px; }
-.catalog-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: var(--capabilities-gap-section) 20px var(--capabilities-gap-heading); }
+.catalog-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: var(--capabilities-gap-section) var(--capabilities-inset) var(--capabilities-gap-heading); }
:is(.catalog-discovery, .capabilities-sections) > section:first-child .catalog-section-heading { padding-top: var(--capabilities-gap-lead); }
.catalog-section-heading h2 { margin: 0; font-size: 1.4rem; font-weight: 600; letter-spacing: -.025em; }
.catalog-section-heading p { margin: 6px 0 0; font-size: .8125rem; color: var(--ui-text-tertiary); }
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsx
index b852ca28514..15259e47699 100644
--- a/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsx
+++ b/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsx
@@ -25,6 +25,10 @@ interface CatalogFilterBarProps {
resultCount: number
}
+
+/** Chips shown before the rest collapse behind "+N"; a selected chip always shows. */
+const VISIBLE_CHIPS = 3
+
export function CatalogFilterBar(props: CatalogFilterBarProps) {
const { t } = useI18n()
const c = t.catalog
@@ -39,7 +43,7 @@ export function CatalogFilterBar(props: CatalogFilterBarProps) {
const selected = props.facets[mode]
const onSelect = mode === 'categories' ? props.onCategory : props.onSource
- const visible = rows.filter((row, index) => index < 3 || selected.includes(row.value))
+ const visible = rows.filter((row, index) => index < VISIBLE_CHIPS || selected.includes(row.value))
const overflow = rows.filter(row => !visible.includes(row))
const activeCount = props.facets.categories.length + props.facets.sources.length + props.facets.tags.length
diff --git a/apps/desktop/src/app/capabilities/ui/page.css b/apps/desktop/src/app/capabilities/ui/page.css
index ee21179f5c3..7711238a43f 100644
--- a/apps/desktop/src/app/capabilities/ui/page.css
+++ b/apps/desktop/src/app/capabilities/ui/page.css
@@ -6,6 +6,8 @@
--capabilities-gap-lead: 20px; /* last control row → first section heading */
--capabilities-gap-section: 48px; /* one section → the next section's heading */
--capabilities-gap-heading: 20px; /* section heading → its cards or rows */
+ --capabilities-gap-sticky: 12px; /* sticky filter row → the bar's bottom edge */
+ --capabilities-inset: 20px; /* headings and copy inset from the card edge */
}
.capabilities-page,