Skip to content

Integrate Maintenance and Impending Messages Into ui-core Cellix Package - #333

Open
aaron-rabinowitz wants to merge 1 commit into
add-impending-and-maintenance-messagefrom
integrate-impending-and-maintenance-messages-into-cellix-packages
Open

aaron-rabinowitz wants to merge 1 commit into
add-impending-and-maintenance-messagefrom
integrate-impending-and-maintenance-messages-into-cellix-packages

Conversation

@aaron-rabinowitz

@aaron-rabinowitz aaron-rabinowitz commented Sep 18, 2026

Copy link
Copy Markdown

Summary by Sourcery

Move feature-flag and maintenance messaging into the reusable Cellix UI core package and adapt OCOM applications to provide portal-specific runtime integration.

New Features:

  • Add reusable feature-flag and maintenance-message capabilities to the Cellix UI core package, including impending notices, maintenance states, countdowns, and runtime callbacks.
  • Integrate the shared maintenance experience into the community and staff applications with portal-specific configuration and environment-controlled countdown thresholds.

Enhancements:

  • Separate framework-level maintenance behavior from OCOM-specific GraphQL, authentication, logout, routing, and display configuration through an application adapter.
  • Make maintenance message formatting, localization, time zones, and banner positioning configurable by consuming applications.
  • Update affected routes and layouts to consume maintenance components from @cellix/ui-core while retaining OCOM-specific integration settings.

Build:

  • Move maintenance-related runtime dependencies and peer dependencies into @cellix/ui-core and update workspace package metadata and lockfiles.

Documentation:

  • Document the public feature-flag and maintenance-message APIs, integration boundary, configuration requirements, and migration guidance.

Tests:

  • Add Cellix UI core tests and Storybook coverage for maintenance state boundaries, countdown behavior, runtime failures, formatting, positioning, authentication, and Storybook overrides.
  • Add adapter tests covering server-date queries and application-owned logout behavior.

Chores:

  • Relocate feature-flag and maintenance-message implementation and exports from @ocom/ui-shared into @cellix/ui-core.

@aaron-rabinowitz
aaron-rabinowitz requested a review from a team as a code owner September 18, 2026 12:52
@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR extracts feature-flag loading and maintenance scheduling/presentation into the reusable @cellix/ui-core package, with explicit runtime and display contracts, while preserving OCOM-specific Apollo/OIDC/logout behavior in a thin ui-shared adapter and updating both applications and route layouts to use the new API.

Sequence diagram for maintenance status and kickout flow

sequenceDiagram
    participant App as OCOM application
    participant Adapter as OcomMaintenanceMessageProvider
    participant Core as MaintenanceMessageProvider
    participant Flags as FeatureFlagProvider
    participant Clock as Server clock
    participant Auth as OIDC and Apollo logout

    App->>Adapter: render portalKey and timeoutBeforeMaintenance
    Adapter->>Core: render with runtime
    Core->>Flags: useFeatureFlags()
    loop every 5 seconds
        Core->>Clock: getServerDate()
        Clock-->>Core: server timestamp
        Core->>Core: update isImpending or isMaintenance
    end
    Core-->>App: render maintenance state and messages
    loop every second while approaching
        Core->>Core: decrement countdown
    end
    Core->>Adapter: onMaintenanceKickout()
    Adapter->>Auth: HandleLogout()
    Adapter->>App: navigate('/')
Loading

Flow diagram for OCOM application maintenance rendering

flowchart TD
    Community[ui-community App] --> CommunityProvider[OcomMaintenanceMessageProvider community]
    Staff[ui-staff App] --> StaffProvider[OcomMaintenanceMessageProvider staff]
    CommunityProvider --> CommunityState[useMaintenanceMessage]
    StaffProvider --> StaffState[useMaintenanceMessage]
    CommunityState --> CommunityLayouts[Community route layouts]
    StaffState --> StaffLayouts[Staff route layout]
    CommunityLayouts --> CommunityMessage[Portal-specific maintenance or impending message]
    StaffLayouts --> StaffMessage[Portal-specific maintenance or impending message]
Loading

File-Level Changes

Change Details Files
Move reusable feature-flag and maintenance-message behavior into the Cellix UI core package.
  • Relocate feature-flag context/provider and maintenance components, hooks, types, styling configuration, and tests into ui-core.
  • Expose the new organisms through the ui-core package root and document the public integration contract.
  • Add polling, server-clock evaluation, maintenance-window boundaries, impending state, authenticated countdown, and delegated kickout behavior.
  • Make portal identity, runtime services, date formatting, timezone, and banner offsets explicit caller-supplied inputs.
packages/cellix/ui-core/src/components/index.ts
packages/cellix/ui-core/src/components/organisms/index.ts
packages/cellix/ui-core/src/components/organisms/feature-flag/*
packages/cellix/ui-core/src/components/organisms/maintinence-message/*
packages/cellix/ui-core/tests/maintenance-message.test.tsx
packages/cellix/ui-core/README.md
packages/cellix/ui-core/manifest.md
packages/cellix/ui-core/package.json
Retain OCOM-specific orchestration as an adapter around the generic ui-core maintenance runtime.
  • Wrap the existing Apollo server-date query, OIDC authentication state, logout/cache cleanup, and navigation in OcomMaintenanceMessageProvider.
  • Keep portal keys and display settings in ui-shared while removing the former maintenance implementation and re-exporting feature-flag APIs from ui-core.
  • Add adapter tests covering query policy, runtime callbacks, logout ordering, and authentication propagation.
packages/ocom/ui-shared/src/components/organisms/maintinence-message/maintenance-message-provider.tsx
packages/ocom/ui-shared/src/components/organisms/maintinence-message/maintenance-message-config.ts
packages/ocom/ui-shared/src/components/organisms/index.tsx
packages/ocom/ui-shared/src/components/organisms/feature-flag/index.tsx
packages/ocom/ui-shared/src/components/organisms/maintinence-message/maintenance-message-provider.test.tsx
packages/ocom/ui-shared/package.json
Update community and staff applications and route layouts to consume the Cellix maintenance APIs explicitly.
  • Replace direct shared-package maintenance imports with ui-core components and hooks.
  • Configure each application with its portal key, display configuration, and environment-specific countdown threshold.
  • Render impending and active maintenance states consistently across authenticated app sections and route layouts.
  • Add ui-core as a route-root dependency where required and update stories/imports.
apps/ui-community/src/App.tsx
apps/ui-staff/src/App.tsx
packages/ocom/ui-community-route-accounts/src/section-layout.tsx
packages/ocom/ui-community-route-admin/src/section-layout.tsx
packages/ocom/ui-staff-shared/src/section-layout.tsx
packages/ocom/ui-community-route-root/package.json
packages/ocom/ui-community-route-root/src/pages/cms-page.stories.tsx
Align workspace metadata and dependency resolution with the package extraction.
  • Move maintenance runtime dependencies from ui-shared to ui-core and add Apollo/GraphQL peers to ui-core.
  • Refresh lockfile and selected workspace security/tooling versions.
  • Update knip/package metadata for the new ownership and exports.
pnpm-lock.yaml
pnpm-workspace.yaml
knip.json
packages/cellix/ui-core/package.json
packages/ocom/ui-shared/package.json

Possibly linked issues

  • #unknown: The PR implements the proposed shared @cellix/ui-core package by migrating reusable feature-flag and maintenance UI components.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Fixed security issues:


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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.

1 participant