Skip to content

Commit d953f04

Browse files
skeptomaiclaude
andcommitted
fix: Keep status line sticky at top while game content scrolls
- Changed status line from position: relative to position: sticky - Added top: 0 to pin at top of CRT container - Added z-index: 10 to stay above scrolling content - Removed redundant .crt-container .status-line rule - Fixes issue where status line would scroll away as game continues Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 276b42d commit d953f04

File tree

2 files changed

+60
-8
lines changed

2 files changed

+60
-8
lines changed

ONGOING_TASKS.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,65 @@
11
# ONGOING TASKS - PROJECT STATUS
22

3-
## 🎯 **CURRENT STATE** (December 20, 2025)
3+
## 🎯 **CURRENT STATE** (December 21, 2025)
44

5-
**Latest Session**: Admin Panel Backend Implementation - **COMPLETE**
5+
**Latest Session**: Status Line & Admin Button Fixes - **COMPLETE**
66

77
### **Recently Fixed Issues**
88

9+
**✅ Status Line Implementation - COMPLETE** (December 21, 2025):
10+
- **Status**: Classic Zork-style status line fully implemented and deployed ✅
11+
- **Feature**: Added header showing location (left), score/moves (right)
12+
- **Implementation Details**:
13+
1. **Backend Already Complete**: WasmDisplay's show_status() sends StatusUpdate messages
14+
2. **Frontend Display Added** (~40 minutes work):
15+
- HTML structure: Status line div with location and score/moves spans
16+
- JavaScript: Read status fields from StepResult, update DOM on each step
17+
- CSS: Inverse video styling using CSS variables for theme support
18+
3. **Styling Iterations**:
19+
- **First Issue**: Status line missing CRT effects and theme styling
20+
- **Fix**: Wrapped status line and game output in CRT container
21+
- **Second Issue**: CRT effects worked but colors/fonts didn't match theme
22+
- **Root Cause**: Theme classes applied to gameOutput, status line is sibling
23+
- **Fix**: Apply theme/font classes to CRT container so both children inherit
24+
4. **Theme Integration**:
25+
- Uses CSS variables: --terminal-fg, --terminal-bg, --font-terminal
26+
- Inverse video: background and foreground colors swapped
27+
- Border bottom separating status line from game output
28+
- Responsive layout with flex display
29+
- **Files Modified**:
30+
- `frontend/index.html`: Added status line HTML structure
31+
- `frontend/app.js`: Status update logic, CRT container wrapping, theme application
32+
- `frontend/style.css`: Status line styling with theme support
33+
- **Deployment**:
34+
- ✅ Tested on staging: https://staging.gruesome.skeptomai.com
35+
- ✅ Deployed to production: https://gruesome.skeptomai.com
36+
- ✅ Cache invalidation: Both staging (E3VWHUOBR5D259) and production (E2GRMKUTDD19Z6)
37+
- **Commit**: `9d235c5` - "feat: Add classic Zork-style status line to game display"
38+
- **Verification**: ✅ Status line shows location, score, moves with proper theme styling and CRT effects
39+
40+
**✅ Admin Button Visibility Bug - FIXED** (December 21, 2025):
41+
- **Status**: Fixed admin/logout buttons not appearing on initial page load ✅
42+
- **Symptom**: When logging in as admin user, admin and logout buttons don't appear until page refresh
43+
- **Root Cause**: DOM reference staleness in checkAdminRole() function
44+
- loadGameLibrary() re-fetches logout button element from DOM
45+
- checkAdminRole() used stale reference to admin button without re-fetching
46+
- Element exists in DOM but JavaScript variable holds stale reference
47+
- **Solution**: Added admin button element re-fetch in checkAdminRole()
48+
```javascript
49+
async function checkAdminRole() {
50+
// Re-get the admin button element in case reference was lost
51+
adminButton = document.getElementById('admin-button');
52+
// ... rest of function
53+
}
54+
```
55+
- **Pattern Match**: Mirrors logout button re-fetch pattern in loadGameLibrary()
56+
- **Files Modified**: `frontend/app.js` (lines 1115-1140)
57+
- **Deployment**:
58+
- ✅ Deployed to production: https://gruesome.skeptomai.com
59+
- ✅ Cache invalidation: Production CloudFront distribution
60+
- **Commit**: `276b42d` - "fix: Admin button not appearing on initial login"
61+
- **Verification**: ✅ Admin and logout buttons appear immediately on initial login
62+
963
**✅ Admin Panel Backend & DynamoDB Schema Compatibility - FIXED** (December 20, 2025):
1064
- **Status**: Complete admin Lambda backend implemented with schema compatibility fixes ✅
1165
- **Symptom**: Admin panel showed no games despite 7 games existing in DynamoDB

frontend/style.css

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,10 @@ button:disabled {
14371437
background: var(--terminal-fg);
14381438
color: var(--terminal-bg);
14391439
transition: background-color 0.3s ease, color 0.3s ease;
1440+
/* Keep status line fixed at top while content scrolls */
1441+
position: sticky;
1442+
top: 0;
1443+
z-index: 10;
14401444
}
14411445

14421446
.status-location {
@@ -1451,9 +1455,3 @@ button:disabled {
14511455
text-align: right;
14521456
white-space: nowrap;
14531457
}
1454-
1455-
/* Make status line work with CRT container */
1456-
.crt-container .status-line {
1457-
position: relative;
1458-
z-index: 1;
1459-
}

0 commit comments

Comments
 (0)