Hide session lineage metadata in compact sidebar

This commit is contained in:
Frank Song
2026-05-14 10:12:02 +08:00
parent d8798ab355
commit 996d4f9a8c
5 changed files with 16 additions and 8 deletions

View File

@@ -4,6 +4,8 @@
### Fixed
- **PR #2219** by @franksong2702 (refs #2218) — Compact sidebar density no longer shows compressed-session prior-turn lineage badges or expandable lineage segment rows. The sidebar still collapses compressed continuations to the latest tip, but the advanced lineage metadata now appears only in Detailed density so the default session list stays focused on ordinary session switching.
- **PR #2210** by @Jordan-SkyLF — MCP Tools list in Settings → System no longer renders an unbounded inventory that makes the settings panel scroll-trapping. Added a toolbar (result-count summary, page-size 5/10/20/50/all, search input), bounded scroll area with consistent height, paginated rendering, and focused regression coverage for the large-inventory case. Existing WebUI-only/runtime-only contract preserved (no MCP server probing, no agent-side changes). Visual before/after evidence shipped under `docs/pr-media/2210/`.
- **PR #2213** by @franksong2702 (fixes #2152) — Literal `<think>`/`</think>` discussions in normal assistant prose are no longer stripped from saved messages and re-renders. The old server cleanup and stored-message render regexes stripped the first closed thinking-looking block anywhere in the content. PR aligns saved/static paths with the existing streaming rule: provider reasoning wrappers (`<think>...</think>`, MiniMax `<|channel>thought...<channel|>`, Gemma 4 `<|turn|>thinking...<turn|>`) are stripped only when they lead the response (i.e. the wrapper is the first non-whitespace content).

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -2875,12 +2875,14 @@ function renderSessionListFromCache(){
titleRow.appendChild(dot);
}
}
const density=(window._sidebarDensity==='detailed'?'detailed':'compact');
const showLineageMetadata=density==='detailed';
const lineageKey=_sidebarLineageKeyForRow(s);
const segmentCount=_sessionSegmentCount(s);
const lineageSegments=_lineageSegmentsForRender(s,lineageKey);
const needsLineageReport=_lineageReportNeedsFetch(s,lineageKey,segmentCount);
const lineageReportKey=_lineageReportCacheKey(s,lineageKey);
const canExpandLineageSegments=Boolean(lineageKey&&segmentCount>1&&(lineageSegments.length>0||needsLineageReport||_lineageReportInflight.has(lineageReportKey)));
const segmentCount=showLineageMetadata?_sessionSegmentCount(s):0;
const lineageSegments=showLineageMetadata?_lineageSegmentsForRender(s,lineageKey):[];
const needsLineageReport=showLineageMetadata?_lineageReportNeedsFetch(s,lineageKey,segmentCount):false;
const lineageReportKey=showLineageMetadata?_lineageReportCacheKey(s,lineageKey):null;
const canExpandLineageSegments=showLineageMetadata&&Boolean(lineageKey&&segmentCount>1&&(lineageSegments.length>0||needsLineageReport||_lineageReportInflight.has(lineageReportKey)));
const lineageSegmentsExpanded=canExpandLineageSegments&&_expandedLineageKeys.has(lineageKey);
if(segmentCount>0){
const segmentCountEl=document.createElement('span');
@@ -2929,7 +2931,6 @@ function renderSessionListFromCache(){
}
titleRow.appendChild(ts);
sessionText.appendChild(titleRow);
const density=(window._sidebarDensity==='detailed'?'detailed':'compact');
if(density==='detailed'){
const metaBits=[];
const msgCount=typeof s.message_count==='number'?s.message_count:0;

View File

@@ -324,11 +324,16 @@ console.log(JSON.stringify(cases));
assert json.loads(_run_node(source)) == [3, 25, 3, 0, 0]
def test_sidebar_lineage_segment_badge_is_localized():
def test_sidebar_lineage_segment_badge_is_detailed_density_only_and_localized():
js = SESSIONS_JS_PATH.read_text(encoding="utf-8")
css = (REPO_ROOT / "static" / "style.css").read_text(encoding="utf-8")
assert "session-lineage-count" in js
assert "const segmentCount=_sessionSegmentCount(s);" in js
assert "const density=(window._sidebarDensity==='detailed'?'detailed':'compact');" in js
assert "const showLineageMetadata=density==='detailed';" in js
assert "const segmentCount=showLineageMetadata?_sessionSegmentCount(s):0;" in js
assert "const lineageSegments=showLineageMetadata?_lineageSegmentsForRender(s,lineageKey):[];" in js
assert "const needsLineageReport=showLineageMetadata?_lineageReportNeedsFetch(s,lineageKey,segmentCount):false;" in js
assert "const canExpandLineageSegments=showLineageMetadata&&Boolean(" in js
assert "t('session_meta_segments', segmentCount)" in js
assert "titleRow.appendChild(segmentCountEl);" in js
assert ".session-lineage-count{" in css