feat(story-summary): globalize hide settings and stabilize recent L0 recall

This commit is contained in:
2026-02-24 10:21:00 +08:00
parent 6bb3cf2231
commit e7654355bb
6 changed files with 133 additions and 36 deletions

View File

@@ -48,13 +48,15 @@ export function saveSummaryStore() {
export function getKeepVisibleCount() {
const store = getSummaryStore();
return store?.keepVisibleCount ?? 3;
return store?.keepVisibleCount ?? 6;
}
export function calcHideRange(boundary) {
export function calcHideRange(boundary, keepCountOverride = null) {
if (boundary == null || boundary < 0) return null;
const keepCount = getKeepVisibleCount();
const keepCount = Number.isFinite(keepCountOverride)
? Math.max(0, Math.min(50, Number(keepCountOverride)))
: getKeepVisibleCount();
const hideEnd = boundary - keepCount;
if (hideEnd < 0) return null;
return { start: 0, end: hideEnd };