@@ -17,12 +17,7 @@ import {
1717 OrchestrationSessionStatus ,
1818 DEFAULT_SERVER_SETTINGS ,
1919} from "@t3tools/contracts" ;
20- import {
21- scopedProjectKey ,
22- scopedThreadKey ,
23- scopeProjectRef ,
24- scopeThreadRef ,
25- } from "@t3tools/client-runtime" ;
20+ import { scopedThreadKey , scopeThreadRef } from "@t3tools/client-runtime" ;
2621import { RouterProvider , createMemoryHistory } from "@tanstack/react-router" ;
2722import { HttpResponse , http , ws } from "msw" ;
2823import { setupWorker } from "msw/browser" ;
@@ -52,6 +47,7 @@ import { __resetLocalApiForTests } from "../localApi";
5247import { AppAtomRegistryProvider } from "../rpc/atomRegistry" ;
5348import { getServerConfig } from "../rpc/serverState" ;
5449import { getRouter } from "../router" ;
50+ import { deriveLogicalProjectKeyFromSettings } from "../logicalProject" ;
5551import { selectBootstrapCompleteForActiveEnvironment , useStore } from "../store" ;
5652import { useTerminalStateStore } from "../terminalStateStore" ;
5753import { useUiStateStore } from "../uiStateStore" ;
@@ -78,7 +74,18 @@ const THREAD_REF = scopeThreadRef(LOCAL_ENVIRONMENT_ID, THREAD_ID);
7874const THREAD_KEY = scopedThreadKey ( THREAD_REF ) ;
7975const UUID_ROUTE_RE = / ^ \/ d r a f t \/ [ 0 - 9 a - f ] { 8 } - [ 0 - 9 a - f ] { 4 } - [ 0 - 9 a - f ] { 4 } - [ 0 - 9 a - f ] { 4 } - [ 0 - 9 a - f ] { 12 } $ / ;
8076const PROJECT_DRAFT_KEY = `${ LOCAL_ENVIRONMENT_ID } :${ PROJECT_ID } ` ;
81- const PROJECT_KEY = scopedProjectKey ( scopeProjectRef ( LOCAL_ENVIRONMENT_ID , PROJECT_ID ) ) ;
77+ const PROJECT_LOGICAL_KEY = deriveLogicalProjectKeyFromSettings (
78+ {
79+ environmentId : LOCAL_ENVIRONMENT_ID ,
80+ id : PROJECT_ID ,
81+ cwd : "/repo/project" ,
82+ repositoryIdentity : null ,
83+ } ,
84+ {
85+ sidebarProjectGroupingMode : DEFAULT_CLIENT_SETTINGS . sidebarProjectGroupingMode ,
86+ sidebarProjectGroupingOverrides : DEFAULT_CLIENT_SETTINGS . sidebarProjectGroupingOverrides ,
87+ } ,
88+ ) ;
8289const NOW_ISO = "2026-03-04T12:00:00.000Z" ;
8390const BASE_TIME_MS = Date . parse ( NOW_ISO ) ;
8491const ATTACHMENT_SVG = "<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'></svg>" ;
@@ -1638,12 +1645,12 @@ describe("ChatView timeline estimator parity (full app)", () => {
16381645 customWsRpcResolver = null ;
16391646 document . body . innerHTML = "" ;
16401647 } ) ;
1641- it ( "re-expands the bootstrap project using its scoped key" , async ( ) => {
1648+ it ( "re-expands the bootstrap project using its logical key" , async ( ) => {
16421649 useUiStateStore . setState ( {
16431650 projectExpandedById : {
1644- [ PROJECT_KEY ] : false ,
1651+ [ PROJECT_LOGICAL_KEY ] : false ,
16451652 } ,
1646- projectOrder : [ PROJECT_KEY ] ,
1653+ projectOrder : [ PROJECT_LOGICAL_KEY ] ,
16471654 threadLastVisitedAtById : { } ,
16481655 } ) ;
16491656
@@ -1658,7 +1665,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
16581665 try {
16591666 await vi . waitFor (
16601667 ( ) => {
1661- expect ( useUiStateStore . getState ( ) . projectExpandedById [ PROJECT_KEY ] ) . toBe ( true ) ;
1668+ expect ( useUiStateStore . getState ( ) . projectExpandedById [ PROJECT_LOGICAL_KEY ] ) . toBe ( true ) ;
16621669 } ,
16631670 { timeout : 8_000 , interval : 16 } ,
16641671 ) ;
0 commit comments