@qoretechnologies/reqore 0.78.13-pr.723.g088eea5 → 0.78.13-pr.723.g11cb7ba

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.claude/CLAUDE.md CHANGED
@@ -207,21 +207,20 @@ release on npm.
207
207
  and that on Linux they do in this one. On a Mac that shows scrollbars only while scrolling they
208
208
  take no room, so this project checks nothing there: run it on Linux (CI, or the Playwright image
209
209
  in a container) to see it fail.
210
- - **POSIX-locale stories:** a browser takes its language from the locale it is launched in
211
- (`LC_ALL`, then `LANG`). On Linux a C or POSIX locale (`LANG=C.UTF-8`, `LANG=C`, or none, as in
212
- most containers) makes Chromium report `navigator.language` as `en-US@posix`, which is no BCP 47
213
- tag, and `Intl` throws on it. The other story projects run in the locale of the machine they run
214
- on (the CI runner's is a real one), so they never see it. A story tagged `posix-locale` runs a
215
- second time in the `storybook-posix-locale` project, a desktop browser launched with
216
- `LANG=C.UTF-8` and `LC_ALL=C.UTF-8`. Tag a story `posix-locale` when what it draws hands the
217
- browser's language (or a locale a host passes) to `Intl` or a date library, as `ReqoreDatePicker`
218
- does (its stories are tagged in their meta). Pass a locale on through `resolveLocale` /
219
- `toLanguageTag` (`src/helpers/locale.ts`), never raw. A touch story is not run there. Write the
220
- tag in the story file, as `touch` is written: the projects read it from the source. The project
221
- has no qlip plugin, so it makes no captures. `.storybook/vitest.setup.ts` checks that on Linux its
222
- browser reports the POSIX locale's language. On a Mac, Chromium takes its language from the
223
- system, so there the project checks nothing: run it on Linux (CI, or the Playwright image in a
224
- container) to see it fail.
210
+ - **POSIX-locale stories:** a Chromium that takes its language from the POSIX locale (`LC_ALL`, then
211
+ `LANG`: C, C.UTF-8, POSIX, or none, as in most Linux containers) reports `navigator.language` as
212
+ `en-US@posix`, which is no BCP 47 tag, and `Intl` throws on it. Not every build takes it from the
213
+ platform: the arm64 Linux one does, but the amd64 Linux one the CI runs reports `en-US` whatever
214
+ the locale or `--lang` says, as a Mac's takes the system's. So the other story projects never see
215
+ it, and a story tagged `posix-locale` runs a second time in the `storybook-posix-locale` project,
216
+ whose browser context is given that language itself (Playwright's `locale: 'en-US@posix'`,
217
+ `POSIX_LANGUAGE`): Chromium then reports it as it is, and Intl's default locale follows, on every
218
+ platform. Tag a story `posix-locale` when what it draws hands the browser's language (or a locale
219
+ a host passes) to `Intl` or a date library, as `ReqoreDatePicker` does (its stories are tagged in
220
+ their meta). Pass a locale on through `resolveLocale` / `toLanguageTag` (`src/helpers/locale.ts`),
221
+ never raw. A touch story is not run there. Write the tag in the story file, as `touch` is written:
222
+ the projects read it from the source. The project has no qlip plugin, so it makes no captures.
223
+ `.storybook/vitest.setup.ts` checks that its browser reports `en-US@posix`, on every platform.
225
224
  - **No layout change inside a ResizeObserver callback:** a story fails when the browser reports
226
225
  "ResizeObserver loop completed with undelivered notifications" (`.storybook/vitest.setup.ts`). It
227
226
  means a resize callback changed the layout it observes in the same frame, often by setting state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoretechnologies/reqore",
3
- "version": "0.78.13-pr.723.g088eea5",
3
+ "version": "0.78.13-pr.723.g11cb7ba",
4
4
  "description": "ReQore is a highly theme-able and modular UI library for React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/vitest.config.ts CHANGED
@@ -6,6 +6,7 @@ import path from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { configDefaults, defineConfig, mergeConfig } from 'vitest/config';
8
8
  import type { BrowserCommand } from 'vitest/node';
9
+ import { POSIX_LANGUAGE } from './src/stories/utils/posixLocale';
9
10
  import viteConfig from './vite.config';
10
11
 
11
12
  const dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -80,23 +81,24 @@ const storyBrowser = (kind: 'desktop' | 'phone' | 'scrollbars' | 'posix-locale'
80
81
  // leave room for one (a field measured while it draws one, qorus#646) is only seen there. A Mac
81
82
  // that shows its scrollbars as it scrolls draws them over the content, so there they take no room.
82
83
  //
83
- // The browser takes its language from the locale it is launched in (LC_ALL, then LANG), and on
84
- // Linux one that is C or POSIX (LANG=C.UTF-8, LANG=C, or none, as in most Linux containers) makes
85
- // Chromium report `navigator.language` as `en-US@posix`, which is no BCP 47 tag: `Intl` throws on
86
- // it (qorus#646). The other projects run in the locale of the machine they run on (the CI runner's
87
- // is a real one); the `posix-locale` project's browser is launched in the POSIX locale, wherever it
88
- // runs. On a Mac, Chromium takes its language from the system instead, so there it is the system's.
84
+ // A Chromium that takes its language from the POSIX locale (LC_ALL, then LANG: C, C.UTF-8, POSIX
85
+ // or none, as in most Linux containers) reports `navigator.language` as `en-US@posix`, which is
86
+ // no BCP 47 tag: `Intl` throws on it (qorus#646). Not every build does: the arm64 Linux one does,
87
+ // and the amd64 Linux one the CI runs reports `en-US` whatever the locale or `--lang` says, as a
88
+ // Mac's takes the system's. So the `posix-locale` project does not ask the platform for it: its
89
+ // context is given the language itself (`locale`), which Chromium then reports as it is, Intl's
90
+ // default locale following it, on every platform and build.
89
91
  provider: playwright({
90
92
  ...(kind === 'scrollbars'
91
93
  ? { launchOptions: { ignoreDefaultArgs: ['--hide-scrollbars'] } }
92
94
  : {}),
93
- ...(kind === 'posix-locale'
94
- ? { launchOptions: { env: { ...process.env, LANG: 'C.UTF-8', LC_ALL: 'C.UTF-8' } } }
95
- : {}),
96
95
  contextOptions:
97
96
  kind === 'phone'
98
97
  ? { viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true }
99
- : { viewport: { width: 1920, height: 1080 } },
98
+ : {
99
+ viewport: { width: 1920, height: 1080 },
100
+ ...(kind === 'posix-locale' ? { locale: POSIX_LANGUAGE } : {}),
101
+ },
100
102
  }),
101
103
  /* Asks for reduced motion (`prefers-reduced-motion: reduce`) or stops asking, in the page the stories run in.
102
104
  Reqore honours it: its springs settle at once and its transitions take no time. The contrast gate asks for it