From 4c2a403bc4d573e4ffb6df8fd88bb3455437fc3b Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 18 Jun 2026 18:01:16 +0800 Subject: [PATCH] fix(docs): restructure layout to properly center empty state relative to page --- web/default/src/features/docs/index.tsx | 253 ++++++++++++++---------- 1 file changed, 150 insertions(+), 103 deletions(-) diff --git a/web/default/src/features/docs/index.tsx b/web/default/src/features/docs/index.tsx index 5daf25aa3..b68d61849 100644 --- a/web/default/src/features/docs/index.tsx +++ b/web/default/src/features/docs/index.tsx @@ -312,59 +312,121 @@ export function Docs() { )} - {/* Three-column layout with left sidebar always visible */} -
- {/* Left sidebar - always visible */} - - {/* Center content */} -
- {!selectedDoc || docLoading ? ( - docLoading ? ( + {/* Centered empty state */} +
+
+ +
+

+ {t('Select a document to start reading')} +

+
+
+ )} + + {/* Three-column layout - only when document is selected */} + {selectedDoc && ( +
+ {/* Left sidebar */} + + + {/* Center content */} +
+ {docLoading ? (
@@ -372,60 +434,45 @@ export function Docs() {
) : ( - /* Empty state - centered relative to entire page container */ - /* Offset by half of sidebar width to align with page title */ -
-
-
- + <> +
+ + {selectedDoc?.content ?? ''} + +
+ + {/* Prev/Next navigation */} + {(prevDoc || nextDoc) && ( +
+ {prevDoc ? ( + + ) : ( +
+ )} + {nextDoc ? ( + + ) : ( +
+ )}
-

- {t('Select a document to start reading')} -

-
-
- ) - ) : ( - <> -
- - {selectedDoc?.content ?? ''} - -
+ )} + + )} +
- {/* Prev/Next navigation */} - {(prevDoc || nextDoc) && ( -
- {prevDoc ? ( - - ) : ( -
- )} - {nextDoc ? ( - - ) : ( -
- )} -
- )} - - )} - - - {/* Right TOC - only visible when document is selected */} - {selectedDoc && ( + {/* Right TOC */} - )} -
+
+ )}