refactor(web-panel): update architecture + cheat i18n

Reorganize the panel around product capabilities and integrate the
remote i18n feature from origin/master into the new structure.

- Restructure src into capability features (app, trainer, library,
  remote-session, appearance, shared); move the bridge to bridge/src.
- Add lingui-based UI localization and wrap remaining user-facing
  strings (Trans / msg macros); fix the 'END В·' mojibake.
- Port WeMod cheat-metadata i18n: capture the access token from the
  snapshot's renderer in the bridge and fetch localized trainer_meta
  in remote-session.i18n; guarantee snapshot sync on token failure.
- Wire vitest to the app's lingui/preact pipeline (mergeConfig).
This commit is contained in:
kitbyte
2026-06-15 00:10:49 +03:00
parent 8756e41fb9
commit a0b3968d33
106 changed files with 5526 additions and 1421 deletions
+19
View File
@@ -0,0 +1,19 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { loadStringSet, saveStringSet } from './storage';
describe('storage revival', () => {
beforeEach(() => localStorage.clear());
it('revives only valid string ids', () => {
localStorage.setItem('pins', JSON.stringify(['one', '', 2, 'two']));
expect(loadStringSet('pins')).toEqual({ one: true, two: true });
});
it('removes empty sets', () => {
saveStringSet('pins', { one: true });
expect(localStorage.getItem('pins')).toBe(JSON.stringify(['one']));
saveStringSet('pins', {});
expect(localStorage.getItem('pins')).toBeNull();
});
});