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

Enables multi-step messages to switch between modal/overlay/inline displays, persists step/display state per message, and wires capabilities/step to the renderer with supporting queue and utility updates.

  • Messages (core)
    • Support dynamic display changes per step (modal, overlay, inline) with hasDisplayChanged and applyDisplaySettings in utilities/message-utils.
    • Reloads message on display changes without re-firing first-load events or logging new views.
    • Prevents duplicate shows by queueId and manages element conflicts when moving positions.
  • State Persistence
    • Save/restore per-message step and display settings in local storage (saveMessageState, getSavedMessageState, clearMessageState), used for persistent and show-always broadcasts.
    • Clears saved state on dismiss/remove.
    • Local storage expiry logic updated to keep .state keys.
  • Renderer Integration
    • Iframe postMessage now sends capabilities: ['MultiStepDisplayTypes'] and optional options.stepId.
    • New changeMessageStep event handled to persist state and trigger display updates.
  • Queue Handling
    • Restores saved step/display settings before showing (queue-manager), re-resolves properties, and passes saved step to loader.
  • Utilities/Refactor
    • New utilities/message-utils for message lookup, updates, display mapping, and helpers; fetchMessageByInstanceId moved here.
    • page-component-manager.addPageElement guards against duplicate element insertion.
  • Examples/Config
    • Demo adds "Show HTML Multistep Message" and encoded sample.
    • Dev renderer endpoint updated to https://code.gist.build/renderer/0.6.0-preview13.

Written by Cursor Bugbot for commit 6aa6336. 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

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