ENH: Restucture menu#477
Conversation
|
Update from second commit : Changed Changed |
There was a problem hiding this comment.
Make RMS and Mappings work the same way
Small thing: RMS is set up as a nested route with a parent, but Mappings isn't, its pages are just floating at the top level. Would be nice to make them match. If rms.tsx becomes a simple wrapper (container + <Outlet/>) and we add a matching mappings.tsx, both groups behave the same and /project/mappings gets a real landing page like RMS does. Like this in routes/project/mappings.tsx:
import { createFileRoute, Outlet } from "@tanstack/react-router";
import { PageContainerNotWidthConstrained } from "#styles/common";
export const Route = createFileRoute("/project/mappings")({
component: RouteComponent,
});
function RouteComponent() {
return (
<PageContainerNotWidthConstrained>
<Outlet />
</PageContainerNotWidthConstrained>
);
}routes/project/rms.tsx should be edited to be similar like this.
Simpler redirect
For sending /project/rms to /project/rms/overview, instead of checking the pathname in the parent, we could just add a tiny index.tsx in routes/project/mappings that does <Navigate to="…/overview" replace />, same thing you already used in stratigraphy.tsx. It's cleaner and won't break if there's a trailing slash. This is similar with how this codebase is structured now. Example for routes/project/mappings/index.tsx
import { createFileRoute, Navigate } from "@tanstack/react-router";
export const Route = createFileRoute("/project/mappings/")({
component: () => <Navigate to="/project/mappings/overview" replace />,
});then it should be similar for routes/project/rms/index.tsx
Headers repeat the section name
I know we discussed about this, but I think it's cleaner to not repeat the "RMS" and "Mappings" in the header because the sidebar already tells you which section you're in. Could we just have each page say "Overview", "Stratigraphy", etc.?
Redundant stratigraphy headings on the RMS Stratigraphy page
The Stratigraphy component has its own heading, so now that it's on its own page you get the title twice. Since it used to sit inside RMS Overview, we can just drop the heading inside the component and keep the page one.
Split the RMS checklist task
"Set RMS project and stratigraphy" only links to Overview, but stratigraphy has its own page now. Might be clearer to make it two tasks: "Set RMS project" (Overview) and "Set RMS stratigraphy" (Stratigraphy), and each one should redirect you to the correct page.
Empty pages looks broken
The placeholder pages say "No … content available yet", which kind of looks broken. Could we switch them to a "coming soon" message so it's obviously on purpose?
Add comments on the EDS Accordion hacks
We should add comments on the NestedAccordion styles (why we remove the borders and indent) and the blankIcon (EDS requires you to pass an icon, and a blank one keeps the labels lined up).
9e1b4d6 to
47524f1
Compare
47524f1 to
7f1f051
Compare
GibranAlfa
left a comment
There was a problem hiding this comment.
very nice restructuring!
|
@joargr should probably also review this when he is back as he had some thoughts on how he wanted this, but he can do that in hindsight when he is back |




Resolves #467
Restructured the
Projectsidebar navigation soRMSandMappingsare grouped underProject, each withOverview,Stratigraphy, andWellboressubpages.Added nested routes for:
/project/rms/overview/project/rms/stratigraphy/project/rms/wellbores/project/mappings/overview/project/mappings/stratigraphy/project/mappings/wellboresMoved the existing RMS stratigraphy block from the RMS overview page to the new RMS Stratigraphy page.
Moved the existing Project Stratigraphy page behavior to the new Mappings Stratigraphy route.
Added placeholder pages for RMS Overview, RMS Wellbores, Mappings Overview, and Mappings Wellbores where future content will be added.
Kept old route entry points working by redirecting:
-
/project/rms to /project/rms/overview/project/stratigraphy to /project/mappings/stratigraphyUpdated task-list links to point to the new route structure.
Updated/generated the TanStack Router route tree.
Adjusted the sidebar styling so RMS and Mappings appear as nested groups inside Project rather than separate top-level sidebar sections.
Checklist
--cov=src/ --cov-report term-missing)