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