Maksym Hevyk - Hello everyone! We’re building a...
Hello everyone! We’re building a feature with the React SDK where we list liveboards in a table. When a user clicks a dashboard name, they’re taken to a details page where we render the liveboard with
LiveboardEmbed
component, using its liveboardId
(stored in the URL).
Navigation works fine with our custom Back button, but the browser’s back button breaks because ThoughtSpot’s navigation pollutes the browser history.
After debugging (using onALL
to capture all events), I found that the culprit is the ROUTE_CHANGE
event. It fires whenever the iframe internally updates the iframe path, which pushes new entries into the parent browser history.
Key observations:
- Liveboards without tabs don’t cause this issue (because ROUTE_CHANGE
event is not triggered).
- With tabs:
- If no activeTabId
is provided as react prop initially, ThoughtSpot auto-redirects to the first tab → updates URL → fires ROUTE_CHANGE
event.
- Manual tab switches also add entries to history (it works fine).
- Setting activeTabId
upfront prevents the initial redirect, but you can only get tab IDs after the liveboard renders (liveboardEmbed.trigger(HostEvent.GetTabs)
), which creates a chicken-and-egg problem.
To sum up, the internal redirect to the default tab inside the iframe is polluting browser history, and I can’t intercept or prevent it.
Is there any way to handle or work around this issue?6 Replies
@Justin Mathew is there a way to prevent this?
@Maksym Hevyk this was by design , so if users click back it takes them back in the iframe first
can you raise a feature request for this
@Justin Mathew Could you please clarify why the initial redirection needs to go through the iframe first? For switching between liveboard tabs, it makes sense to push those changes into the outer history. However, for the initial redirection, I would have expected that if no tab is specified, the first one would simply be preselected by default without triggering a ROUTE_CHANGE event.
Also, could you clarify what kind of feature request I should raise to address this? What possible feature options do you see that might resolve the issue? For example, are you suggesting adding an extra prop to automatically select a default tab in the liveboard, or do you have another approach in mind?
yes I agree for the initial redirection the history should not be updated , @Maksym Hevyk you can create ticket for this, as a workaround
@Maksym Hevyk yes adding default TabId would help here this way thoughtspot wont redirect the url to the first tab
@Justin Mathew I received the case from @Maksym Hevyk .
How can SRE help here?
@Justin Mathew @Subbu I’ve submitted a feature request for this, could you please take a look?
https://community.thoughtspot.com/s/idea/087TV000000Ow2rYAC/detail