fix(webui): show renamed topic titles in @ mentions (#6413)

* fix(webui): use renamed titles for session mentions

Pass persisted title overrides to each thread and resolve mention display titles through the same helper as the sidebar. Keep canonical session identities unchanged.

Fixes NAN-342

* fix(webui): refresh bound session mention titles without truncating previews

* fix(webui): persist topic renames as session titles with legacy import

* fix(webui): keep session rename broadcast typed and identity-owned

* fix(webui): limit topic-title fix to composer mentions

Withdraw backend title storage, rename protocol/capability, import migration and global-title changes. Keep the existing sidebar title overrides and only project those names into the composer mention catalog.

Retain focused single/split-pane rename, bound-label, send/reload and full-preview filtering coverage.

* fix(webui): preserve bound mention and draft behavior

Keep the fix limited to candidate titles. Leave existing bound references untouched and exercise rename, candidate filtering, selection, send and reload in the regression test.
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-24 03:00:22 +08:00
1 parent 6d4add200b
commit 3c022ada6a
3 files changed
+92 -2

No files matched your search

+9 -2
View File
@@ -212,9 +212,12 @@ function maxFilePreviewWidth(containerWidth: number): number {
);
}
const EMPTY_TITLE_OVERRIDES: Record<string, string> = {};
interface ThreadShellProps {
session: ChatSummary | null;
sessions?: ChatSummary[];
titleOverrides?: Record<string, string>;
title: string;
temporary?: boolean;
temporaryChatIds?: readonly string[];
@@ -440,6 +443,7 @@ function useInstalledSettingItems<Payload, Item>({
export function ThreadShell({
session,
sessions = [],
titleOverrides = EMPTY_TITLE_OVERRIDES,
title,
temporary = false,
temporaryChatIds = [],
@@ -486,8 +490,11 @@ export function ThreadShell({
const historyKey = temporary ? null : session?.key ?? null;
const previewSessionKey = session?.key ?? null;
const mentionSessions = useMemo(
() => sessions.filter((candidate) => candidate.key !== historyKey),
[historyKey, sessions],
() => sessions.filter((candidate) => candidate.key !== historyKey).map((candidate) => {
const renamedTitle = titleOverrides[candidate.key]?.trim();
return renamedTitle ? { ...candidate, title: renamedTitle } : candidate;
}),
[historyKey, sessions, titleOverrides],
);
const { client, getToken, ingressLimits, modelName, token, webuiCapabilities } = useClient();
const favoriteWorkspaceProject = useCallback(