Show the app version on the About screen

Abierto Apto para principiantes
#31 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react-native, typescript
Área
mobile

Línea de trabajo

Empieza con apps/mobile/src/app/about.tsx, el adaptador appVersion() en apps/mobile/src/adapters/device-lab.ts y el patrón de prueba correspondiente en apps/mobile/src/one-turn.test.ts. Añade la clave de texto de versión a ambos archivos de locale y un stub de preview en apps/mobile/preview/src/stubs/adapters.ts; actualiza la configuración de capturas de About en apps/mobile/preview/shots.mjs. Ejecuta las pruebas de mobile y copy indicadas, así como el typecheck; el trabajo estará terminado cuando About muestre una versión localizada seleccionable y existan las capturas solicitadas Light y Deep sea en ambos locales.

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

Descripción

copy good first issue ui

Why

The bug form asks for "the version on the About screen", but About doesn't show one. Now that preview APKs are on GitHub Releases, people need it to say which build they run (ROADMAP.md, Now: preview APKs).

What to do

Today About is apps/mobile/src/app/about.tsx (copy keys HM-SET-08.*). The app's version is already read for the Device lab report by appVersion() in apps/mobile/src/adapters/device-lab.ts, from Constants.expoConfig?.version.

  1. Test first: add apps/mobile/src/about-version.test.ts (node:test). It reads src/app/about.tsx and checks that the screen shows the copy key HM-SET-08.version filled with appVersion(). apps/mobile/src/one-turn.test.ts reads a screen's source the same way. Watch it fail.
  2. Add HM-SET-08.version to packages/copy/locales/en.json ("Version {version}") and packages/copy/locales/es-419.json ("Versión {version}").
  3. In about.tsx, show it under the body text as a small, soft line, and make it selectable so people can copy it into a bug report.
  4. The preview harness replaces everything in src/adapters with apps/mobile/preview/src/stubs/adapters.ts. Add appVersion there, returning a version like "0.1.0-preview.1", so the preview still builds.
  5. Take the screenshots. The About shot in apps/mobile/preview/shots.mjs uses other(...), which shoots es-419 only; switch it to core(...) for English too, or take them on a phone.

Done when

  • About shows the app's version: on a dev build, the one in apps/mobile/app.json; on a preview APK, the tag's version, which the release workflow writes into app.json before it builds.
  • The line is selectable.
  • The pull request has screenshots of About in light and Deep sea, es-419 and en.

How to check

pnpm --filter @hermit/mobile test
pnpm --filter @hermit/copy test
pnpm --filter @hermit/mobile typecheck

With the preview harness (Apple silicon Mac today): cd apps/mobile/preview && pnpm build && pnpm shoot about.

Keep in mind

  • The string lives in packages/copy, in both locales, with the same {version} placeholder and no em or en dashes.
  • Don't import expo-constants in the screen. Screens get phone facts through src/adapters, which the preview replaces.
  • The tagline, the signature and the disclaimer on About are brand lines kept as they are on purpose (see the comment at the top of about.tsx). Leave them alone.
Lenguaje dominante
TypeScript
Estrellas
11
Forks
0
Merge medio
10 min
PR fusionados (30 d)
6

Preparar el entorno

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 DojoCodingLabs/hermit

Todos los issues de DojoCodingLabs/hermit

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.