Fix collapse, group skew, empty tables and the tab strip scrollbar

This commit is contained in:
2026-08-31 15:01:24 -04:00
parent 2fce339735
commit b21503e250
7 changed files with 70 additions and 16 deletions

View File

@@ -191,18 +191,30 @@ const props = defineProps({
const panels = ref([])
// The server resolves every panel's group before we see it, so an unknown or
// absent one is already 'details' by the time it arrives here. Filtering can
// therefore be a plain equality check and nothing falls through the gap.
// The groups this build renders. A panel in any other group would be fetched,
// held, and shown on no tab at all.
//
// The server normalises group before we see it, so a version-matched pair
// never lands here. A MISMATCHED pair does: deploy a new frontend against a
// server still serving an older vocabulary and every panel in a group that
// has since been renamed or removed silently disappears. That is what happened
// to tracked services when it moved out of 'actions' - the backend still said
// 'actions', this build had no such tab, and the card was simply gone with
// nothing logged. Fall back the same way the server does rather than drop it.
const RENDERED_GROUPS = ['details', 'software', 'metrics', 'activity']
function groupOf(panel) {
return RENDERED_GROUPS.includes(panel.group) ? panel.group : 'details'
}
const groupedPanels = computed(() =>
props.group ? panels.value.filter((p) => p.group === props.group) : panels.value
props.group ? panels.value.filter((p) => groupOf(p) === props.group) : panels.value
)
// Which groups actually have a panel with data, so a parent can hide a tab
// rather than offering an empty one.
const populatedGroups = computed(() => {
const seen = new Set()
panels.value.forEach((p) => { if (panelVisible(p)) seen.add(p.group || 'details') })
panels.value.forEach((p) => { if (panelVisible(p)) seen.add(groupOf(p)) })
return seen
})