Repository navigation
Conversation
Earlier host versions kept one machine-wide project directory, so every project's private queries landed in one file and a record carries no project field. Claiming is explicit and recorded in a sidecar next to the legacy file, so another checkout is only offered what is still unclaimed.
Project and global settings used to share one file, so the surviving value's scope is unknowable. Detect any namespace file in the global settings dir, report it over two built-in RPCs, and record a dismissal marker per machine. The reference hub UI renders the notice in Settings > Advanced.
A checkout with no settings.json of its own seeds its initial dock layout
from <host.getLegacyStorageDir('project')>/settings.json, so a layout from the
old machine-wide directory survives the storage move. Writes still go to the
project file only. The fallback is temporary and is removed in a later
release.
|
@0froq is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "9887bacc066c08dedc3c26e5b25e6d43b3655087",
"result": {
"overallSummary": "Vite DevTools now gives `project` and `global` storage scopes separate directories, which leaves state written under the old shared layout stranded. This PR makes that old state reachable through a new optional host capability, `getLegacyStorageDir(scope)` (read via `resolveLegacyStorageDir`), and uses it in three places: Data Inspector offers an explicit claim/discard import for unattributed private queries, the settings layer shows a one-time notice that project and global settings are no longer merged, and the hub seeds its dock layout once from the legacy project file. All three fallbacks are read-only against the legacy data and degrade to no-op on a host that reports nothing.",
"groups": [
{
"key": "data-inspector-legacy-import",
"label": "Data Inspector legacy import",
"summary": "Adds an explicit import flow for Data Inspector's saved queries: records left by a pre-split install (one machine-wide file, no project attribution) are listed, and the user claims them into the open project or discards them, with the decision recorded in a sidecar claims file so other projects on the machine aren't offered the same records again.",
"category": "data",
"filePaths": [
"plugins/data-inspector/README.md",
"plugins/data-inspector/app/App.vue",
"plugins/data-inspector/app/components/SavedQueriesPanel.vue",
"plugins/data-inspector/app/composables/legacy-queries.ts",
"plugins/data-inspector/app/composables/rpc.ts",
"plugins/data-inspector/src/node/legacy-queries.ts",
"plugins/data-inspector/src/node/saved-queries.ts",
"plugins/data-inspector/src/node/engine/contract.ts",
"plugins/data-inspector/src/node/rpc/index.ts",
"plugins/data-inspector/src/node/rpc/functions/saved.ts"
],
"critical": true,
"fileNotes": [
{
"path": "plugins/data-inspector/src/node/legacy-queries.ts",
"text": "Core migration logic: reads the legacy queries.json read-only and keeps claim/discard state in a separate queries.claims.json so the legacy file is never rewritten and a record is offered to only one project.",
"critical": true
},
{
"path": "plugins/data-inspector/src/node/saved-queries.ts",
"text": "`importSavedQueries` deliberately bypasses `saveQuery`'s cross-scope move so an imported project-scope record can't overwrite a same-id workspace query."
}
]
},
{
"key": "settings-notice-backend",
"label": "Settings legacy-scope notice (backend)",
"summary": "Adds the optional, duck-typed `getLegacyStorageDir(scope)` host capability (`resolveLegacyStorageDir`) and, on top of it, a one-time notice reporting which settings namespaces still hold a file from before `project` and `global` scopes were split; dismissal is recorded once per machine via a marker file. Nothing is migrated since per-key last-write-wins makes the original scope unrecoverable.",
"category": "core",
"filePaths": [
"docs/content/1.guide/7.scoped-context.md",
"docs/content/6.errors/DF0087.md",
"docs/content/6.errors/index.md",
"docs/content/8.references/4.node-api.md",
"packages/devframe/src/node/context.ts",
"packages/devframe/src/node/diagnostics.ts",
"packages/devframe/src/node/index.ts",
"packages/devframe/src/node/legacy-storage.ts",
"packages/devframe/src/node/settings-legacy-notice.ts",
"packages/devframe/src/node/settings.ts",
"packages/devframe/src/node/rpc/settings-legacy-notice.ts"
],
"fileNotes": [
{
"path": "packages/devframe/src/node/legacy-storage.ts",
"text": "Shared infrastructure consumed by this group, the hub dock fallback, and the Data Inspector import: a throwing or non-string `getLegacyStorageDir` is treated as \"no legacy data\" rather than propagated, so a buggy host degrades silently."
},
{
"path": "packages/devframe/src/node/settings-legacy-notice.ts",
"text": "Detects legacy state by presence of any `*.json` file in the global settings dir, not by content, so it can't tell a genuinely new global setting from a leftover pre-split file — only a heuristic."
}
]
},
{
"key": "settings-notice-ui",
"label": "Settings notice UI & copy",
"summary": "Surfaces the one-time shared-scope settings notice in Settings > Advanced, with a dismiss action calling the new RPC, and adds the translated copy for every supported locale.",
"category": "ui",
"filePaths": [
"packages/hub-ui/src/client/components/views-builtin/SettingsAdvanced.vue",
"packages/hub-ui/src/client/i18n/locales/de.json",
"packages/hub-ui/src/client/i18n/locales/en.json",
"packages/hub-ui/src/client/i18n/locales/es.json",
"packages/hub-ui/src/client/i18n/locales/fr.json",
"packages/hub-ui/src/client/i18n/locales/ja.json",
"packages/hub-ui/src/client/i18n/locales/ko.json",
"packages/hub-ui/src/client/i18n/locales/pt-BR.json",
"packages/hub-ui/src/client/i18n/locales/ru.json",
"packages/hub-ui/src/client/i18n/locales/zh-CN.json",
"packages/hub-ui/src/client/i18n/locales/zh-TW.json"
],
"fileNotes": [
{
"path": "packages/hub-ui/src/client/components/views-builtin/SettingsAdvanced.vue",
"text": "Uses `rpc.callOptional`, so the card silently stays hidden against a server that doesn't register the new built-in RPCs."
}
]
},
{
"key": "hub-dock-fallback",
"label": "Hub dock settings fallback",
"summary": "Since the hub's dock `settings.json` has no global counterpart to fall back to, a checkout without its own settings file seeds the initial dock layout once from the legacy project-scope file; the fallback is explicitly marked temporary and only ever read, never rewritten.",
"category": "core",
"filePaths": [
"docs/content/1.guide/16.hub.md",
"docs/content/6.errors/DF8112.md",
"packages/hub/src/node/diagnostics.ts",
"packages/hub/src/node/host-docks.ts"
],
"fileNotes": [
{
"path": "packages/hub/src/node/host-docks.ts",
"text": "`readLegacyUserSettings` only applies when the project's own `settings.json` doesn't exist yet; an unreadable or corrupt legacy file falls back to defaults with a warning rather than failing init."
}
]
},
{
"key": "tests",
"label": "Tests, stories & snapshots",
"summary": "Test coverage for the three features above (legacy storage resolution, settings notice, dock fallback, saved-query import), plus a Storybook fixture/story for the import dialog and the generated type snapshots reflecting the new public APIs.",
"category": "tests",
"filePaths": [
"packages/devframe/src/node/__tests__/settings-legacy-notice.test.ts",
"packages/hub/src/node/__tests__/host-docks.test.ts",
"plugins/data-inspector/app/components/_fixtures.ts",
"plugins/data-inspector/app/components/SavedQueriesPanel.stories.ts",
"plugins/data-inspector/test/legacy-queries.test.ts",
"tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/engine.snapshot.d.ts",
"tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/node.snapshot.d.ts",
"tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts",
"tests/__snapshots__/tsnapi/devframe/node.snapshot.d.ts",
"tests/__snapshots__/tsnapi/devframe/node.snapshot.js"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-11-28T11:17:38.845Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
This branch has not been deployed
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.
Description
The Vite DevTools host resolved
projectandglobalto the same directory, so project-scope data was machine-wide, andworkspacedata lived undernode_moduleswhere version control never sees it. vitejs/devtools#646 gives each scope its own directory and addsgetLegacyStorageDir(scope), which reports where an earlier version kept that scope. This PR makes state written under the old layout reachable from the new one.workspace<ws>/node_modules/.vite/devtools<ws>/.vite/devtoolsproject~/.vite/devtools<ws>/node_modules/.vite-devtoolsglobal~/.vite/devtools~/.vite/devtoolsgetLegacyStorageDiris not part ofDevframeHost, so it is read duck-typed throughresolveLegacyStorageDirindevframe/node. Every change below degrades to nothing on a host that reports no legacy path.Data Inspector wrote private queries from every project on the machine into one file, and a record carries no project field, so the host cannot attribute them. The panel offers an explicit import instead: unclaimed records are listed, the selected ones are claimed into the open project, and claim or discard is recorded in
queries.claims.jsonnext to the legacy file, keyed by record id and claiming checkout. The oldqueries.jsonis read and never rewritten.Settings cannot be migrated. Both scopes wrote
settings/<ns>.jsonwith per-key last-write-wins, so a key was overwritten and the surviving scope is unknowable. The settings layer reports the namespaces that hold a global file and shows a once-per-machine notice that the scopes are separate now, recorded by a.shared-scope-noticemarker in the global settings directory.The hub's
settings.jsonhas no global counterpart, so a checkout without one seeds its initial dock layout once from the legacy file, and writes still go to the project file. The fallback is marked temporary in code and removed in a later release.Test
Import: no legacy path listed, unclaimed records newest first with the whole-file count, claiming into the current project with the claiming checkout recorded, a claimed record landing beside a same-id workspace query, discard writing nothing to the project store, only unclaimed records left for the next project, and unknown or already-claimed ids ignored.
Notice: which namespaces hold a global settings file, nothing reported before the machine wrote one, the dismissal marker silencing it afterwards, and a host without the capability reporting nothing.
Dock fallback: layout seeded from the legacy file, legacy file ignored once the checkout has its own
settings.json, and defaults kept when there is no legacy directory or the file cannot be read.Manually, with this branch and vitejs/devtools#646 linked in a scratch app, against a seeded
~/.vite/devtools:Claiming one record and discarding the other left the legacy file untouched and wrote the decisions beside it:
{ "claims": { "old-private-users": { "project": "/…/vitejs-devtools", "at": 1795860759308, "mode": "claim" }, "old-private-middlewares": { "project": "/…/vitejs-devtools", "at": 1795861203597, "mode": "discard" } } }Changing one dock category wrote the project file, carrying the layout seeded from
~/.vite/devtools/settings.json, which was left unchanged:{ "docksHidden": ["advanced:devframes:plugin:og"], "docksCategoriesHidden": ["framework"], "docksPinned": ["viteplus"], "docksCustomOrder": {}, "commandShortcuts": {} }Screenshots
Data Inspector panel with the "older versions saved private queries" notice above saved queries, including the migrated shared query.

The Import saved queries dialog with two records, one selected.

The saved-queries list after claiming, notice still reporting one unclaimed record.

The same list after discarding, notice gone.

Settings → Advanced with the "settings are now stored per project" notice.
