feat(story-summary): default hide summarized to enabled

This commit is contained in:
RT15548
2026-02-24 13:53:18 +08:00
parent 4ee528621f
commit a86aa999c3
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 };