Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active tab in permalink opened in embedded dashboard is broken #32311

Open
3 tasks done
christiaan opened this issue Feb 19, 2025 · 3 comments
Open
3 tasks done

Active tab in permalink opened in embedded dashboard is broken #32311

christiaan opened this issue Feb 19, 2025 · 3 comments
Labels
dashboard:tab Related to the usage of tabs in the Dashboard embedded

Comments

@christiaan
Copy link

christiaan commented Feb 19, 2025

Bug description

Use https://www.npmjs.com/package/@superset-ui/embedded-sdk to embed a superset dashboard that has multiple tabs.
Click a tab other than the first tab.
Call dashboard.getDashboardPermalink() to retrieve the permalink for the embedded dashboard.
Extract the key from the permalink url.

Embed the dashboard using the dashboardUiConfig.urlParams.permalink_key config option with above generated permalink key.

The filters are nicely restored and the tab that was active is made active, HOWEVER it shows the content of the first tab not the tab that is active.

Superset version

4.1.1

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added dashboard:tab Related to the usage of tabs in the Dashboard embedded labels Feb 19, 2025
Copy link

dosubot bot commented Feb 19, 2025

The issue you're experiencing, where the active tab is correctly set but the content displayed defaults to the first tab, might be related to how the Superset Embedded SDK handles the restoration of active tab content when using permalinks. The SDK retrieves the permalinkValue and extracts the activeTabs from its state to hydrate the dashboard with the correct active tab content [1].

However, there might be a discrepancy in how the content is rendered for the active tab. The Tab component in the Superset codebase is responsible for rendering tab content, and it uses the DashboardComponent to render the content of each tab [2]. If the content is not displaying as expected, it could be due to how the renderTabContent function is handling the active tab state.

To address this issue, you might want to check if there are any updates or patches in newer versions of Superset that address this behavior. Additionally, reviewing the implementation of the Tab component and the renderTabContent function might provide insights into potential adjustments needed to ensure the correct tab content is displayed.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@rusackas
Copy link
Member

Are you seeing this permalink issue in the non-embedded context as well, or is it only in embedded situations?

@christiaan
Copy link
Author

christiaan commented Feb 20, 2025

@rusackas when I use the permalink gotten from the dashboard.getDashboardPermalink() in a new tab without embedding, it works correctly.

So yes only in embedded situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:tab Related to the usage of tabs in the Dashboard embedded
Projects
None yet
Development

No branches or pull requests

2 participants