fix(routing): basename env URLs and defer writes during node hydration (#1598)

* fix(routing): basename env URLs and defer writes during node hydration

Encode only env file basenames in ?env= and omit the default file.

Resolve legacy absolute-path bookmarks on load.

Block history writes until the active node matches a cold-loaded remote deep link.

* fix(routing): restore env deep links after stack load hydrates file list

Defer env selection until envFiles is populated after loadFileForRoute.

Apply default env when the URL omits ?env= (Back/popstate).

Document env URL rules and legacy basename resolution in deep-links.mdx.
This commit is contained in:
Anso
2026-07-08 21:02:13 -04:00
committed by GitHub
parent ad5e3f38c8
commit 1de9f5e4b2
8 changed files with 276 additions and 21 deletions
@@ -9,6 +9,7 @@ import type { OverlayState } from './useOverlayState';
import type { Node } from '@/context/NodeContext';
import type { RunWithLogParams } from '@/context/DeployFeedbackContext';
import { parsePath } from '@/lib/router/senchoRoute';
import { resolveEnvFilePath } from '@/lib/router/envRoute';
import type { EditorTab } from '@/lib/router/routeTypes';
import type { StackAction, RecoverableAction, FailureClassification } from '../EditorView';
import type { NotificationItem } from '../../dashboard/types';
@@ -1249,9 +1250,11 @@ export function useStackActions(options: UseStackActionsOptions) {
parsed.editorTab === 'env'
&& editorState.activeTab === 'env'
&& parsed.envFile
&& parsed.envFile !== editorState.selectedEnvFile
) {
return isEnvDirty();
const resolved = resolveEnvFilePath(parsed.envFile, editorState.envFiles);
if (resolved && resolved !== editorState.selectedEnvFile) {
return isEnvDirty();
}
}
return false;
};