From f01bb5f99b30744e4f883221e6ffaef55420aaa1 Mon Sep 17 00:00:00 2001 From: hypercross Date: Fri, 14 Aug 2026 11:27:46 +0800 Subject: [PATCH] feat(web): rework mod inspector layout Fill the viewport with a fixed sidebar of highlightable type-filter icons over an independently scrolling tree, and let the viewer expand into a full-height scene. --- apps/web/src/App.tsx | 12 ++- apps/web/src/components/ObjectTree.tsx | 69 +++++++++------- apps/web/src/components/viewers.tsx | 11 ++- .../web/src/components/viewers/CardViewer.tsx | 5 +- .../components/viewers/CustomModelViewer.tsx | 5 +- .../web/src/components/viewers/DeckViewer.tsx | 19 ++++- apps/web/src/components/viewers/Scene.tsx | 10 ++- .../web/src/components/viewers/TileViewer.tsx | 5 +- .../src/components/viewers/TokenViewer.tsx | 5 +- apps/web/src/pages/ModPage.tsx | 82 +++++++------------ 10 files changed, 123 insertions(+), 100 deletions(-) diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 0b53aaa..b225c12 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -19,12 +19,17 @@ const SetupsPage = lazy(() => import('./pages/SetupsPage')); const SetupPage = lazy(() => import('./pages/SetupPage')); export default function App() { - const { pathname } = useLocation(); + const pathname = useLocation().pathname; const isModRoute = pathname.startsWith('/mod/'); + // The inspector view is full-bleed/viewport-height; the setup sub-route keeps the standard centered layout. + const isModView = /^\/mod\/[^/]+$/.test(pathname); return (
-
+ {/* For the mod route the layout is full-bleed and fills the viewport so + the sidebar can scroll independently and the viewer gets all the space. */} +
+
{isModRoute ? ( ) : ( @@ -43,7 +48,7 @@ export default function App() {
)}
-
+
} /> } /> @@ -65,6 +70,7 @@ export default function App() { } />
+
); } \ No newline at end of file diff --git a/apps/web/src/components/ObjectTree.tsx b/apps/web/src/components/ObjectTree.tsx index 407736e..10d009e 100644 --- a/apps/web/src/components/ObjectTree.tsx +++ b/apps/web/src/components/ObjectTree.tsx @@ -32,44 +32,51 @@ export default function ObjectTree({ nodes, selectedPath, onSelect }: Props) { const clearAll = () => setHighlighted(new Set()); return ( -
+
{types.length > 0 && ( -
- {types.map(({ name, count }) => { - const active = highlighted.has(name); - return ( - - ); - })} + + {count} + + + ); + })} +
{highlighted.size > 0 && ( - +
+ +
)}
)} -