soroban-abacus-flashcards/apps/web
Thomas Hallock 23dccc0ef3 feat: redesign shared worksheet viewer with read-only studio and proper error handling
Transform shared worksheet experience from simple info page to full read-only studio:

**Shared Worksheet Viewer (/worksheets/shared/[id])**
- Show full worksheet studio UI in read-only mode
- Display live preview with actual worksheet rendering
- Blue banner indicates "Shared Worksheet (Read-Only)"
- Config sidebar shows all settings but disabled for interaction
- Clear "Edit This Worksheet" button with overwrite warning modal

**Edit Modal**
- Warns that editing will overwrite current worksheet settings
- Provides tips (download current worksheet first, or use different browser)
- Two-step confirmation prevents accidental data loss
- Saves shared config to user's session before navigating to editor

**Read-Only Mode Infrastructure**
- WorksheetConfigContext: Added isReadOnly prop
- ConfigSidebar: Shows "👁️ Read-Only" badge, disables inputs with pointer-events
- PreviewCenter: Hides Download/Share/Upload buttons when read-only
- StudentNameInput: Added readOnly prop with disabled styling

**Mastery Mode Field Persistence**
- extractConfigFields: Now includes currentStepId, currentAdditionSkillId, currentSubtractionSkillId
- Fixes issue where mastery mode worksheets couldn't be shared properly
- Future shares will include all required mastery mode fields

**Error Handling**
- Created /api/worksheets/preview route for server-side preview generation
- generatePreview: Returns detailed error messages instead of fallbacks
- Shared viewer: Shows prominent error card with diagnostic details
- Error format: "Missing skill IDs - addition: none, subtraction: none. This config may have been shared before mastery mode fields were added."

**Architecture Changes**
- Shared page now calls API for preview (avoids importing Node.js child_process in client)
- Clear separation between client components and server-side generation
- Proper error propagation from preview generation to UI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 12:46:43 -06:00
..
.claude worksheet studio 2025-11-11 11:44:40 -06:00
.storybook fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
__tests__ fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
content/blog
data fix: align share persistence with user session logic 2025-11-11 12:03:32 -06:00
docs
drizzle feat: add worksheet sharing infrastructure with database persistence 2025-11-11 11:17:44 -06:00
e2e fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
public
scripts worksheet studio 2025-11-11 11:44:40 -06:00
src feat: redesign shared worksheet viewer with read-only studio and proper error handling 2025-11-11 12:46:43 -06:00
.dockerignore.test
.gitignore
CARD_SORTING_PORT_PLAN.md
COMPLEMENT_RACE_PORT_PLAN.md
DEVELOPMENT_STANDARDS.md
LINTING.md
README.md
biome.jsonc fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
drizzle.config.ts fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
eslint.config.js fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
next-env.d.ts
next.config.js feat: enable production source maps for easier debugging 2025-11-08 20:32:06 -06:00
package.json feat: add worksheet sharing infrastructure with database persistence 2025-11-11 11:17:44 -06:00
panda.config.ts fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
playwright.config.ts fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
pnpm-lock.yaml
server.js fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
svg-processing-test.js fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00
test-arcade-api.sh
test-flashcards-final.pdf
test-flashcards.pdf
test-simplified.pdf
test_fullscreen_persistence.html
test_panda_simple.html
tsconfig.json worksheet studio 2025-11-11 11:44:40 -06:00
tsconfig.server.json
vitest.config.ts fix(worksheets): ten-frames not rendering in mastery mode 2025-11-10 10:06:27 -06:00

README.md

Test deployment - Mon Nov 3 16:31:57 CST 2025