Skip to content

Conversation

@BernardGatt
Copy link
Collaborator

@BernardGatt BernardGatt commented Dec 1, 2025

Addresses: INAPP-14008

This PR adds support for multi-step display types and state saving between message step changes.

Note: gist-web-renderer/pull/32 Needs to be deployed first


Note

Adds multi-step message support with dynamic display switching (modal/overlay/inline), step/state persistence across sessions, and related utilities with a demo example.

  • Core SDK:
    • Multi-step display support: Handle changeMessageStep, detect display changes, apply/reload new settings (modal/overlay/inline) without duplicating events/views; prevent duplicates by queueId; pass saved step to renderer.
    • State persistence: Save/restore per-queueId step and displaySettings (30-day TTL) for persistent/show-always messages; clear state on dismiss/remove; adjust local-storage expiry to keep .state keys.
    • Utilities: New utilities/message-utils (fetch/update/remove by id, element lookup, display-type mapping, change detection, applyDisplaySettings, wideOverlayPositions); move fetchMessageByInstanceId here.
    • Message components: Send renderer capabilities (MultiStepDisplayTypes) and stepId; support stepName in load; cleanup gist-* classes and styles on hide; enforce 100% width for wide overlay positions; addPageElement made idempotent.
  • Queue/Rendering:
    • Restore saved state before showing messages; re-resolve properties; reload message with new display config; maintain correct overlay/embedded flags and sizing.
  • Examples:
    • Add "Show HTML Multistep Message" button and encoded sample in examples/index.html.

Written by Cursor Bugbot for commit 176361a. This will update automatically on new commits. Configure here.

@BernardGatt BernardGatt requested a review from a team as a code owner December 1, 2025 11:40
Bernard Gatt added 2 commits December 12, 2025 12:30
* develop:
  Bump version to 3.17.0
  Review feedback
  Send opened inboxMessageAction events; add test harness config section
  Support marking unopened and unsubscribing from event emitter
  Send updated message list when marking opened or deleted
  lint
  Review feedback
  Support inbox messages
  fix and clean
  cleanpu
  non dry run to verify publishing works
  pare this down to only test npm publishing for now
  DX-809 update to use preferred OIDC for npm publish in github actions

# Conflicts:
#	examples/index.html
#	src/managers/queue-manager.js
message.properties.gist.exitClick = displaySettings.dismissOutsideClick;
} else {
delete message.properties.gist.exitClick;
}
Copy link

Choose a reason for hiding this comment

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

Bug: Empty displaySettings clears custom message properties on restore

When displaySettings is an empty object {} (not undefined), saveMessageState saves it as-is. Later when restoring, applyDisplaySettings is called because savedState.displaySettings is truthy. Since all properties like maxWidth, overlayColor, and dismissOutsideClick are undefined in an empty object, the else branches execute and delete messageWidth, overlayColor, and exitClick from message.properties.gist. This causes custom styling to be lost when a persistent message is restored, falling back to defaults instead of preserving the original configuration.

Additional Locations (1)

Fix in Cursor Fix in Web

@BernardGatt BernardGatt merged commit 7ac4290 into develop Dec 16, 2025
2 checks passed
@BernardGatt BernardGatt deleted the feature/INAPP-14008 branch December 16, 2025 14:44
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