fix(atlas): clear the client gates of the globe Atlas

Client lint, checks and tests were red on the globe Atlas:

- The views own the globe and sky refs and hand them into useAtlasGlobe,
  so reading its state while rendering no longer counts as reading refs.
- Helpers that shared a file with components move to their own modules
  (badge tiers, medal label, Dawarich notes, hub tabs, period label).
- The place search derives its loading state, the search resets its
  active row on input, and the two silenced hook dependencies are named.
- placeLabels, the hover chip and the overview figures are split up.
- Raw text sizes become type tiers, the badge unlock docks on --z-overlay.
- The stats card test follows the GlobeStat props; baselines lowered to
  the counts the run reported.
This commit is contained in:
Maurice
2026-11-28 23:14:17 +01:00
parent d78dc79e21
commit 10713e41cd
52 changed files with 478 additions and 390 deletions
@@ -1,4 +1,5 @@
import type { DawarichAtlasSuggestions, DawarichBucketScan } from '@trek/shared';
import { DAWARICH_BUCKET_MATCH_MIN_MINUTES, DAWARICH_BUCKET_MATCH_RADIUS_M } from '@trek/shared';
import { useState } from 'react';
import { useTranslation } from '../../i18n';
import { DawarichOfflineError, dawarichRepo } from '../../repo/dawarichRepo';
@@ -180,3 +181,25 @@ export function useDawarichAtlas({
}
export type DawarichAtlasState = ReturnType<typeof useDawarichAtlas>;
/** What Dawarich offers for one question, built once for the desktop tab; the phone builds its own rows. */
export function dawarichNotes(
d: DawarichAtlasState,
t: (key: string, params?: Record<string, string | number>) => string
): string[] {
if (d.tab === 'wishes') {
return [
d.scan && d.scan.skippedWithoutCoordinates > 0
? t('dawarich.bucket.skipped', { count: d.scan.skippedWithoutCoordinates })
: null,
d.scan?.truncated ? t('dawarich.bucket.truncated') : null,
t('dawarich.bucket.rule', { meters: DAWARICH_BUCKET_MATCH_RADIUS_M, count: DAWARICH_BUCKET_MATCH_MIN_MINUTES }),
].filter((n): n is string => !!n);
}
return [
d.countries && d.countries.unresolved.length > 0
? t('dawarich.atlas.unresolved', { names: d.countries.unresolved.join(', ') })
: null,
d.countries ? t('dawarich.atlas.window') : null,
].filter((n): n is string => !!n);
}