Files
ServerKit/frontend/src/components/AppLoader.jsx
T
Juan DenisandClaude Opus 5 33410950e8 chore(i18n): RTL plumbing ratchet; keep the bare t off the Vite-only path
Plan 79 §H + ratchet 7.

<html dir> already follows the language manifest and the locale probe asserts
it. What was missing is a stylesheet that could follow it: 468
direction-anchored declarations (margin/padding/border-left|right, bare
left:/right:, text-align and float) against 5 logical properties. An RTL
locale today would render a mirrored language inside an unmirrored layout, so
the plan ships plumbing and a ratchet, not a locale. The count is 468 rather
than the plan's grepped 412 because float and text-align are equally anchored.

Also splits `src/i18n/t.js` out of the i18n barrel. The API client's error
mapper imports the bare `t`, and the client is reachable from a node test --
which then loaded i18n/index.js and its `import.meta.glob`, a Vite
compile-time transform that throws under plain node. The obvious fix was the
runtime guard that had just been removed for silently discarding every locale,
so the module is split instead: t.js touches only the i18next singleton, and
index.js keeps initialisation and the glob for browser-only callers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 00:04:29 -04:00

40 lines
1.7 KiB
React

import { t } from '../i18n/t';
/**
* Full-screen initial loader shown while auth/setup state is resolved.
*
* A ServerKit-branded tile holding the server glyph whose status LEDs blink like
* a machine booting, plus a slim indeterminate progress bar. No spinner — the
* server "powering on" is the loading metaphor. Matches the sidebar brand mark
* and the favicon so first paint feels of-a-piece.
*/
export function AppLoader() {
return (
<div className="app-loader" role="status" aria-live="polite" aria-label={t('common.state.loadingApp', 'Loading ServerKit')}>
<div className="app-loader__logo">
<svg
className="app-loader__glyph"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<rect x="2" y="2" width="20" height="8" rx="2" ry="2" />
<rect x="2" y="14" width="20" height="8" rx="2" ry="2" />
<line className="app-loader__led app-loader__led--1" x1="6" y1="6" x2="6.01" y2="6" />
<line className="app-loader__led app-loader__led--2" x1="6" y1="18" x2="6.01" y2="18" />
</svg>
</div>
<div className="app-loader__bar" aria-hidden="true">
<span className="app-loader__bar-fill" />
</div>
<span className="app-loader__label">{t('common.state.loadingApp', 'Loading ServerKit')}</span>
</div>
);
}
export default AppLoader;