Clarify prefs ownership docs

active-uix
dev 5 months ago
parent f76b30499a
commit 77c37cd940

@ -10,7 +10,7 @@ Record<string, PrefsDimension<TIntent, TEffective>>`.
`ActiveApp` y las capas consumidoras, no una bolsa generica duplicada por cada `ActiveApp` y las capas consumidoras, no una bolsa generica duplicada por cada
capa. Queda decidido: capa. Queda decidido:
- `prefs.language` alimenta `lang`; - `prefs.language` alimenta `langs`;
- `prefs.locale` alimenta `format`; - `prefs.locale` alimenta `format`;
- `prefs.direction` resuelve la direccion efectiva; - `prefs.direction` resuelve la direccion efectiva;
- `prefs.motion`, `prefs.sound` y `prefs.haptic` son preferencias - `prefs.motion`, `prefs.sound` y `prefs.haptic` son preferencias
@ -91,7 +91,7 @@ Boundary:
```txt ```txt
Prefs = preference resolution Prefs = preference resolution
Lang = translation/catalog lookup Langs = translation/catalog lookup
Format = number/date/currency/unit formatting Format = number/date/currency/unit formatting
Prefs DOM projector = optional cross-modal DOM attrs Prefs DOM projector = optional cross-modal DOM attrs
Eidos = visual theme/mode/density projection Eidos = visual theme/mode/density projection
@ -205,8 +205,8 @@ Example future composition:
```ts ```ts
const capabilities: PrefsCapabilities = { const capabilities: PrefsCapabilities = {
languages: intersect(appConfig.languages, Lang.availableLocales), languages: intersect(appConfig.languages, Langs.availableLocales),
locales: intersect(appConfig.locales, Lang.availableLocales), locales: intersect(appConfig.locales, Langs.availableLocales),
currencies: appConfig.currencies, currencies: appConfig.currencies,
unitSystems: appConfig.unitSystems, unitSystems: appConfig.unitSystems,
themes: ['light', 'dark', 'system'], themes: ['light', 'dark', 'system'],
@ -228,8 +228,8 @@ const capabilities: PrefsCapabilities = {
}; };
``` ```
If `Lang` does not provide `es-MX` and the application requires user-selectable If `Langs` does not provide `es-MX` and the application requires user-selectable
locales to exist in `Lang`, then `es-MX` must not be in `capabilities.locales`. locales to exist in `Langs`, then `es-MX` must not be in `capabilities.locales`.
## Environment ## Environment
@ -319,7 +319,7 @@ export interface PrefsEffective {
`effective` is total, readonly and always valid. `effective` is total, readonly and always valid.
```txt ```txt
Lang reads effective.language Langs reads effective.language
Format reads effective.locale, currency, timezone, unitSystem Format reads effective.locale, currency, timezone, unitSystem
PrefsDomProjection reads effective.direction, motion, sound, haptic PrefsDomProjection reads effective.direction, motion, sound, haptic
Eidos owns visual theme/mode/density Eidos owns visual theme/mode/density
@ -540,8 +540,8 @@ ports, but it should not know them.
Example future ports: Example future ports:
```ts ```ts
// lang // langs
export interface LangPrefsPort { export interface LangsPrefsPort {
readonly locale: PrefsLocale; readonly locale: PrefsLocale;
subscribe(handler: (locale: PrefsLocale) => void): PrefsUnsubscribe; subscribe(handler: (locale: PrefsLocale) => void): PrefsUnsubscribe;
} }
@ -567,7 +567,7 @@ export interface UixPrefsPort {
``` ```
Consumers build filtered views/proxies from `App.prefs` or `uix.prefs`. Consumers build filtered views/proxies from `App.prefs` or `uix.prefs`.
`prefs` itself remains unaware of `lang`, `format`, `uix`, `eidos` or DOM. `prefs` itself remains unaware of `langs`, `format`, `uix`, `eidos` or DOM.
## Events ## Events
@ -764,11 +764,11 @@ When working on `prefs`:
- Do not wire it into `active-app` unless explicitly requested. - Do not wire it into `active-app` unless explicitly requested.
- Do not import `svelte/store` in the core. - Do not import `svelte/store` in the core.
- Do not import `lang`, `format`, `frontend`, `storage`, `buss`, `orca` or - Do not import `langs`, `format`, `frontend`, `storage`, `buss`, `orca` or
`active-app` from `libs/prefs`. `active-app` from `libs/prefs`.
- Do not persist `environment` or `effective`. - Do not persist `environment` or `effective`.
- Do not create `formatLocale`. - Do not create `formatLocale`.
- Do not let `Lang` own preferences. - Do not let `Langs` own preferences.
- Do not let `Format` keep parallel preference state. - Do not let `Format` keep parallel preference state.
- Do not add arbitrary settings. - Do not add arbitrary settings.
- Keep IO behind ports/adapters. - Keep IO behind ports/adapters.

@ -1,7 +1,10 @@
/** /**
* Built-in `PrefsDimension` catalog. Each dimension is its own factory * Built-in `PrefsDimension` catalog. Each dimension is its own factory
* — `localeDimension({...})`, `themeDimension({...})` — and the * — `localeDimension({...})`, `motionDimension({...})` — and the
* `standardPrefsDimensions(catalog)` preset composes the canonical set. * `standardPrefsDimensions(catalog)` preset composes the canonical set.
* Visual factories such as `themeDimension` and `densityDimension` remain
* importable for app-specific schemas, but they are not part of the standard
* core preset; Eidos owns visual theme/mode/density by default.
* *
* Application-specific dimensions go alongside these, either by reusing * Application-specific dimensions go alongside these, either by reusing
* the primitive factories (`booleanDimension`, `enumDimension`, …) or * the primitive factories (`booleanDimension`, `enumDimension`, …) or

@ -50,7 +50,7 @@ no deben mutar.
| Modulo | Minimo requerido | Opcional | Fallback si falta | Error si falta | | Modulo | Minimo requerido | Opcional | Fallback si falta | Error si falta |
| ------------------------ | ----------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------- | | ------------------------ | ----------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------- |
| `ActiveUix` standalone | `langs` config | `format`, `events`, `portal`, `dom:false` | crea `prefs`, core services y, si `dom:false`, `disabledDom` local | falta config `langs` | | `ActiveUix` standalone | `langs` config | `format`, `events`, `portal`, `dom:false` | crea `prefs`, core services y, si `dom:false`, `disabledDom` local | falta config `langs` |
| `ActiveUix` attach | `app.prefs`, `app.langs`, `app.dom` | `app.format`, app event engine, `portal` | ninguno para servicios requeridos | falta `langs` o `dom` en app | | `ActiveUix` attach | `ActiveApp` core + services `langs`, `dom` | `app.format`, app event engine, `portal` | ninguno para servicios requeridos | falta `langs` o `dom` en app |
| `SomaRuntime` | `dom` desde `ActiveUix` | event engine, `langs`, `format` | ninguno propio | morfo/event/part inexistente | | `SomaRuntime` | `dom` desde `ActiveUix` | event engine, `langs`, `format` | ninguno propio | morfo/event/part inexistente |
| `Sema` desde `ActiveUix` | `dom/projector` inyectado por `ActiveUix` | `sound`, `haptic` | ninguno propio de servicios UIX | por definir para uso directo fuera de `ActiveUix` | | `Sema` desde `ActiveUix` | `dom/projector` inyectado por `ActiveUix` | `sound`, `haptic` | ninguno propio de servicios UIX | por definir para uso directo fuera de `ActiveUix` |
| `Eidos` | `dom` si `applyDom` | `langs`, `format`, `prefs`, mode/density sources | `applyDom:false` permite render/serializar sin DOM | falta `dom` con `applyDom` activo | | `Eidos` | `dom` si `applyDom` | `langs`, `format`, `prefs`, mode/density sources | `applyDom:false` permite render/serializar sin DOM | falta `dom` con `applyDom` activo |

Loading…
Cancel
Save

Powered by TurnKey Linux.