Skip to content

fix(golden-layout): DH-22431: preserve focus indicator on nested dashboard tab#2664

Merged
mofojed merged 2 commits intodeephaven:mainfrom
mofojed:DH-22431-nested-dashboard-active-tab
Apr 30, 2026
Merged

fix(golden-layout): DH-22431: preserve focus indicator on nested dashboard tab#2664
mofojed merged 2 commits intodeephaven:mainfrom
mofojed:DH-22431-nested-dashboard-active-tab

Conversation

@mofojed
Copy link
Copy Markdown
Member

@mofojed mofojed commented Apr 29, 2026

  • When a dashboard is nested inside another dashboard, focusin events bubble from the inner content up to the outer container's contentElement. The outer Tab's focusin handler would clear the inner tab's lm_focusin class and claim focus for itself, leaving the active tab indicator in the wrong place.
  • _onTabContentFocusIn now ignores events whose target lives inside a nested LayoutManager. _onTabClick treats focus inside a nested layout as 'not in this container' so clicking the outer tab properly transfers the indicator back out.
  • Tested with the following deeply nested layout:
from deephaven import ui

@ui.component
def deeply_nested_dashboard_component():
    """A dashboard nested inside a panel, which is inside another dashboard."""
    return ui.panel(
        ui.dashboard(
            ui.row(
                ui.panel(ui.text("Content Level 1"), title="Level 1"),
                ui.panel(
                    ui.dashboard(
                        ui.row(
                            ui.panel(ui.text("Content Level 2"), title="Level 2"),
                            ui.panel(ui.text("Deepest Content"), title="Deepest Panel"),
                        )
                    ),
                    title="Nested Dashboard Container",
                ),
            )
        ),
        title="Outer Dashboard",
    )
ui_deeply_nested_dashboard = deeply_nested_dashboard_component()

mofojed added 2 commits April 29, 2026 13:54
When a dashboard is nested inside another dashboard, focusin events bubble from the inner content up to the outer container's contentElement. The outer Tab's focusin handler would clear the inner tab's lm_focusin class and claim focus for itself, leaving the active tab indicator in the wrong place.

_onTabContentFocusIn now ignores events whose target lives inside a nested LayoutManager. _onTabClick treats focus inside a nested layout as 'not in this container' so clicking the outer tab properly transfers the indicator back out.
@mofojed mofojed requested a review from dsmmcken April 29, 2026 18:56
@mofojed mofojed self-assigned this Apr 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.79%. Comparing base (49781a7) to head (d376de1).

Files with missing lines Patch % Lines
packages/golden-layout/src/controls/Tab.ts 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2664      +/-   ##
==========================================
+ Coverage   49.75%   49.79%   +0.04%     
==========================================
  Files         774      774              
  Lines       43881    43898      +17     
  Branches    11113    11308     +195     
==========================================
+ Hits        21832    21860      +28     
+ Misses      22031    21992      -39     
- Partials       18       46      +28     
Flag Coverage Δ
unit 49.79% <90.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@dsmmcken dsmmcken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with example provided, confirmed working.

@mofojed mofojed merged commit b2c5aa0 into deephaven:main Apr 30, 2026
11 checks passed
@mofojed mofojed deleted the DH-22431-nested-dashboard-active-tab branch April 30, 2026 12:37
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants