Skip to content

Commit d185ca5

Browse files
skeptomaiclaude
andcommitted
docs: Document Issue #1 smart auto-scroll fix in ONGOING_TASKS.md
Added comprehensive documentation of the smart auto-scroll implementation that fixes long game introductions scrolling away. Includes: - Root cause analysis (forced scrolling vs conditional scrolling) - Solution details (isScrolledToBottom helper, smartScrollToBottom wrapper) - Implementation code snippets - Deployment verification (staging and production) - GitHub issue reference and closure confirmation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 6bb2327 commit d185ca5

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

ONGOING_TASKS.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,44 @@
6060
- **Commit**: `276b42d` - "fix: Admin button not appearing on initial login"
6161
- **Verification**: ✅ Admin and logout buttons appear immediately on initial login
6262

63+
**✅ Smart Auto-Scroll for Long Introductions - FIXED** (December 21, 2025) [Issue #1]:
64+
- **Status**: Fixed long game introductions scrolling away and becoming unrecoverable ✅
65+
- **GitHub Issue**: https://github.com/skeptomai/gruesome/issues/1
66+
- **Symptom**: Enchanter's long intro scrolls away, cannot be retrieved by scrolling up
67+
- **Root Cause**: Terminal output forced scroll to bottom on every output update
68+
- `gameOutput.scrollTop = gameOutput.scrollHeight` forced scrolling regardless of user position
69+
- Standard terminal emulators only auto-scroll when user is already at bottom
70+
- Prevented users from reading earlier content during long output sequences
71+
- **Solution**: Implemented smart auto-scroll with standard terminal emulator behavior
72+
- Added `isScrolledToBottom(element, threshold)` helper to detect user scroll position
73+
- Added `smartScrollToBottom(element)` wrapper for conditional scrolling
74+
- Only auto-scrolls when user is within 50px of bottom
75+
- Preserves scroll position if user has scrolled up to read earlier content
76+
- **Implementation Details**:
77+
```javascript
78+
function isScrolledToBottom(element, threshold = 50) {
79+
if (!element) return false;
80+
const scrollBottom = element.scrollHeight - element.scrollTop - element.clientHeight;
81+
return scrollBottom < threshold;
82+
}
83+
84+
function smartScrollToBottom(element) {
85+
if (!element) return;
86+
if (isScrolledToBottom(element)) {
87+
element.scrollTop = element.scrollHeight;
88+
}
89+
}
90+
```
91+
- **Files Modified**: `frontend/app.js` (runUntilInput, handleGameInput)
92+
- **Deployment**:
93+
- ✅ Tested on staging: https://staging.gruesome.skeptomai.com
94+
- ✅ Deployed to production: https://gruesome.skeptomai.com
95+
- ✅ Cache invalidation: Both staging and production CloudFront distributions
96+
- **Commits**:
97+
- `6bb2327` - "fix: Implement smart auto-scroll for long introductions (Issue #1)"
98+
- **GitHub Issue**: ✅ Closed with detailed explanation and verification
99+
- **Verification**: ✅ Enchanter intro readable, scroll position preserved during long output
100+
63101
**✅ Admin Panel Backend & DynamoDB Schema Compatibility - FIXED** (December 20, 2025):
64102
- **Status**: Complete admin Lambda backend implemented with schema compatibility fixes ✅
65103
- **Symptom**: Admin panel showed no games despite 7 games existing in DynamoDB

0 commit comments

Comments
 (0)