From 410f8b953c1ca52426069578e3228155c0604c94 Mon Sep 17 00:00:00 2001 From: Luca Rossi Date: Thu, 26 Feb 2026 09:46:18 +0100 Subject: [PATCH] fix: restore properties panel header height to match tab bar (52px) (#87) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The InspectorHeader was missing shrink-0, allowing flex compression to shrink it below the intended 52px. Also moved overflow-y-auto from the aside to the content div so the header stays pinned while content scrolls. Extracted refsMatchTargets() helper to reduce nesting depth (Code Health 8.92 → 9.5). Co-authored-by: Claude Opus 4.6 --- design/properties-panel-header.pen | 1 + src/components/Inspector.tsx | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 design/properties-panel-header.pen diff --git a/design/properties-panel-header.pen b/design/properties-panel-header.pen new file mode 100644 index 00000000..ebcc2d64 --- /dev/null +++ b/design/properties-panel-header.pen @@ -0,0 +1 @@ +{"children":[],"variables":{}} \ No newline at end of file diff --git a/src/components/Inspector.tsx b/src/components/Inspector.tsx index 1e549065..99ecf91d 100644 --- a/src/components/Inspector.tsx +++ b/src/components/Inspector.tsx @@ -46,6 +46,13 @@ function useBacklinks(entry: VaultEntry | null, entries: VaultEntry[], reference }, [entry, entries, referencedBy]) } +function refsMatchTargets(refs: string[], targets: Set): boolean { + return refs.some((ref) => { + const target = wikilinkTarget(ref) + return targets.has(target) || targets.has(target.split('/').pop() ?? '') + }) +} + function useReferencedBy(entry: VaultEntry | null, entries: VaultEntry[]): ReferencedByItem[] { return useMemo(() => { if (!entry) return [] @@ -58,15 +65,9 @@ function useReferencedBy(entry: VaultEntry | null, entries: VaultEntry[]): Refer for (const other of entries) { if (other.path === entry.path) continue - for (const [key, refs] of Object.entries(other.relationships)) { - if (key === 'Type') continue - for (const ref of refs) { - const target = wikilinkTarget(ref) - if (matchTargets.has(target) || matchTargets.has(target.split('/').pop() ?? '')) { - results.push({ entry: other, viaKey: key }) - break - } + if (key !== 'Type' && refsMatchTargets(refs, matchTargets)) { + results.push({ entry: other, viaKey: key }) } } } @@ -78,7 +79,7 @@ function useReferencedBy(entry: VaultEntry | null, entries: VaultEntry[]): Refer function InspectorHeader({ collapsed, onToggle }: { collapsed: boolean; onToggle: () => void }) { const { onMouseDown } = useDragRegion() return ( -
+
{collapsed ? (