Add export, import and high-score reset for saved progress

Abierto
#46 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
62/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript, vite

Línea de trabajo

Start with shared/storage.ts:1-30 to see how gh-arcade:* data is stored, then read src/hub/trophies-panel.ts:61-66 and shared/achievements.ts:164-167 for the existing reset flow. Add export, validated import, and a confirmed high score reset in the Settings or Trophies dialog. Done when a clean profile can restore trophies, stats, bests, and settings from an export, and an invalid file leaves stored data unchanged; run npm run typecheck and npm run build.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement severity: medium

Summary

All progress lives in this browser's storage with no way to back it up, move it to another device or clear high scores. The only destructive control resets trophies and stats and keeps high scores.

Where

  • shared/storage.ts:1-30
  • src/hub/trophies-panel.ts:61-66, shared/achievements.ts:164-167
  • index.html:50-51 ("saved on this device")

Proposal

Add a "Your data" section to the Settings or Trophies dialog:

  • Export: download a JSON file of every gh-arcade:* key
  • Import: file input, validate the shape, then write
  • Reset high scores, with a confirm

Who benefits

Players who install the PWA on a second device, clear site data or share a device.

Acceptance criteria

  • Export then import on a clean profile restores trophies, stats, bests and settings
  • An invalid file is rejected without changing stored data

Getting started

  • Relevant files: shared/storage.ts, src/hub/trophies-panel.ts, index.html
  • Run locally: npm install, then npm run dev
  • Checks: npm run typecheck and npm run build (there is no test suite yet)
  • Related docs: README.md

Related: #1


Filed by repo-audit/full-audit at b001f5d. Severity: medium. Effort: M. audit-key: enhancement|shared/storage.ts|export-import

Lenguaje dominante
TypeScript
Estrellas
3
Forks
3
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/GH-Arcade

Todos los issues de TMHSDigital/GH-Arcade

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.