@growth-operations/ui-shared 1.6.10 → 1.6.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-operations/ui-shared",
3
- "version": "1.6.10",
3
+ "version": "1.6.11",
4
4
  "description": "Shared HubSpot UI-extension modules (Home, Billing) for Growth Operations apps.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useRef } from "react";
2
2
  import {
3
3
  Flex,
4
4
  Tile,
@@ -30,13 +30,22 @@ import {
30
30
  // activation Pub/Sub message via an app endpoint). If omitted, the
31
31
  // FAILED state still renders guidance, just no button.
32
32
  export function InstallProgress({ state, onRetry }) {
33
+ // Clamp the displayed step to be MONOTONIC. A reinstall (re-consent for new
34
+ // scopes) re-runs activation, which resets activation_step to 0 server-side;
35
+ // the poll can catch that reset and the bar would visibly jump backwards
36
+ // (e.g. 37% -> 0% -> 53%). Track the high-water mark per mount so progress
37
+ // only ever moves forward.
38
+ const maxStepSeen = useRef(0);
39
+
33
40
  const activation = state?.activation;
34
41
  // No activation block => nothing to show (Home's health hero takes over).
35
42
  if (!activation) return null;
36
43
 
37
44
  const status = activation.status;
38
- const step = activation.step ?? 0;
45
+ const rawStep = activation.step ?? 0;
39
46
  const total = activation.total ?? 5;
47
+ maxStepSeen.current = Math.max(maxStepSeen.current, rawStep);
48
+ const step = maxStepSeen.current;
40
49
  const warnings = activation.warnings ?? [];
41
50
  const complete = activation.complete === true || status === "completed";
42
51