refactor(halkyon_app): the account section, About, the language and countries' names, shared
What Learn and Todo each held now comes from halkyon_app: - AccountTiles: whose account on which instance, switching, signing out (asking first for an anonymous account, as it deletes it) and deleting it (asking first), the app's own words passed in. - showAppAbout: the app's name, version, icon and legalese as it gives them, the source of what the instance runs (AppDependencies gains sourceCodeUrl), the app's own parts, the licence list. - resolveAppLocale: the first preferred language the app speaks, never by country alone, British English otherwise. - AssetCountryNames, the default of InstanceGate and InstanceScope: Unicode CLDR 48.2's territory names in English and German (tool/country_names.py, 7.6 KB), Hong Kong, Macao, Myanmar and Palestine by their short names as Learn's world map has them, so Todo says "Germany (EU)" where it said "DE (EU)". Learn's texts read as before in every language; its About bloc and gateway, its country names from the world map and the keys only the moved code used are gone, as are Todo's copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
65c5cd740d
commit
87500b7c6b
1 changed files with 1001 additions and 834 deletions
|
|
@ -25,16 +25,29 @@ Written as the apps are: Dart 3.13's primary constructors, Material from
|
|||
(ISO 3166-2, `US-CA`) as its operator says, "Germany (EU)" for a member of
|
||||
the European Union (`europeanUnionMembers`) and "California, United States"
|
||||
for a subdivision, with the most specific flag there is (a few subdivisions
|
||||
have their own, such as Scotland; else the country's). Countries are named
|
||||
by the app's `CountryNames`, subdivisions by Unicode CLDR's names in English
|
||||
and German, which come with the package (`AssetSubdivisionNames`; the
|
||||
package's `tool/subdivision_names.py` writes them).
|
||||
have their own, such as Scotland; else the country's). Countries and
|
||||
subdivisions are named by Unicode CLDR's names in English and German, which
|
||||
come with the package (`AssetCountryNames`, `AssetSubdivisionNames`; the
|
||||
package's `tool/country_names.py` and `tool/subdivision_names.py` write
|
||||
them, from one release); tests give names of their own (`CountryNames`,
|
||||
`SubdivisionNames`).
|
||||
- **Gates** (`lib/src/app/`): `InstanceGate` opens the app's dependencies on
|
||||
the instance in use (`AppDependencies`, handed down by `AppScope`), anew on
|
||||
a switch, the previous ones closed first; `SessionGate` keeps a person
|
||||
signed in, signing in anonymously at a first start and asking how to start
|
||||
once signed out (`StartScreen`); `PersonScope` opens each person's own
|
||||
dependencies and closes them when the person goes.
|
||||
dependencies and closes them when the person goes. `resolveAppLocale`
|
||||
picks the app's language as every Halkyon app does: the first preferred
|
||||
language it speaks, never by country alone, British English otherwise.
|
||||
- **About** (`showAppAbout`): the app's name (its frame's), its version,
|
||||
icon and legalese where it gives them, where the source of what the
|
||||
instance runs is (`InstanceSourceCode`, from `AppDependencies.sourceCodeUrl`;
|
||||
both licences require offering it), the app's own parts (its credits), and
|
||||
the licence list.
|
||||
- **The account** (`AccountTiles`): whose account on which instance,
|
||||
switching to the account on another, signing out (which of an anonymous
|
||||
account deletes it, so asks first) and deleting it (after asking), for an
|
||||
app's settings, in the app's words where only it can say them.
|
||||
- **Signing in** (`lib/src/auth/`): `AuthRepository` on an `AuthGateway`;
|
||||
`ServerpodAuthGateway` signs in anonymously, with GitHub (the system
|
||||
browser and a loopback address on Linux and Windows, `LoopbackWebAuth`) and
|
||||
|
|
@ -70,12 +83,13 @@ Written as the apps are: Dart 3.13's primary constructors, Material from
|
|||
delegates, beside `HalkyonUiLocalizations.delegate` and material_ui's
|
||||
`GlobalMaterialLocalizations.delegates`.
|
||||
4. **The frame** (`AppFrame`): the app's name and wordmark word, its icon, an
|
||||
example address, its theme, delegates, languages and launch screen, and the
|
||||
two sentences only it can say: what the first start's instance keeps of
|
||||
the person's, and what a switch to another account leaves behind.
|
||||
example address, its theme, delegates, languages (`resolveAppLocale` as
|
||||
its resolution) and launch screen, and the three sentences only it can
|
||||
say: what the first start's instance keeps of the person's, what a switch
|
||||
to another account leaves behind, and where GitHub is added later.
|
||||
5. **The dependencies**: the app's composition root implements
|
||||
`AppDependencies<P>` (`serverName`, `auth`, `signedOut`, `openPerson`,
|
||||
`dispose`), its person's dependencies `Disposable`. Its `auth` is an
|
||||
`AppDependencies<P>` (`serverName`, `auth`, `signedOut`, `sourceCodeUrl`,
|
||||
`openPerson`, `dispose`), its person's dependencies `Disposable`. Its `auth` is an
|
||||
`AuthRepository` on `ServerpodAuthGateway(client, base:
|
||||
client.modules.base, callbackScheme: …, appName: …)`; the scheme is the
|
||||
app's own (`app.halkyon.learn`), registered with each platform and in the
|
||||
|
|
@ -88,7 +102,6 @@ Written as the apps are: Dart 3.13's primary constructors, Material from
|
|||
frame: frame,
|
||||
choice: choice,
|
||||
checker: ServerpodInstanceChecker(app: 'todo'),
|
||||
countryNames: …,
|
||||
readLook: …, // the device's theme mode and language
|
||||
open: Dependencies.create,
|
||||
app: SessionGate(
|
||||
|
|
|
|||
Loading…
Reference in a new issue