Mark the session on screen as Current in the session lists

- The conversation page tells the rail and the sessions modal which
  session it shows (announceShownSession, useShownSession); they reload,
  so a session reopened by ?session_id= shows at once.
- Only that session is Current and greyed out (the active one without
  ?session_id=); the active row then leads back to it.
- The rail lists the session on screen even when it's older than its
  latest sessions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-26 05:56:13 +01:00
co-authored by Claude Opus 5.5
parent cc109bc361
commit 657a76d868
10 changed files with 153 additions and 31 deletions
@@ -40,6 +40,7 @@ import mergeLoadedHistory from "../(utils)/merge-loaded-history";
import LoadingLine from "@/src/components/general/loading-line";
import SessionMovedBar from "../(partials)/session-moved-bar";
import syncSessionQuery from "../(utils)/sync-session-query";
import announceShownSession from "@/src/functions/frontend/announce-shown-session";
/**
* The conversation column: header, bottom-anchored thread, composer, the
@@ -172,6 +173,11 @@ export default function Conversation() {
setSessionId(loaded_session_id);
setMovedToSessionId(history.moved_to_session_id || null);
syncSessionQuery({ session: history.session });
announceShownSession({
bot_id: Number(bot?.id) || 0,
workspace_id,
session: history.session,
});
setMessages((prev) => mergeLoadedHistory({ shown: prev, history }));
older.reset({
session_id: loaded_session_id,