Show the app version on the About screen

Offen Anfängerfreundlich
#31 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
88/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
react-native, typescript
Bereich
mobile

Rechercherichtung

Beginne mit apps/mobile/src/app/about.tsx, dem appVersion()-Adapter in apps/mobile/src/adapters/device-lab.ts und dem passenden Testmuster in apps/mobile/src/one-turn.test.ts. Füge den Versions-Textschlüssel zu beiden Locale-Dateien und einen Preview-Stub in apps/mobile/preview/src/stubs/adapters.ts hinzu; aktualisiere die About-Screenshot-Konfiguration in apps/mobile/preview/shots.mjs. Führe die aufgeführten Mobile- und Copy-Tests sowie den Typecheck aus; fertig ist die Aufgabe, wenn About eine auswählbare lokalisierte Version anzeigt und die angeforderten Screenshots in den Varianten Light und Deep sea in beiden Locales vorhanden sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
TypeScript
Sterne
11
Forks
0
Ø Merge
10 Min.
Gemergte PRs (30 T.)
6

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus DojoCodingLabs/hermit

Alle Issues in DojoCodingLabs/hermit

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.