From dbb9f34b53140805db1a2f952ae6cede7125961c Mon Sep 17 00:00:00 2001 From: Sebastian Gieseler Date: Fri, 30 Oct 2026 16:22:31 +0100 Subject: [PATCH] feat(ui): the Skills page's groups fold away A click on a group's heading folds its skills away and shows them again; which groups are folded is remembered in this browser. While a filter is on, every group with a match shows, folded or not. Co-Authored-By: Claude Opus 5.5 --- ui/src/views/SkillsView.vue | 42 ++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/ui/src/views/SkillsView.vue b/ui/src/views/SkillsView.vue index 524e4bd3..58d117d3 100644 --- a/ui/src/views/SkillsView.vue +++ b/ui/src/views/SkillsView.vue @@ -11,6 +11,7 @@ import { computed, onMounted, ref } from 'vue'; import { api, paths } from '@/api'; import type { PoolSkillsState, SkillSetState, SkillState } from '@/api/types'; import { act } from '@/lib/actions'; +import { persist } from '@/lib/persist'; import { ago, useNow } from '@/lib/format'; import { counts, filtered, groupOf, groups, NO_FILTER, rows, setKey, STATUS_LABEL, type SkillFilter, type SkillRow, type SkillStatus } from '@/lib/skills'; import { useHub } from '@/stores/hub'; @@ -100,6 +101,21 @@ function expand(key: string) { else s.add(key); expanded.value = s; } +// A group folds away with a click on its heading; which ones are folded is +// remembered in this browser. While a filter is on, every group with a match +// shows, folded or not. +const COLLAPSED = 'skills.collapsed'; +const collapsed = ref>(new Set(persist.get(COLLAPSED) ?? [])); +const groupKey = (s: SkillSetState, g: string) => `${setKey(s)}#${g}`; +const isCollapsed = (s: SkillSetState, g: string) => !filterOn.value && collapsed.value.has(groupKey(s, g)); +function toggleGroup(s: SkillSetState, g: string) { + const c = new Set(collapsed.value); + const k = groupKey(s, g); + if (c.has(k)) c.delete(k); + else c.add(k); + collapsed.value = c; + persist.set(COLLAPSED, [...c]); +} /** A set's shown rows by group, in the groups' order, those without one last. */ function groupsOf(s: SkillSetState) { const mine = shown.value.filter((r) => r.set === s); @@ -266,8 +282,18 @@ const conflictOf = (k: SkillState) => state.value?.conflicts.find((c) => c.name
- {{ g.group || 'No group' }} - {{ g.rows.length }} +
-
    +
    • state.value?.conflicts.find((c) => c.name border-radius: 6px; background: var(--surface-hover); } +.group-toggle { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 0; + border: 0; + background: transparent; + color: inherit; + cursor: pointer; +} .group-name { font-size: 12px; font-weight: 600;