fix(words): API contract — drop empty <style>, onMount → $effect (increment 3)

words-inspector.svelte carried an intentionally-empty <style> (the styles
live in words.css, imported by the root) — removed. words.svelte used the
legacy onMount only to flip `mounted` + register langs bundles (no reactive
reads) → converted to a run-once $effect, dropped the lifecycle import.
component-api-contract test now green; eidos suite 196/197 (only the words
orphan-token test remains → Phase A).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
active-uix
dev 4 months ago
parent 059f36d2fe
commit d208f1dcd1

@ -70,5 +70,8 @@ verificar en navegador, y con el enfoque validado → generalizar tokens + barre
- [ ] A — resto del vocabulario: triar los 41 huérfanos (cablear `rail-*`/`toolbar-*`/… o podar)
- [ ] B — resto del barrido: tamaños bespoke (swatch/checkbox/anchos/sidebar 16rem×3)→tokens, padding `--space-*`
- [ ] C — centralizar las 3 paletas de color
- [ ] D — fixes API (`<style>` inspector, `onMount→$effect`) → 3er test
- [x] **D — fixes API** (2026-06-06): quitado el `<style>` vacío de `words-inspector.svelte`;
`onMount → $effect` en `words.svelte` (corre una vez, sin import de lifecycle). →
`component-api-contract` **verde**. Eidos suite 196/197 (solo queda el test de huérfanos).
- [ ] A — triar los 41 huérfanos → último test (orphans) verde, eidos suite 197/197
- [ ] E — verificación final + README

@ -779,9 +779,3 @@
<p data-words-inspector-empty>{t(L.EMPTY)}</p>
{/if}
</div>
<style>
/* Inspector chrome lives in words.css (the shared eidos Words styles).
This component-scoped block is intentionally empty — kept so the
compiler associates the file with its styles via the import graph. */
</style>

@ -13,7 +13,6 @@
* (builder-style, always visible), a slide-in drawer, a popover, or
* none. The same `<WordsInspector>` body is reused across all of them.
*/
import { onMount } from 'svelte';
import { ActiveEidos } from '$uix/eidos';
import * as Words from '$soma/components/words';
import { Button } from '$uix/eidos/components/button';
@ -48,15 +47,14 @@
// client pass emit different markup and hydration bails. Defer the
// editor to the client; SSR + first paint render the empty frame.
let mounted = $state(false);
onMount(() => {
// Client-only activation + one-time langs registration. Reads nothing
// reactive, so this $effect runs exactly once on mount (the Svelte 5 way,
// no lifecycle import). Register the inspector's localized strings into the
// active langs schema — without this every label resolves to the inline
// English fallback regardless of locale. `extend` deep-merges so app-level
// overrides at the same path applied AFTER mount still win.
$effect(() => {
mounted = true;
// Register the inspector's localized strings into the active
// langs schema. Without this every label resolves to the inline
// English fallback regardless of the active locale — declaring
// idlangrefs alone never localizes, the bundle must be extended.
// `extend` deep-merges so app-level overrides at the same path
// applied AFTER mount still win (the engine warns on leaf
// overwrites in DEV).
eidos.langs.extend('components.words.inspector', WORDS_INSPECTOR_BUNDLE);
eidos.langs.extend('components.words.menu', WORDS_MENU_BUNDLE);
});

Loading…
Cancel
Save

Powered by TurnKey Linux.