Skip to content

[Feat] Add Roomote Cloud analytics and support integrations#391

Merged
brunobergher merged 15 commits into
developfrom
feature/cloud-analytics-switch-1way1umrayiy0
Jul 16, 2026
Merged

[Feat] Add Roomote Cloud analytics and support integrations#391
brunobergher merged 15 commits into
developfrom
feature/cloud-analytics-switch-1way1umrayiy0

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Opened on behalf of Bruno Bergher. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

Adds the R_CLOUD_ENABLED master switch for Roomote Cloud analytics behavior. Cloud deployments force anonymous analytics on, remove admin opt-out controls, and load optional PostHog session replay and Intercom Messenger browser integrations from public runtime configuration. The browser integration now uses safe runtime script injection, resets stale user identity, and uses the web runtime resolved cloud flag for telemetry.

The cloud Intercom integration now hides the default launcher on regular signed-in app pages and provides a Roomote Help entry in the navbar and side nav instead. The default Intercom launcher remains available on setup, onboarding, settings, analytics, and automations pages. The branch also refines the side nav recent-task layout, support entry placement, onboarding wordmark placement, and setup action button sizing to fit the support widget flow.

Why this change was made

Roomote Cloud requires consistent analytics and support behavior while self-hosted deployments must remain fully isolated from the new browser integrations. The additional UI changes keep support reachable in Cloud without letting the default Messenger launcher overlap core navigation or onboarding surfaces.

Impact

Cloud deployments can configure PostHog and Intercom without bundling either SDK, while self-hosted deployments render and execute neither integration path. Signed-in Cloud users get a native Help entry in the app shell, while onboarding and configuration pages can continue to use Intercom default support affordances. Browser proof was not applicable to the integration lifecycle fixes.

@roomote-roomote

roomote-roomote Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

1 issue outstanding. See task

  • High packages/env/src/__tests__/index.test.ts:179 — Expect the parsed boolean instead of the raw flag. optInBoolean() transforms "1" to true whenever validation is enabled, so this test still fails in CI. The failure reproduces with env -u SKIP_ENV_VALIDATION pnpm --filter @roomote/env exec vitest run src/__tests__/index.test.ts -t 'parses Roomote Cloud analytics configuration'.
  • Medium apps/web/src/components/layout/CloudAnalyticsProvider.tsx:90 — Intercom now boots from the dynamically injected script's load event, so hydration cannot miss the event.
  • High apps/web/src/components/layout/CloudAnalyticsProvider.tsx:102 — Clear third-party identity on the actual sign-out and account-switch paths. Sign-out performs a full navigation, so these effects never observe userId clearing; on the new signed-out page, PostHog's load handler does not reset and Intercom boots before the shutdown effect can run. Truthy-to-truthy account switches also identify without resetting PostHog and never shut down Intercom.
  • Medium packages/telemetry/src/server/index.ts:221 — Propagate the web runtime's resolved cloud flag through event capture. The route's up-front check now uses the resolved flag, but every captureEvent() immediately rechecks with the shared raw-process default, so affected cloud deployments still accept and then drop the events.
  • High apps/web/src/components/layout/side-nav/SideNav.client.test.tsx:473 — Updated the stale separator assertion after removing both side-nav separators; the focused suite now passes with zero separators.
  • Medium apps/web/src/components/layout/CloudAnalyticsProvider.tsx:114 — Reboot Intercom after an account switch. This effect calls shutdown and clears intercomBooted, but neither the loader effect nor the launcher-update effect reruns when the next user has the same configuration and pathname, leaving the Help button connected to a shut-down Messenger until reload.

Reviewed dbb0b0e

Comment thread apps/web/src/components/layout/CloudAnalyticsProvider.tsx Fixed
Comment thread apps/web/src/components/layout/CloudAnalyticsProvider.tsx Fixed
Comment thread apps/web/src/components/layout/CloudAnalyticsProvider.tsx Fixed
@roomote-roomote

Copy link
Copy Markdown
Contributor Author

Resolved the four reported issues in 22ee692: corrected cloud-runtime telemetry gating, replaced inline script construction with runtime loading, boots Intercom after its script loads, and clears third-party identity on sign-out or account changes. Targeted provider tests, web typechecks, and the repository pre-push checks passed.

@brunobergher
brunobergher marked this pull request as ready for review July 16, 2026 10:13
@brunobergher
brunobergher force-pushed the feature/cloud-analytics-switch-1way1umrayiy0 branch from f285159 to fbfa79e Compare July 16, 2026 10:18
@brunobergher
brunobergher merged commit 4e7ccfd into develop Jul 16, 2026
18 checks passed
@brunobergher
brunobergher deleted the feature/cloud-analytics-switch-1way1umrayiy0 branch July 16, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants