Skip to content

Commit 104968b

Browse files
jeremymanningclaude
andcommitted
Show mode buttons and auto-advance toggle on mobile landscape
Fix #62: The auto-advance toggle was appended inside .modes-wrapper but the comment said "not inside it". When mobile CSS hid .modes-wrapper with display:none, it took the toggle with it. Moved toggle after the wrapper and replaced display:none with compact sizing for both breakpoints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ba11382 commit 104968b

3 files changed

Lines changed: 65 additions & 4 deletions

File tree

CLAUDE.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# mapper Development Guidelines
2+
3+
Auto-generated from all feature plans. Last updated: 2026-02-27
4+
5+
## Active Technologies
6+
- JavaScript ES2022+ (ES modules) + @playwright/test 1.58+, nanostores 1.1, deck.gl 9.2, Vite 7.3, Claude Code Task agents (Sonnet 4.6 / Opus 4.6 for persona evaluation — no API key needed) (004-persona-user-testing)
7+
- File-based JSON (question banks in `data/domains/`), localStorage (user progress) (004-persona-user-testing)
8+
- JavaScript ES2022+ (ES modules), HTML5, CSS3 + nanostores 1.1, Vite 7.3, Canvas 2D API, KaTeX (CDN), deck.gl 9.2 (006-performance-and-ux-refinement)
9+
- localStorage (user progress), file-based JSON (question banks in `data/domains/`) (006-performance-and-ux-refinement)
10+
- JavaScript ES2022+ (ES modules), HTML5, CSS3 + nanostores 1.1, Vite 7.3, deck.gl 9.2, KaTeX (CDN) (007-fix-mobile-mode)
11+
- localStorage (user progress), file-based JSON (question banks) (007-fix-mobile-mode)
12+
- JavaScript ES2022+ (ES modules), HTML5, CSS3 + nanostores 1.1, Vite 7.3, deck.gl 9.2, KaTeX (CDN), pako (new — for deflate compression) (008-shareable-map-links)
13+
- localStorage (user progress), URL query parameter (shared state) (008-shareable-map-links)
14+
15+
- JavaScript ES2022+ (ES modules), HTML5, CSS3 + nanostores 1.1.0, Vite 7.3.1, Canvas 2D API, KaTeX (CDN) (003-ux-bugfix-cleanup)
16+
17+
## Project Structure
18+
19+
```text
20+
backend/
21+
frontend/
22+
tests/
23+
```
24+
25+
## Commands
26+
27+
npm test && npm run lint
28+
29+
## Code Style
30+
31+
JavaScript ES2022+ (ES modules), HTML5, CSS3: Follow standard conventions
32+
33+
## Recent Changes
34+
- 008-shareable-map-links: Added JavaScript ES2022+ (ES modules), HTML5, CSS3 + nanostores 1.1, Vite 7.3, deck.gl 9.2, KaTeX (CDN), pako (new — for deflate compression)
35+
- 007-fix-mobile-mode: Added JavaScript ES2022+ (ES modules), HTML5, CSS3 + nanostores 1.1, Vite 7.3, deck.gl 9.2, KaTeX (CDN)
36+
- 006-performance-and-ux-refinement: Added JavaScript ES2022+ (ES modules), HTML5, CSS3 + nanostores 1.1, Vite 7.3, Canvas 2D API, KaTeX (CDN), deck.gl 9.2
37+
38+
39+
<!-- MANUAL ADDITIONS START -->
40+
41+
## Mobile Testing
42+
43+
- Mobile view is **landscape** (the app locks to landscape on phone-sized devices)
44+
- Test mobile at viewport ~812×375 (iPhone landscape), NOT portrait
45+
- The landscape breakpoint is `@media (max-height: 500px) and (orientation: landscape)`
46+
- The portrait ≤480px breakpoint also applies but landscape is the primary mobile experience
47+
48+
## Browser Automation (Playwright MCP)
49+
50+
- Use **screenshots** (`browser_take_screenshot`), NOT snapshots (`browser_snapshot`), to inspect page content — snapshots return massive DOM trees that exceed token limits on complex pages
51+
- Use `browser_evaluate` for targeted DOM queries when you need specific element state
52+
- The deck.gl canvas does NOT auto-resize when hiding DOM elements — must dispatch `window resize` event or reload at the correct viewport size
53+
54+
<!-- MANUAL ADDITIONS END -->

index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,12 @@
766766
/* Hide custom tooltips on touch devices */
767767
.ui-tooltip { display: none !important; }
768768

769-
/* ── Quiz panel: collapse mode buttons to free space for questions ── */
770-
.modes-wrapper { display: none !important; }
769+
/* ── Quiz panel: compact mode buttons + auto-advance for mobile ── */
770+
.modes-wrapper { gap: 0.2rem; margin-bottom: 0.2rem; padding-bottom: 0.2rem; }
771+
.mode-btn { width: 28px; height: 28px; font-size: 0.75rem; }
772+
.auto-advance-label { font-size: 0.7rem; margin: 0; padding: 0; line-height: 1; }
773+
.auto-advance-label input { width: 24px; height: 14px; }
774+
.auto-advance-wrap { margin: 0 !important; padding: 0 0.8rem !important; }
771775

772776
/* ── Quiz panel: bottom sheet ── */
773777
#quiz-panel {
@@ -910,7 +914,8 @@
910914
#video-panel.open { height: auto; max-height: 100%; }
911915

912916
/* Compact quiz panel for landscape phones (#58) */
913-
.modes-wrapper { display: none !important; }
917+
.modes-wrapper { gap: 0.2rem; margin-bottom: 0.15rem; padding-bottom: 0.15rem; }
918+
.mode-btn { width: 26px; height: 26px; font-size: 0.7rem; }
914919
.auto-advance-label { font-size: 0.7rem; margin: 0; padding: 0; line-height: 1; }
915920
.auto-advance-label input { width: 24px; height: 14px; }
916921
.auto-advance-wrap { margin: 0 !important; padding: 0 0.8rem !important; }

src/ui/modes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ export function init(container) {
260260

261261
toggleWrap.appendChild(track);
262262
toggleWrap.appendChild(label);
263-
wrapper.appendChild(toggleWrap);
263+
// Place auto-advance toggle after .modes-wrapper, not inside it,
264+
// so mobile CSS can hide modes-wrapper without hiding the toggle.
265+
wrapper.after(toggleWrap);
264266
autoAdvanceToggleEl = track;
265267
}
266268

0 commit comments

Comments
 (0)