@@ -177,12 +177,16 @@ describe("pathForRoute", () => {
177177 it ( "returns correct path without base" , ( ) => {
178178 expect ( pathForRoute ( "chat" ) ) . toBe ( "/chat" ) ;
179179 expect ( pathForRoute ( "overview" ) ) . toBe ( "/overview" ) ;
180- expect ( pathForRoute ( "worktrees" ) ) . toBe ( "/worktrees" ) ;
180+ expect ( pathForRoute ( "worktrees" ) ) . toBe ( "/settings/worktrees" ) ;
181+ expect ( pathForRoute ( "config" ) ) . toBe ( "/settings/general" ) ;
182+ expect ( pathForRoute ( "appearance" ) ) . toBe ( "/settings/appearance" ) ;
183+ expect ( pathForRoute ( "logs" ) ) . toBe ( "/settings/logs" ) ;
181184 } ) ;
182185
183186 it ( "prepends base path" , ( ) => {
184187 expect ( pathForRoute ( "chat" , "/ui" ) ) . toBe ( "/ui/chat" ) ;
185188 expect ( pathForRoute ( "sessions" , "/apps/openclaw" ) ) . toBe ( "/apps/openclaw/sessions" ) ;
189+ expect ( pathForRoute ( "config" , "/ui" ) ) . toBe ( "/ui/settings/general" ) ;
186190 } ) ;
187191} ) ;
188192
@@ -192,9 +196,20 @@ describe("routeIdFromPath", () => {
192196 expect ( routeIdFromPath ( "/overview" ) ) . toBe ( "overview" ) ;
193197 expect ( routeIdFromPath ( "/activity" ) ) . toBe ( "activity" ) ;
194198 expect ( routeIdFromPath ( "/worktrees" ) ) . toBe ( "worktrees" ) ;
199+ expect ( routeIdFromPath ( "/settings/worktrees" ) ) . toBe ( "worktrees" ) ;
195200 expect ( routeIdFromPath ( "/sessions" ) ) . toBe ( "sessions" ) ;
196201 expect ( routeIdFromPath ( "/dreaming" ) ) . toBe ( "dreams" ) ;
197202 expect ( routeIdFromPath ( "/dreams" ) ) . toBe ( "dreams" ) ;
203+ expect ( routeIdFromPath ( "/settings/general" ) ) . toBe ( "config" ) ;
204+ expect ( routeIdFromPath ( "/settings/appearance" ) ) . toBe ( "appearance" ) ;
205+ expect ( routeIdFromPath ( "/settings/logs" ) ) . toBe ( "logs" ) ;
206+ } ) ;
207+
208+ it ( "keeps legacy top-level settings paths routed" , ( ) => {
209+ expect ( routeIdFromPath ( "/config" ) ) . toBe ( "config" ) ;
210+ expect ( routeIdFromPath ( "/appearance" ) ) . toBe ( "appearance" ) ;
211+ expect ( routeIdFromPath ( "/worktrees" ) ) . toBe ( "worktrees" ) ;
212+ expect ( routeIdFromPath ( "/logs" ) ) . toBe ( "logs" ) ;
198213 } ) ;
199214
200215 it ( "leaves root fallback to application startup" , ( ) => {
@@ -204,11 +219,14 @@ describe("routeIdFromPath", () => {
204219 it ( "handles base paths" , ( ) => {
205220 expect ( routeIdFromPath ( "/ui/chat" , "/ui" ) ) . toBe ( "chat" ) ;
206221 expect ( routeIdFromPath ( "/apps/openclaw/sessions" , "/apps/openclaw" ) ) . toBe ( "sessions" ) ;
222+ expect ( routeIdFromPath ( "/ui/settings/general" , "/ui" ) ) . toBe ( "config" ) ;
223+ expect ( routeIdFromPath ( "/ui/appearance" , "/ui" ) ) . toBe ( "appearance" ) ;
207224 } ) ;
208225
209226 it ( "rejects route-shaped paths outside the configured base path" , ( ) => {
210227 expect ( routeIdFromPath ( "/xx/chat" , "/ui" ) ) . toBeNull ( ) ;
211228 expect ( routeIdFromPath ( "/other/sessions" , "/apps/openclaw" ) ) . toBeNull ( ) ;
229+ expect ( routeIdFromPath ( "/xx/settings/general" , "/ui" ) ) . toBeNull ( ) ;
212230 } ) ;
213231
214232 it ( "returns null for unknown path" , ( ) => {
@@ -229,13 +247,18 @@ describe("inferBasePathFromPathname", () => {
229247 it ( "returns empty string for direct tab path" , ( ) => {
230248 expect ( inferBasePathFromPathname ( "/chat" ) ) . toBe ( "" ) ;
231249 expect ( inferBasePathFromPathname ( "/overview" ) ) . toBe ( "" ) ;
250+ expect ( inferBasePathFromPathname ( "/settings/general" ) ) . toBe ( "" ) ;
251+ expect ( inferBasePathFromPathname ( "/settings/appearance" ) ) . toBe ( "" ) ;
252+ expect ( inferBasePathFromPathname ( "/appearance" ) ) . toBe ( "" ) ;
232253 expect ( inferBasePathFromPathname ( "/dreaming" ) ) . toBe ( "" ) ;
233254 expect ( inferBasePathFromPathname ( "/dreams" ) ) . toBe ( "" ) ;
234255 } ) ;
235256
236257 it ( "infers base path from nested paths" , ( ) => {
237258 expect ( inferBasePathFromPathname ( "/ui/chat" ) ) . toBe ( "/ui" ) ;
238259 expect ( inferBasePathFromPathname ( "/apps/openclaw/sessions" ) ) . toBe ( "/apps/openclaw" ) ;
260+ expect ( inferBasePathFromPathname ( "/ui/settings/general" ) ) . toBe ( "/ui" ) ;
261+ expect ( inferBasePathFromPathname ( "/ui/appearance" ) ) . toBe ( "/ui" ) ;
239262 } ) ;
240263
241264 it ( "preserves mount roots without a route suffix" , ( ) => {
0 commit comments