@the-portland-company/shell 0.82.0 → 0.85.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,42 @@
1
+ ## 0.85.0
2
+
3
+ The mode switcher, the rail and the rows always show one mode. Spec cited: Specs/Left-Navigation §9.1, §9.2, §9.4 and §11.1 ("the rail never shows a mix of two modes").
4
+
5
+ - **Why.** Reported by Ben and measured on production 2026-10-16 on "We need Steve": after picking Campaign, Contacts (and Forms, Surveys, CTAs) drew the red "Campaign mode" rail and the Campaign search placeholder around Relationship rows, even after a reload. These apps had no registry mode, so the switcher took the user's last choice (`vrm.activeMode`) while the rows stayed Relationship.
6
+ - **Registry.** `contacts`, `forms`, `surveys` and `ctas` are pinned to `mode: 'relationship'`: they are Relationship rows only (§9.1) and Campaign has none of them (§9.2). Same fix as the Dashboard's earlier pin. Clicking another mode still goes to that mode's landing.
7
+ - **Unpinned apps** (Settings: the Account section is in every mode, §9.4) draw the tree of the mode their switcher shows, so rows, rail colour and label agree. Core (`vrm`) is unchanged.
8
+ - **Loading Screen.** For an unpinned app it stays up until the organization's Modes are read, so the rail never changes mode under the user. `NavMode` gains optional `resolved` (false while the id is a stand-in).
9
+ - Tests: `__tests__/modeNavAgree.test.tsx`; `frame-grants.test.tsx` updated for the new pins.
10
+
11
+ ## 0.84.0
12
+
13
+ An organization switch lands on the new organization's Relationship Dashboard. Spec cited: Specs/Left-Navigation §6 and §11.2 (v21, decided 2026-10-15 by Ben; supersedes the 2026-10-06 rule that kept mode, page and tab).
14
+
15
+ - **Why.** Measured by Ben on production 2026-10-15: switching from "We need Steve" in Campaign Mode to an organization without Campaign Mode kept the Campaign rail, then showed an access error that required signing out and in again.
16
+ - **Token-org path.** After the IdP accepts the switch, the tab keeps the switch pending (Loading Screen up), lets the current app re-exchange for up to 4 seconds, then navigates to `https://dashboard.politogyvrm.com/dashboard?mode=relationship&org=<new org>` (`-staging` twin from a staging host). A refused switch still rolls back and calls `onSwitchError`.
17
+ - **Legacy path.** `ChromeStateProvider` navigates to the same landing after writing the cookie.
18
+ - **Frame.** The Loading Screen's synthetic ready signal waits while `orgPending` is true.
19
+ - **New export** `orgSwitchLanding` (`href`, `navigate`); tests replace `navigate`.
20
+ - **Not changed.** A per-tab `?org_id=` override and a switch made in another tab (followed on focus) do not navigate: neither is a switch made in this tab.
21
+
22
+ ## 0.83.0
23
+
24
+ The top bar's Credits icon shows credit health. Spec cited: Reference/UI-Platform v57 "Top bar → Credits" and "Credit health in the payload" (decided by Ben, 2026-10-13); VRM-Admin/Pricing-and-Metering v5 §7.5.
25
+
26
+ - **Icon.** The battery with the lightning bolt, coloured by the worst state among the credit types in use: green when every one is Good, yellow when at least one is Low, red when at least one is Out. Not in use never changes it. The fill drains with the state (full, part, empty) and the state is in the `aria-label` ("Credits: low on Signal Credits"), so colour is never the only signal. A payload without `state` is unknown: neutral icon, no colour, no gauge level.
27
+ - **Tooltip** (hover or focus) lists all four types, each with Available, a gauge against its full mark and the state in words ("Signal Credits: 38 left, about 1 day at your recent pace"). **Click** opens the breakdown: four rows, Available, Included (with the next grant date) and Purchased when the ledger publishes them, gauge, state, and a "+" to buy that type.
28
+ - **Retired.** The low-balance hint that hung under the icon ("You're low on fuel" / "Buy More Fuel"), its sessionStorage dismissal and the new-reply toast's clearance for it. No pop-up about credits opens by itself. `lowFuel` / `lowFuelThreshold` are no longer read. The word is Credits everywhere; "fuel" appears in no string.
29
+ - API: `FuelChannelStatus` gains `state`, `fullMarkUnits`, `daysOfUseLeft`, `includedUnits`, `purchasedUnits`, `nextGrantAt`; `CommunicationsFuelStatus` gains optional `ai` and `enhancement`. `TopBarPopover` gains `icon`, `ariaLabel` and `tooltip`; `topBarIconButtonClass` tones gain `ok` and `low` (`TopBarIconTone`). New export `CreditsAction` (alias of `FuelAction`) and the pure helpers from `./native` (`creditsIconState`, `creditGaugeRatio`, `creditTooltipLine`, `creditsAriaLabel`). New tokens `--credits-good`, `--credits-low`.
30
+ - Tests: `__tests__/credits.test.ts`, `__tests__/chromeActions.test.tsx` (Credits block).
31
+
32
+ ## 0.82.1
33
+
34
+ The legacy chrome provider (Contacts, and any app not yet on `tokenOrg`) writes the organization to the address bar as the 7-char `org_id` tail and never the full-uuid `?org=`. Spec cited: Reference/UI-Platform "URL state" (`org_id`, always present; the legacy `org=` and cookie stay only until every app reads the org from the token).
35
+
36
+ - **Cause.** The provider's sync effect set `?org=<full uuid>` whenever the active org changed, so Contacts' canonical URL regained a second org key after every load (reported by Ben's agent, 2026-10-13).
37
+ - **Fix.** The effect deletes `org=` and sets `org_id=<tail>` (a replace, never a navigation); the cookie mirror is unchanged. At boot an `org_id` tail counts as an explicit selector and, once the member list resolves, selects that org (uncontrolled apps); a non-member tail is rewritten to the active org.
38
+ - Tests: `__tests__/legacyOrgIdUrl.test.tsx`.
39
+
1
40
  ## 0.82.0
2
41
 
3
42
  The universal-search placeholder names what the current Mode searches. Spec cited: Reference/UI-Platform v56 "Top bar — required elements" (decided by Ben, 2026-10-12).