doxa-maps/plugin-designs/research-map-plus-grid
Doxa Maps 437e591da8 Arabic set after mount never turned the composites RTL, because the instance was read too late
goal (d). Both composites reflect the reader's direction onto their custom-element host with
reflectDir(), and reflectDir read `getCurrentInstance()` at the moment it ran. That call answers only
while setup or a lifecycle hook is on the stack. reflectDir is called from BOTH:

  onMounted(reflectDir)        -> Vue has set the current instance; this worked
  watch(textDir, reflectDir)   -> nothing has; the read returned null and nothing was reflected

So a host that declared lang=ar BEFORE mount got dir=rtl correctly, and a host that SWITCHED to ar
afterwards got nothing at all. Arabic then rendered in a left-to-right layout — readable glyphs in the
wrong places, which the comment above this code already names as reading like "a styling quirk rather
than the bug it is".

THAT SPLIT IS WHY IT SURVIVED REVIEW, and it is the part worth remembering: the function is not wrong
and neither caller is wrong; the pairing is. Either line read alone is correct code, and first paint —
the thing anyone actually checks — was right. Only the later switch was broken.

The instance is now captured in setup as _selfInstance, which is the fix research-map.vue already
carries for the same failure in emitFilterState (measured there under Vue 3.5.42).

TWO THINGS DELIBERATELY NOT CHANGED, so nobody has to wonder:
- reflectDir still only ever SETS dir and never clears it. That is documented directly above it — a
  host page that declares its own dir owns that decision — so switching ar -> en leaving the attribute
  is intended, not a second bug.
- research-map-plus-grid.vue's onMounted(() => { getCurrentInstance()... }) at :422 is CORRECT and is
  left alone. Vue sets the current instance for the duration of a lifecycle hook, so that read
  resolves. Changing it would be churn, and flagging it would be a gate crying wolf on working code.
2026-09-27 05:05:03 +00:00
..
scripts check:i18n-keys-exist was blind to a translator that arrives from a composable 2026-09-27 04:14:14 +00:00
index.html Add the mobile capability-4 composite: research map above the people-groups grid 2026-09-22 07:34:02 +00:00
index.js Add the mobile capability-4 composite: research map above the people-groups grid 2026-09-22 07:34:02 +00:00
research-map-plus-grid.instances.json Add the mobile capability-4 composite: research map above the people-groups grid 2026-09-22 07:34:02 +00:00
research-map-plus-grid.meta.json Add the mobile capability-4 composite: research map above the people-groups grid 2026-09-22 07:34:02 +00:00
research-map-plus-grid.vue Arabic set after mount never turned the composites RTL, because the instance was read too late 2026-09-27 05:05:03 +00:00