Skip to content

SCAL-337597 Add filter host event example in Liveboard embed - #68

Open
ts-nk-github-cplot wants to merge 2 commits into
mainfrom
SCAL-337597
Open

SCAL-337597 Add filter host event example in Liveboard embed#68
ts-nk-github-cplot wants to merge 2 commits into
mainfrom
SCAL-337597

Conversation

@ts-nk-github-cplot

Copy link
Copy Markdown

Summary

Add a new demo: Add Filter (Edit Mode) — embeds a ThoughtSpot Liveboard and adds an "Add Filter" button outside the embedded UI. Clicking it triggers HostEvent.Edit to enter edit mode, then HostEvent.OpenAddFilterModal to open the Add Filter modal, sequenced off the SDK's own readiness signals rather than trigger()'s unreliable promise.

Ships as two equivalent, independently runnable implementations:

  • vanilla/ — plain JS + Vite
  • react/ — same logic ported to React, using the official @thoughtspot/visual-embed-sdk/react LiveboardEmbed component and hooks

Test plan

  • cd vanilla && npm install && npm run dev (port 8642) — click Add Filter, confirm edit mode + modal open on first click
  • cd react && npm install && npm run dev (port 8643) — same check
  • Fresh load → Add Filter — reload the page, wait for the button to enable, click Add Filter. Liveboard enters edit mode and the Add Filter modal opens on the first click (no hang, no timeout).
  • Cancel inside embed → Add Filter again — open the modal, cancel/close it from within the embed (still in edit mode), click Add Filter again. Modal reopens without the button getting stuck disabled or the loader hanging.
  • Back to Liveboard → Add Filter again — open the modal, cancel all the way back out to the Liveboard view (exit edit mode), click Add Filter again. Re-enters edit mode and reopens the modal correctly.
  • Rapid double-click — click Add Filter twice in quick succession. Second click is a no-op while the first sequence is in flight (isTransitioning guard); button re-enables once the first sequence finishes.
  • Add a real filter and save — open the modal, actually add a filter and apply it. Confirms the flow doesn't just open the modal but leaves a working editable Liveboard underneath.
  • Repeat click after a completed filter add — after saving a filter and returning to the Liveboard, click Add Filter once more. Should behave identically to the first click (no leftover state from the previous cycle).
  • Button disabled state — confirm the button stays disabled from page load until the Liveboard has actually rendered, and again for the duration of each Edit/OpenAddFilterModal sequence.

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