diff --git a/ui/src/ui/app-render.helpers.ts b/ui/src/ui/app-render.helpers.ts index ad1d6c24a..a9dee71d6 100644 --- a/ui/src/ui/app-render.helpers.ts +++ b/ui/src/ui/app-render.helpers.ts @@ -1,8 +1,10 @@ import { html } from "lit"; +import { repeat } from "lit/directives/repeat.js"; import type { AppViewState } from "./app-view-state"; import { iconForTab, pathForTab, titleForTab, type Tab } from "./navigation"; import { loadChatHistory } from "./controllers/chat"; +import { syncUrlWithSessionKey } from "./app-settings"; import type { SessionsListResult } from "./types"; import type { ThemeMode } from "./theme"; import type { ThemeTransitionContext } from "./theme-transition"; @@ -64,10 +66,13 @@ export function renderChatControls(state: AppViewState) { sessionKey: next, lastActiveSessionKey: next, }); + syncUrlWithSessionKey(state, next, true); void loadChatHistory(state); }} > - ${sessionOptions.map( + ${repeat( + sessionOptions, + (entry) => entry.key, (entry) => html`