Visitar URL original
fix(client): list each route once on the Pages tab by NgoQuocViet2001 · Pull Request #1181 · vuejs/devtools · GitHub
Skip to content

fix(client): list each route once on the Pages tab - #1181

Merged
webfansplz merged 1 commit into
vuejs:mainfrom
NgoQuocViet2001:fix-pages-nested-routes
Nov 3, 2026
Merged

webfansplz merged 1 commit into
vuejs:mainfrom
NgoQuocViet2001:fix-pages-nested-routes

Conversation

@NgoQuocViet2001

Copy link
Copy Markdown
Contributor

router.getRoutes() already returns nested routes as their own records with full paths, but the Pages tab also walked each record's children, which keep the relative paths from the route config. With /users/:id and children profile and posts, the tab says "6 routes registered" while Overview counts 4, it lists extra profile and posts rows, and on /users/1/profile three rows are marked active. The extra rows also navigate to the wrong place: from /users/1, clicking posts pushes a relative path that resolves to /users/posts and matches /users/:id with id: 'posts'.

This drops the recursion in pages.vue and renders the snapshot routes as they are, still sorted by path. The kit snapshot is left as is, so children is still there for the agent router tool.

Ran:

  • pnpm vitest run tests/integration/client/pages-routes.test.ts: fails on main (6 rows, 3 active), passes with the change
  • pnpm test: 71 files, 433 tests passed
  • pnpm typecheck, plus vp lint and vp fmt --check on the changed files: clean
  • pnpm --filter @vue/devtools-client build: ok

Checked: the test fixture matches what createRouterSnapshot returns for a real vue-router 5.4.0 router with the same routes.

@netlify

netlify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit d7ab5b8
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/6ae38d8af16dd3d98ed00911

@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vue/devtools-agent@1181
npm i https://pkg.pr.new/@vue/devtools-api@1181
npm i https://pkg.pr.new/@vue/devtools-kit@1181
npm i https://pkg.pr.new/vite-plugin-vue-devtools@1181

commit: d7ab5b8

@webfansplz
webfansplz merged commit 7fb7aca into vuejs:main Nov 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants