Repository navigation
feat(nav): page registry and grouped sidebar (T-I1) - #440
Merged
Merged
Conversation
One registry (src/shared/pages/pageRegistry.ts) lists every page: id,
label, group, icon, lazy component and wrapper classes. The sidebar, the
page switch, the nav store's Page type and the agent all read it, so
adding a page is one entry.
- Sidebar sections Home, Create, Manage, System with separators; empty
groups are skipped.
- navigate(page, params?) opens a page on a target; openExtension is
navigate('models', { extension }). A plain navigate clears old params.
- The agent's navigate tool validates against the registry, and the page
list reaches the backend in the context instead of a fixed enum.
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The app's pages now live in one registry,
src/shared/pages/pageRegistry.ts. The sidebar, the page switch, the nav store'sPagetype and the agent all read it: adding a page is one entry, with no edit toSidebar.tsxorRouter.tsx.Closes #405
Registry
id,label,group,icon,load(lazy component) andwrapperClass..tsfile with icons as data ([tag, attrs]). That way the stores, the agent tools and the node tests (--experimental-strip-types, no JSX) can import it.Pageis derived from the registry.src/shared/router/routes.tsxis removed.Sidebar
Navigation
navigate(page, params?)opens a page on a target.openExtension(id)is nownavigate('models', { extension: id }).ModelsPagereadsparams.extension, then clears it.navigate(page)clears stale params.Agent
navigatetool validates the page against the registry.Pages:line, instead of a fixed enum inagent.py.Test plan
npm run test:node: 259 tests, 258 pass, 0 fail. New tests:pageRegistry.test.ts(registry, grouping,navigate/openExtension).python -m unittest tests.test_agent_client_tools: OK. The pre-push hook ran the full suite.npm run buildpasses, and each page is still its own chunk.