<feed xmlns='http://www.w3.org/2005/Atom'>
<title>progmaweb/apps/web/tests/theme.test.mjs, branch site/shared-preferences</title>
<subtitle>The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.</subtitle>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/progmaweb/'/>
<entry>
<title>Share the theme and the language across every Progmasoft host</title>
<updated>2026-11-17T11:33:32+00:00</updated>
<author>
<name>Leitwolf11</name>
</author>
<published>2026-11-17T11:33:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/progmaweb/commit/?id=6d78305900851f98e00cc1b688d1237b5e33f857'/>
<id>6d78305900851f98e00cc1b688d1237b5e33f857</id>
<content type='text'>
A theme chosen on progmasoft.com did not hold on account., viget.,
product. or console., and a language choice sometimes did not either:

- The theme lived in localStorage, which each host keeps for itself. It
  is now the cookie progmasoft_theme of .progmasoft.com, as the language
  is (lib/theme.ts): "light" or "dark", a year, SameSite=Lax, Secure over
  HTTPS, readable by the page's scripts. The bootstrap that sets the theme
  before the first paint reads the cookie; a choice an earlier version left
  in localStorage moves into the cookie once. The theme control writes the
  cookie and reads it again when a page is shown or comes back into view,
  so a tab left open follows a choice made on another host.
- The language cookie is shared (Domain=.progmasoft.com), but a cookie of
  the same name that one host kept from before shadowed it: the browser
  sends both, the host's first. The proxy now expires such a host cookie
  (lib/shared-cookies.ts) for the language and the theme alike, so the
  shared choice holds from the next request on.

Tests: unit tests for the cookie, the bootstrap (run in a vm with a fake
document) and the expiry of shadowing cookies (54 in all); layout tests
that choose a theme and a language on progmasoft.com and find them on the
other hosts, move an old localStorage theme, and clear a shadowing
cookie (144 layout tests pass); tsc, eslint and build pass.

Claude-Session: https://claude.ai/code/session_01Ji7xZMYjc4zankoc7hGBE1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A theme chosen on progmasoft.com did not hold on account., viget.,
product. or console., and a language choice sometimes did not either:

- The theme lived in localStorage, which each host keeps for itself. It
  is now the cookie progmasoft_theme of .progmasoft.com, as the language
  is (lib/theme.ts): "light" or "dark", a year, SameSite=Lax, Secure over
  HTTPS, readable by the page's scripts. The bootstrap that sets the theme
  before the first paint reads the cookie; a choice an earlier version left
  in localStorage moves into the cookie once. The theme control writes the
  cookie and reads it again when a page is shown or comes back into view,
  so a tab left open follows a choice made on another host.
- The language cookie is shared (Domain=.progmasoft.com), but a cookie of
  the same name that one host kept from before shadowed it: the browser
  sends both, the host's first. The proxy now expires such a host cookie
  (lib/shared-cookies.ts) for the language and the theme alike, so the
  shared choice holds from the next request on.

Tests: unit tests for the cookie, the bootstrap (run in a vm with a fake
document) and the expiry of shadowing cookies (54 in all); layout tests
that choose a theme and a language on progmasoft.com and find them on the
other hosts, move an old localStorage theme, and clear a shadowing
cookie (144 layout tests pass); tsc, eslint and build pass.

Claude-Session: https://claude.ai/code/session_01Ji7xZMYjc4zankoc7hGBE1
</pre>
</div>
</content>
</entry>
</feed>
