Add chapter checkpoint feature

- New feature: bookmark messages to exclude earlier history from context
- Saves tokens by marking chapter start points in long chats
- Uses SillyTavern's /hide and /unhide slash commands
- Persists checkpoint across page reloads and generation events
- UI: bookmark icon in message menus with visual indicators
- Debounced restore function prevents concurrent executions
- Pre-generation checkpoint application ensures messages stay hidden
- Clean production-ready code with proper error handling
This commit is contained in:
Spicy_Marinara
2025-12-18 01:59:14 +01:00
parent 8645bbde98
commit 3ded104218
13 changed files with 870 additions and 236 deletions
+51
View File
@@ -6637,3 +6637,54 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
font-size: clamp(14px, 3vw, 18px) !important;
}
}
/* ============================================
CHAPTER CHECKPOINT STYLES
============================================ */
/* Checkpoint indicator in messages */
.rpg-checkpoint-indicator {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
margin-bottom: 12px;
background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(74, 158, 255, 0.05) 100%);
border-left: 4px solid #4a9eff;
border-radius: 4px;
font-size: 13px;
font-weight: 600;
color: #4a9eff;
animation: checkpoint-fade-in 0.3s ease-out;
}
.rpg-checkpoint-indicator i {
font-size: 16px;
}
@keyframes checkpoint-fade-in {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
/* Optional: Add a subtle glow effect for checkpoint messages */
.mes:has(.rpg-checkpoint-indicator) {
position: relative;
}
.mes:has(.rpg-checkpoint-indicator)::before {
content: '';
position: absolute;
left: -4px;
top: 0;
bottom: 0;
width: 3px;
background: linear-gradient(180deg, #4a9eff 0%, transparent 100%);
opacity: 0.5;
}