Skip to content

Conversation

@dganesh05
Copy link

SUMMARY

This PR fixes the browser tab title not updating when opening charts in Explore view. Previously, the tab title remained generic even when viewing a specific chart, making it difficult to identify which chart is open when multiple tabs are present.

Changes:

  • Added originalDocumentTitle constant to capture the default title at module load
  • Implemented useEffect hook in ExploreViewContainer to update document.title when sliceName prop changes
  • Added cleanup function to reset title when component unmounts or when navigating away

Design Decisions:

  • Follows the same pattern used in DashboardPage.tsx for consistency
  • Updates title reactively based on props.sliceName from Redux state
  • Handles edge cases: unsaved charts (null sliceName), chart name changes, and navigation cleanup
  • No breaking changes - purely additive functionality

Fixes #7

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: Browser tab shows generic "Superset" title even when viewing a specific chart.
issue_before

After: Browser tab displays the chart name (e.g., "Sales by Region") when viewing a chart in Explore view.
issue_after

TESTING INSTRUCTIONS

  1. Test chart title update:

    • Navigate to Superset and open an existing chart in Explore view (/explore/)
    • Verify the browser tab title displays the chart's name
    • Open a different chart in a new tab
    • Verify the new tab shows the second chart's name
  2. Test title reset on navigation:

    • While viewing a chart, navigate away (e.g., go to home page or dashboard list)
    • Verify the tab title resets to the default "Superset" title
  3. Test unsaved charts:

    • Create a new chart (unsaved chart with no name)
    • Verify the tab title remains at the default title
  4. Test chart name changes:

    • Open a chart and verify the title shows the chart name
    • Edit the chart name (if you have permissions)
    • Verify the tab title updates to reflect the new name
  5. Verify dashboard titles still work:

    • Open a dashboard and verify its title appears in the tab
    • Navigate away from the dashboard
    • Verify the tab title resets to "Superset"

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Issue #4 - [BUG] SQL Lab not displaying string values with angle brackets #7
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

…nd improve document title handling in ExploreViewContainer
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.

Issue #4 - [BUG] SQL Lab not displaying string values with angle brackets

1 participant