Files
openclaw/test/vitest/vitest.ui-isolated-paths.mjs
Peter Steinberger a57d9b5060 fix(ui): never restore a stored draft over typed new-session composer text (#125884)
* fix(ui): never restore a stored draft over typed new-session composer text

After a reload the new-session composer renders before the gateway
recovery scope arrives; selectRoute then zeroes the draft revision, so
text typed in that window lost to the stored draft's higher revision and
the async restore overwrote (or, interleaved with input, appended to)
what the user had typed. Seen on PR #125690 CI (checks-ui-e2e 5/12, run
32122284238) as a doubled composer value.

NewSessionDraftPersistence now records a pristine baseline at each
programmatic content replacement (page reset, navigation handoff,
restore apply) and restores only when no user mutation happened past it;
otherwise the typed text wins and persists above the stored revision,
including minting a revision for text typed before route activation so
that draft still lands. The chat composer sibling is unaffected: its
revision lineage persists synchronously to localStorage.

* test(ui): run draft-persistence regression in the isolated ui lane

The regression test mocks the statically imported
durable-composer-persistence helper (the store runtime is only
dynamically imported, so under the shared isolate:false module graph its
mock alone is packing-dependent). Isolating the file makes the mocks
deterministic and keeps the shared-lane file set unchanged so sibling
packing does not shift.
2026-08-18 13:23:31 -07:00

42 lines
2.0 KiB
JavaScript

// The shared UI runner reuses its module graph across fresh jsdom registries.
// Tests in this list depend on module singletons or custom-element registration
// matching the current registry, so they need a fresh graph in the isolated lane.
export const uiIsolatedTestFiles = [
"ui/src/app/app-host.server-prefs.test.ts",
"ui/src/app/bootstrap.test.ts",
"ui/src/app/router-outlet.test.ts",
"ui/src/components/markdown-tables.test.ts",
"ui/src/components/resizable-divider.test.ts",
"ui/src/components/sidebar-update-card.test.ts",
"ui/src/components/viewer-facepile.test.ts",
"ui/src/pages/agents/memory/memory-panel.test.ts",
"ui/src/pages/chat/chat-page-attachment-handoff.test.ts",
"ui/src/pages/chat/chat-pane-attachment-handoff.test.ts",
"ui/src/pages/chat/chat-pane-board.test.ts",
"ui/src/pages/chat/chat-pane-catalog.test.ts",
"ui/src/pages/chat/chat-pane-history.test.ts",
"ui/src/pages/chat/chat-pane-identity.test.ts",
"ui/src/pages/chat/chat-pane-lifecycle.test.ts",
"ui/src/pages/chat/chat-pane-pull-requests.test.ts",
"ui/src/pages/chat/chat-pane-retained-presentation.test.ts",
"ui/src/pages/chat/chat-pane.message-cut.test.ts",
"ui/src/pages/chat/chat-pane.read-marker.test.ts",
"ui/src/pages/chat/chat-pane.session-discussion.test.ts",
"ui/src/pages/chat/chat-pane.test.ts",
"ui/src/pages/chat/components/chat-transcript-controller.test.ts",
"ui/src/pages/chat/components/chat-transcript-invalidation.test.ts",
"ui/src/pages/chat/components/chat-transcript-render.test.ts",
"ui/src/pages/config/config-page.custom-theme.test.ts",
"ui/src/pages/config/memory-mutation-owner.test.ts",
"ui/src/pages/config/memory-page.test.ts",
"ui/src/pages/new-session/draft-persistence.test.ts",
"ui/src/pages/sessions/sessions-page.archived.test.ts",
"ui/src/pages/workboard/view.test.ts",
];
const uiIsolatedTestFileSet = new Set(uiIsolatedTestFiles);
export function isUiIsolatedTestFile(value) {
return uiIsolatedTestFileSet.has(value.replaceAll("\\", "/"));
}