@@ -49,9 +49,11 @@ const docsUrl = computed(() => {
4949 return ` /api/registry/docs/${packageName .value }/v/${resolvedVersion .value } `
5050})
5151
52+ const shouldFetch = computed (() => !! docsUrl .value )
53+
5254const { data : docsData, status : docsStatus } = useLazyFetch <DocsResponse >(() => docsUrl .value ! , {
5355 watch: [docsUrl ],
54- immediate: computed (() => !! docsUrl . value ) .value ,
56+ immediate: shouldFetch .value ,
5557 default : () => ({
5658 package: packageName .value ,
5759 version: resolvedVersion .value ?? ' ' ,
@@ -78,9 +80,9 @@ const showEmptyState = computed(() => docsData.value?.status !== 'ok')
7880 </script >
7981
8082<template >
81- <div class =" min-h-screen" >
82- <!-- Sticky header - positioned below AppHeader (57px) -->
83- <header class =" sticky top-[57px] z-10 bg-bg/95 backdrop-blur border-b border-border" >
83+ <div class =" docs-page min-h-screen" >
84+ <!-- Sticky header - positioned below AppHeader -->
85+ <header class =" docs-header sticky z-10 bg-bg/95 backdrop-blur border-b border-border" >
8486 <div class =" px-4 sm:px-6 lg:px-8 py-4" >
8587 <div class =" flex items-center justify-between gap-4" >
8688 <div class =" flex items-center gap-3 min-w-0" >
@@ -110,7 +112,7 @@ const showEmptyState = computed(() => docsData.value?.status !== 'ok')
110112 v-if =" docsData?.toc && !showEmptyState"
111113 class =" hidden lg:block w-64 xl:w-72 shrink-0 border-r border-border"
112114 >
113- <div class =" sticky top-[114px] h-[calc(100vh-114px)] overflow-y-auto p-4" >
115+ <div class =" docs-sidebar sticky overflow-y-auto p-4" >
114116 <h2 class =" text-xs font-semibold text-fg-subtle uppercase tracking-wider mb-4" >
115117 Contents
116118 </h2 >
@@ -154,6 +156,22 @@ const showEmptyState = computed(() => docsData.value?.status !== 'ok')
154156</template >
155157
156158<style >
159+ /* Layout constants - must match AppHeader height */
160+ .docs-page {
161+ --app-header-height : 57px ;
162+ --docs-header-height : 57px ;
163+ --combined-header-height : calc (var (--app-header-height ) + var (--docs-header-height ));
164+ }
165+
166+ .docs-header {
167+ top : var (--app-header-height );
168+ }
169+
170+ .docs-sidebar {
171+ top : var (--combined-header-height );
172+ height : calc (100vh - var (--combined-header-height ));
173+ }
174+
157175/* Table of contents styles */
158176.toc-content ul {
159177 @apply space-y- 1;
@@ -188,8 +206,7 @@ const showEmptyState = computed(() => docsData.value?.status !== 'ok')
188206.docs-content .docs-section-title {
189207 @apply text-lg font-semibold text-fg mb- 8 pb- 3 pt- 4 border-b border-border ;
190208 @apply sticky bg-bg z- [2];
191- /* Stick below both headers: AppHeader (57px) + docs header (~57px) = 114px */
192- top : 114px ;
209+ top : var (--combined-header-height );
193210}
194211
195212/* Individual symbol articles */
0 commit comments