Skip to content

The agent that grows with you

fix(website): compact plugin and skill directory headers

unsupportedpastelsdf3e62457bfb
diff --git a/website/src/pages/plugins/index.tsx b/website/src/pages/plugins/index.tsx
index 31ee27b62c8..51bedcfd6b4 100644
--- a/website/src/pages/plugins/index.tsx
+++ b/website/src/pages/plugins/index.tsx
@@ -385,7 +385,9 @@ export default function PluginCatalogPage() {
const [tierFilter, setTierFilter] = useState("all");
const [categoryFilter, setCategoryFilter] = useState("all");
const [sort, setSort] = useState<SortKey>("stars");
+ const [filtersOpen, setFiltersOpen] = useState(false);
const searchRef = useRef<HTMLInputElement>(null);
+ const filterPanelRef = useRef<HTMLDivElement>(null);
useEffect(() => {
let cancelled = false;
@@ -414,12 +416,19 @@ export default function PluginCatalogPage() {
useEffect(() => {
const handler = (e: KeyboardEvent) => {
- if (e.key === "/" && document.activeElement?.tagName !== "INPUT") {
+ const target = e.target instanceof HTMLElement ? e.target : null;
+ const isEditable =
+ target?.matches("input, textarea, select") ||
+ target?.isContentEditable ||
+ Boolean(target?.closest("[contenteditable='true']"));
+ if (e.key === "/" && !isEditable) {
e.preventDefault();
+ e.stopImmediatePropagation();
searchRef.current?.focus();
}
if (e.key === "Escape") {
searchRef.current?.blur();
+ setFiltersOpen(false);
}
};
window.addEventListener("keydown", handler);
@@ -470,6 +479,7 @@ export default function PluginCatalogPage() {
setSearch("");
setTierFilter("all");
setCategoryFilter("all");
+ setFiltersOpen(false);
}, []);
const pickCategory = useCallback((c: string) => {
@@ -549,6 +559,7 @@ export default function PluginCatalogPage() {
{!catalogEmpty && (
<div className={styles.controlsBar}>
+ <div className={styles.controlsTopRow}>
<div className={styles.searchWrap}>
<svg
className={styles.searchIcon}
@@ -566,7 +577,7 @@ export default function PluginCatalogPage() {
<input
ref={searchRef}
type="text"
- placeholder="Search plugins by name or by what you want Hermes to do"
+ placeholder="Search plugins"
title='Tip: press "/" to jump here'
value={search}
onChange={(e) => setSearch(e.target.value)}
@@ -585,6 +596,59 @@ export default function PluginCatalogPage() {
)}
</div>
+ <button
+ type="button"
+ className={styles.filterToggle}
+ aria-expanded={filtersOpen}
+ aria-controls="plugin-directory-filters"
+ onClick={() => {
+ if (filtersOpen) {
+ setFiltersOpen(false);
+ return;
+ }
+ setFiltersOpen(true);
+ requestAnimationFrame(() => {
+ filterPanelRef.current?.scrollIntoView({ block: "start" });
+ });
+ }}
+ >
+ Filters
+ {(tierFilter !== "all" || categoryFilter !== "all") && (
+ <span className={styles.activeFilterCount}>
+ {Number(tierFilter !== "all") + Number(categoryFilter !== "all")}
+ </span>
+ )}
+ </button>
+ <label className={styles.compactSelect}>
+ <span>Source</span>
+ <select value={tierFilter} onChange={(e) => setTierFilter(e.target.value)}>
+ {TIER_ORDER.map((tier) => (
+ <option key={tier} value={tier}>{tier === "all" ? "All sources" : TIER_CONFIG[tier]?.label || tier}</option>
+ ))}
+ </select>
+ </label>
+ <label className={styles.compactSelect}>
+ <span>Category</span>
+ <select value={categoryFilter} onChange={(e) => setCategoryFilter(e.target.value)}>
+ <option value="all">All categories</option>
+ {CATEGORY_ORDER.filter((c) => categoryCounts[c]).map((c) => (
+ <option key={c} value={c}>{CATEGORY_CONFIG[c].label}</option>
+ ))}
+ </select>
+ </label>
+ <label className={`${styles.compactSelect} ${styles.compactSort}`}>
+ <span>Sort</span>
+ <select value={sort} onChange={(e) => setSort(e.target.value as SortKey)}>
+ {SORT_OPTIONS.map((opt) => <option key={opt.key} value={opt.key}>{opt.label}</option>)}
+ </select>
+ </label>
+ </div>
+
+ <div
+ id="plugin-directory-filters"
+ ref={filterPanelRef}
+ className={`${styles.filterPanel} ${filtersOpen ? styles.filterPanelOpen : ""}`}
+ >
<div className={styles.tierPills}>
{TIER_ORDER.map((tier) => {
const active = tierFilter === tier;
@@ -661,6 +725,7 @@ export default function PluginCatalogPage() {
);
})}
</div>
+ </div>
</div>
)}
diff --git a/website/src/pages/plugins/styles.module.css b/website/src/pages/plugins/styles.module.css
index 110ffd0f45a..c6060550eed 100644
--- a/website/src/pages/plugins/styles.module.css
+++ b/website/src/pages/plugins/styles.module.css
@@ -872,6 +872,180 @@
background: rgba(255, 215, 0, 0.08);
}
+.filterPanel {
+ display: contents;
+}
+
+.controlsTopRow {
+ display: contents;
+}
+
+.filterToggle,
+.compactSelect {
+ display: none;
+}
+
+@media (max-width: 1024px), (max-height: 800px) {
+ .controlsBar {
+ flex-direction: row;
+ gap: 0.65rem;
+ justify-content: center;
+ padding: 0.55rem 1rem;
+ }
+
+ .controlsTopRow {
+ display: flex;
+ align-items: center;
+ gap: 0.55rem;
+ width: min(100%, 1200px);
+ min-width: 0;
+ }
+
+ .searchWrap {
+ flex: 1 1 22rem;
+ min-width: 12rem;
+ max-width: none;
+ }
+
+ .searchInput {
+ min-height: 44px;
+ }
+
+ .compactSelect {
+ display: flex;
+ align-items: center;
+ gap: 0.35rem;
+ min-width: 0;
+ color: var(--ifm-color-emphasis-600);
+ font-size: 0.68rem;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ }
+
+ .compactSelect select {
+ height: 44px;
+ max-width: 10.5rem;
+ min-width: 0;
+ padding: 0 1.9rem 0 0.65rem;
+ border: 1px solid rgba(255, 215, 0, 0.14);
+ border-radius: 8px;
+ background: var(--ifm-background-surface-color);
+ color: var(--ifm-font-color-base);
+ font: 500 0.78rem "DM Sans", sans-serif;
+ }
+
+ .compactSort select { max-width: 11.5rem; }
+ .filterPanel { display: none; }
+}
+
+@media (max-width: 600px) {
+ .controlsBar {
+ position: static;
+ display: contents;
+ padding: 0;
+ border-bottom: 0;
+ backdrop-filter: none;
+ background: transparent !important;
+ }
+
+ .controlsTopRow {
+ position: sticky;
+ top: 60px;
+ z-index: 50;
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ width: 100%;
+ min-width: 0;
+ padding: 0.55rem 0.75rem;
+ background: rgba(7, 7, 13, 0.94);
+ border-bottom: 1px solid rgba(255, 215, 0, 0.08);
+ backdrop-filter: blur(16px);
+ }
+
+ .searchWrap {
+ position: relative;
+ flex: 1 1 auto;
+ min-width: 0;
+ margin: 0;
+ width: 100%;
+ padding: 0;
+ }
+
+ .filterToggle {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.4rem;
+ flex: 0 0 auto;
+ min-height: 44px;
+ margin: 0;
+ padding: 0 0.85rem;
+ border: 1px solid rgba(255, 215, 0, 0.16);
+ border-radius: 8px;
+ background: rgba(255, 215, 0, 0.04);
+ color: var(--ifm-font-color-base);
+ font: 600 0.82rem "DM Sans", sans-serif;
+ }
+
+ .activeFilterCount {
+ min-width: 1.25rem;
+ border-radius: 999px;
+ background: rgba(255, 215, 0, 0.14);
+ color: #ffd700;
+ }
+
+ .compactSelect { display: none; }
+ .compactSort { display: none; }
+
+ .filterPanelOpen {
+ display: block;
+ margin: 0 0.75rem 0.75rem;
+ padding: 0.75rem;
+ border: 1px solid rgba(255, 215, 0, 0.12);
+ border-radius: 10px;
+ background: var(--ifm-background-surface-color);
+ scroll-margin-top: 120px;
+ }
+
+ .filterPanelOpen .tierPills,
+ .filterPanelOpen .categoryPills {
+ justify-content: flex-start;
+ }
+
+ .filterPanelOpen .sortPills { justify-content: flex-start; }
+
+ .clearBtn {
+ right: 0.25rem;
+ width: 44px;
+ height: 44px;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .filterPanelOpen .tierBtn,
+ .filterPanelOpen .categoryBtn {
+ min-height: 44px;
+ }
+
+ .categoryHeader {
+ grid-template-columns: minmax(0, 1fr) auto;
+ gap: 0.25rem 0.5rem;
+ }
+
+ .categoryTitle,
+ .categoryBlurb,
+ .metaValue,
+ .chipList {
+ min-width: 0;
+ }
+
+ .envChip {
+ max-width: 100%;
+ overflow-wrap: anywhere;
+ }
+}
+
@media (max-width: 900px) {
.hero {
padding: 2.5rem 1.25rem 1.75rem;
diff --git a/website/src/pages/skills/index.tsx b/website/src/pages/skills/index.tsx
index 8bc022524df..b68815e0615 100644
--- a/website/src/pages/skills/index.tsx
+++ b/website/src/pages/skills/index.tsx
@@ -548,8 +548,12 @@ export default function SkillsDashboard() {
const [expandedCard, setExpandedCard] = useState<string | null>(null);
const [visibleCount, setVisibleCount] = useState(PAGE_SIZE);
const [sidebarOpen, setSidebarOpen] = useState(false);
+ const [mobileFiltersActive, setMobileFiltersActive] = useState(false);
const searchRef = useRef<HTMLInputElement>(null);
const gridRef = useRef<HTMLDivElement>(null);
+ const filterToggleRef = useRef<HTMLButtonElement>(null);
+ const filterDialogRef = useRef<HTMLElement>(null);
+ const filterCloseRef = useRef<HTMLButtonElement>(null);
useEffect(() => {
let cancelled = false;
@@ -589,19 +593,89 @@ export default function SkillsDashboard() {
useEffect(() => {
const handler = (e: KeyboardEvent) => {
- if (e.key === "/" && document.activeElement?.tagName !== "INPUT") {
+ const target = e.target instanceof HTMLElement ? e.target : null;
+ const isEditable =
+ target?.matches("input, textarea, select") ||
+ target?.isContentEditable ||
+ Boolean(target?.closest("[contenteditable='true']"));
+ if (e.key === "/" && !isEditable) {
e.preventDefault();
+ e.stopImmediatePropagation();
searchRef.current?.focus();
}
if (e.key === "Escape") {
searchRef.current?.blur();
setExpandedCard(null);
+ setSidebarOpen(false);
}
};
window.addEventListener("keydown", handler);
return () => window.removeEventListener("keydown", handler);
}, []);
+ useEffect(() => {
+ const media = window.matchMedia("(max-width: 600px)");
+ const sync = () => setMobileFiltersActive(media.matches);
+ sync();
+ media.addEventListener("change", sync);
+ return () => media.removeEventListener("change", sync);
+ }, []);
+
+ useEffect(() => {
+ if (!sidebarOpen || !mobileFiltersActive) return;
+
+ const dialog = filterDialogRef.current;
+ const previouslyFocused = document.activeElement instanceof HTMLElement
+ ? document.activeElement
+ : filterToggleRef.current;
+ const previousOverflow = document.body.style.overflow;
+ document.body.style.overflow = "hidden";
+ filterCloseRef.current?.focus();
+
+ const trapFocus = (e: KeyboardEvent) => {
+ if (!dialog) return;
+ if (e.key === "Escape") {
+ e.preventDefault();
+ e.stopPropagation();
+ setSidebarOpen(false);
+ return;
+ }
+ if (e.key !== "Tab") {
+ if (!dialog.contains(e.target as Node)) {
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ return;
+ }
+
+ const focusable = Array.from(
+ dialog.querySelectorAll<HTMLElement>(
+ "button:not([disabled]), select:not([disabled]), input:not([disabled]), [href], [tabindex]:not([tabindex='-1'])"
+ )
+ ).filter((element) => element.offsetParent !== null);
+ if (focusable.length === 0) {
+ e.preventDefault();
+ return;
+ }
+ const first = focusable[0];
+ const last = focusable[focusable.length - 1];
+ if (e.shiftKey && document.activeElement === first) {
+ e.preventDefault();
+ last.focus();
+ } else if (!e.shiftKey && document.activeElement === last) {
+ e.preventDefault();
+ first.focus();
+ }
+ };
+
+ document.addEventListener("keydown", trapFocus, true);
+ return () => {
+ document.removeEventListener("keydown", trapFocus, true);
+ document.body.style.overflow = previousOverflow;
+ previouslyFocused?.focus();
+ };
+ }, [sidebarOpen, mobileFiltersActive]);
+
const sources = useMemo(() => {
const set = new Set(allSkillsLocal.map((s) => s.source));
return SOURCE_ORDER.filter((s) => s === "all" || set.has(s));
@@ -749,6 +823,7 @@ export default function SkillsDashboard() {
</header>
<div className={styles.controlsBar}>
+ <div className={styles.controlsTopRow}>
<div className={styles.searchWrap}>
<svg className={styles.searchIcon} viewBox="0 0 20 20" fill="currentColor" width="18" height="18">
<path
@@ -760,7 +835,7 @@ export default function SkillsDashboard() {
<input
ref={searchRef}
type="text"
- placeholder='Search skills... (press "/" to focus)'
+ placeholder="Search skills"
value={search}
onChange={(e) => setSearch(e.target.value)}
className={styles.searchInput}
@@ -778,6 +853,40 @@ export default function SkillsDashboard() {
)}
</div>
+ <button
+ ref={filterToggleRef}
+ type="button"
+ className={styles.filterToggle}
+ aria-expanded={sidebarOpen}
+ aria-controls="skills-directory-filters"
+ onClick={() => setSidebarOpen((open) => !open)}
+ >
+ Filters
+ {(sourceFilter !== "all" || categoryFilter !== "all") && (
+ <span className={styles.activeFilterCount}>
+ {Number(sourceFilter !== "all") + Number(categoryFilter !== "all")}
+ </span>
+ )}
+ </button>
+
+ <label className={styles.compactSelect}>
+ <span>Source</span>
+ <select value={sourceFilter} onChange={(e) => handleSourceChange(e.target.value)}>
+ {sources.map((src) => (
+ <option key={src} value={src}>{src === "all" ? "All sources" : SOURCE_CONFIG[src]?.label || src}</option>
+ ))}
+ </select>
+ </label>
+
+ <label className={styles.compactSelect}>
+ <span>Category</span>
+ <select value={categoryFilter} onChange={(e) => setCategoryFilter(e.target.value)}>
+ <option value="all">All categories</option>
+ {categoryEntries.map((cat) => <option key={cat.key} value={cat.key}>{cat.label}</option>)}
+ </select>
+ </label>
+ </div>
+
<div className={styles.sourcePills}>
{sources.map((src) => {
const active = sourceFilter === src;
@@ -829,15 +938,42 @@ export default function SkillsDashboard() {
)}
</button>
- <aside className={`${styles.sidebar} ${sidebarOpen ? styles.sidebarOpen : ""}`}>
+ <aside
+ id="skills-directory-filters"
+ ref={filterDialogRef}
+ role={mobileFiltersActive && sidebarOpen ? "dialog" : undefined}
+ aria-modal={mobileFiltersActive && sidebarOpen ? true : undefined}
+ aria-labelledby="skills-directory-filters-title"
+ className={`${styles.sidebar} ${sidebarOpen ? styles.sidebarOpen : ""}`}
+ onKeyDown={(e) => {
+ if (mobileFiltersActive && sidebarOpen) e.stopPropagation();
+ }}
+ >
<div className={styles.sidebarHeader}>
- <h2 className={styles.sidebarTitle}>Categories</h2>
+ <h2 id="skills-directory-filters-title" className={styles.sidebarTitle}>Categories</h2>
{categoryFilter !== "all" && (
<button className={styles.sidebarClear} onClick={() => setCategoryFilter("all")}>
Clear
</button>
)}
+ <button
+ ref={filterCloseRef}
+ type="button"
+ className={styles.sidebarClose}
+ aria-label="Close skill filters"
+ onClick={() => setSidebarOpen(false)}
+ >
+ <span aria-hidden="true">×</span>
+ </button>
</div>
+ <label className={styles.sidebarSourceSelect}>
+ <span>Source</span>
+ <select value={sourceFilter} onChange={(e) => handleSourceChange(e.target.value)}>
+ {sources.map((src) => (
+ <option key={src} value={src}>{src === "all" ? "All sources" : SOURCE_CONFIG[src]?.label || src}</option>
+ ))}
+ </select>
+ </label>
<nav className={styles.catList}>
<button
className={`${styles.catItem} ${categoryFilter === "all" ? styles.catItemActive : ""}`}
diff --git a/website/src/pages/skills/styles.module.css b/website/src/pages/skills/styles.module.css
index 559089dc278..5f8ccbea071 100644
--- a/website/src/pages/skills/styles.module.css
+++ b/website/src/pages/skills/styles.module.css
@@ -914,6 +914,189 @@
}
+.controlsTopRow {
+ display: contents;
+}
+
+.filterToggle,
+.compactSelect,
+.sidebarSourceSelect,
+.sidebarClose {
+ display: none;
+}
+
+@media (max-width: 1024px), (max-height: 800px) {
+ .controlsBar {
+ flex-direction: row;
+ gap: 0.65rem;
+ justify-content: center;
+ padding: 0.55rem 1rem;
+ }
+
+ .controlsTopRow {
+ display: flex;
+ align-items: center;
+ gap: 0.55rem;
+ width: min(100%, 1200px);
+ min-width: 0;
+ }
+
+ .searchWrap {
+ flex: 1 1 24rem;
+ min-width: 12rem;
+ max-width: none;
+ }
+
+ .searchInput { min-height: 44px; }
+
+ .compactSelect {
+ display: flex;
+ align-items: center;
+ gap: 0.35rem;
+ min-width: 0;
+ color: var(--ifm-color-emphasis-600);
+ font-size: 0.68rem;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ }
+
+ .compactSelect select {
+ height: 44px;
+ max-width: 11rem;
+ min-width: 0;
+ padding: 0 1.9rem 0 0.65rem;
+ border: 1px solid rgba(255, 215, 0, 0.14);
+ border-radius: 8px;
+ background: var(--ifm-background-surface-color);
+ color: var(--ifm-font-color-base);
+ font: 500 0.78rem "DM Sans", sans-serif;
+ }
+
+ .sourcePills { display: none; }
+ .layout { grid-template-columns: 1fr; }
+ .layout > .sidebar,
+ .layout > .sidebarToggle { display: none; }
+}
+
+@media (max-width: 600px) {
+ .controlsBar {
+ position: static;
+ display: contents;
+ padding: 0;
+ border-bottom: 0;
+ backdrop-filter: none;
+ background: transparent !important;
+ }
+
+ .controlsTopRow {
+ position: sticky;
+ top: 60px;
+ z-index: 50;
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ width: 100%;
+ min-width: 0;
+ padding: 0.55rem 0.75rem;
+ background: rgba(7, 7, 13, 0.94);
+ border-bottom: 1px solid rgba(255, 215, 0, 0.08);
+ backdrop-filter: blur(16px);
+ }
+
+ .searchWrap {
+ position: relative;
+ flex: 1 1 auto;
+ min-width: 0;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ }
+
+ .compactSelect { display: none; }
+
+ .filterToggle {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.4rem;
+ flex: 0 0 auto;
+ min-height: 44px;
+ margin: 0;
+ padding: 0 0.85rem;
+ border: 1px solid rgba(255, 215, 0, 0.16);
+ border-radius: 8px;
+ background: rgba(255, 215, 0, 0.04);
+ color: var(--ifm-font-color-base);
+ font: 600 0.82rem "DM Sans", sans-serif;
+ }
+
+ .activeFilterCount {
+ min-width: 1.25rem;
+ border-radius: 999px;
+ background: rgba(255, 215, 0, 0.14);
+ color: #ffd700;
+ }
+
+ .layout > .sidebar.sidebarOpen {
+ display: block;
+ }
+
+ .sidebarSourceSelect {
+ display: flex;
+ flex-direction: column;
+ gap: 0.35rem;
+ margin-bottom: 0.8rem;
+ color: var(--ifm-font-color-secondary);
+ font-size: 0.72rem;
+ text-transform: uppercase;
+ letter-spacing: 0.08em;
+ }
+
+ .sidebarSourceSelect select {
+ min-height: 44px;
+ border: 1px solid rgba(255, 215, 0, 0.14);
+ border-radius: 8px;
+ background: var(--ifm-background-surface-color);
+ color: var(--ifm-font-color-base);
+ padding: 0 0.65rem;
+ }
+
+ .catItem { min-height: 44px; }
+
+ .clearBtn {
+ right: 0.25rem;
+ width: 44px;
+ height: 44px;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .sidebarClear {
+ min-width: 44px;
+ min-height: 44px;
+ }
+
+ .sidebarClose {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 44px;
+ height: 44px;
+ margin-left: auto;
+ border: 1px solid rgba(255, 215, 0, 0.14);
+ border-radius: 8px;
+ background: rgba(255, 215, 0, 0.04);
+ color: var(--ifm-font-color-base);
+ font: 400 1.5rem/1 "DM Sans", sans-serif;
+ cursor: pointer;
+ }
+
+ .sidebarClose:focus-visible {
+ outline: 2px solid #ffd700;
+ outline-offset: 2px;
+ }
+}
+
@media (max-width: 900px) {
.layout {
grid-template-columns: 1fr;