@the-portland-company/shell 0.24.0 → 0.25.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,73 @@
1
+ ## 0.25.0 — 2026-07-23
2
+
3
+ ### Added — `PolitogyAppFrame`: one component owns the whole app frame
4
+
5
+ Shipping the same package at the same version was never enough: the package
6
+ exported PRIMITIVES and every app hand-assembled them in its own ~150-line
7
+ `Shell.tsx`, so identical inputs were never guaranteed and production drifted.
8
+ Apps now render
9
+
10
+ ```tsx
11
+ <PolitogyAppFrame app="forms" pathname={pathname} linkComponent={Link}
12
+ session={{ userId, email, role, accountName, accountId }}
13
+ onSignOut={signOut}>{children}</PolitogyAppFrame>
14
+ ```
15
+
16
+ and pass **nothing** about the chrome — no nav, breadcrumbs, title, mode, user
17
+ menu, footer or theme. What an app cannot pass, it cannot drift on.
18
+ `POLITOGY_APPS` is the single per-app registry (title / origin / storage key).
19
+
20
+ ### Added — brand-driven app icons (`./app-icons`)
21
+
22
+ `politogyAppIcons(app)` resolves favicons from `GET /api/icons/<app>` at runtime
23
+ (60s revalidate) for use in Next `generateMetadata()`, ending at the VRM Core
24
+ logo when an app has no icon of its own. Never throws.
25
+
26
+ ### Fixed — Surveys sub-menu rendered entirely active
27
+
28
+ `standardPolitogyNav` gave Surveys / Canvas / Results the **identical href**
29
+ (`https://surveys.politogyvrm.com/surveys`), so on surveys.politogyvrm.com every
30
+ child matched active-detection and the whole sub-menu lit up race-red. Canvas
31
+ and Results are survey-scoped routes with no id-less destination, so the group
32
+ now carries only the reachable list route. A regression test asserts no two
33
+ sibling nav items anywhere in the standard nav share an href.
34
+
35
+ ### Fixed — theme kept reverting to Light
36
+
37
+ A theme picked on Politogy ID (which has no chrome-API session) only reached the
38
+ cookie; the next app's reconcile then read the **stale** profile value from
39
+ `GET me` and overwrote the user's fresh choice. A choice is now marked pending
40
+ (`politogy_theme_pending`, cross-subdomain) until it is written to the profile,
41
+ and the first app that can reach the chrome API pushes it UP instead of pulling
42
+ the stale value down.
43
+
44
+ ### Fixed — an email is never rendered as a user's name
45
+
46
+ Identity is resolved by the package from the chrome API (`useChromeIdentity`),
47
+ with the app's session claim as a pre-hydration fallback only. Forms passed
48
+ `user.name ?? user.email`, so a user with no name set saw their email in the
49
+ top-right and the "add your name" affordance never fired.
50
+
51
+ ### Fixed — the mode pill is no longer hardcodable
52
+
53
+ `useChromeMode()` derives the current mode from the org's entitlements and the
54
+ USER'S selection (persisted cross-app as `vrm.activeMode`); the argument is now
55
+ only a pre-entitlement fallback. Apps passed the literal `'relationship'`.
56
+
57
+ ### Fixed — breadcrumbs are derived, not hand-built
58
+
59
+ `deriveBreadcrumbs()` builds **Dashboard › Sub › Item** from the same nav tree
60
+ the sidebar renders. Polls previously rendered a lone "Polls" crumb under a
61
+ "Polls" title ("Polls / Polls").
62
+
63
+ ### Fixed — apps no longer declare chrome CSS variables
64
+
65
+ `chrome.css` now emits the app-surface aliases (`--color-bg`, `--color-surface`,
66
+ `--color-panel`, `--color-border`, `--color-text`, `--color-accent`,
67
+ `--skeleton-*`, …) in light and neutral-black dark. Every app had defined its
68
+ own fallback palette and they had drifted — surveys' accent was `#C8102E` where
69
+ every other app was `#E63946`.
70
+
1
71
  ## 0.11.3 — 2026-07-20
2
72
 
3
73
  ### Fixed (native — token contract + client boundary)