Skip to content

feat: DH-18349: Keep ui.tabs mounted when not active#1177

Merged
mattrunyon merged 2 commits into
deephaven:mainfrom
mattrunyon:mattrunyon_dh-18349
May 14, 2025
Merged

feat: DH-18349: Keep ui.tabs mounted when not active#1177
mattrunyon merged 2 commits into
deephaven:mainfrom
mattrunyon:mattrunyon_dh-18349

Conversation

@mattrunyon

Copy link
Copy Markdown
Collaborator

Tested with the snippet in DH-18349 and the following

If you run this on latest DH core, when you switch tabs you will see a loading spinner flicker and any client-side changes to the table will be lost (sort, filter, scroll, etc.)

With this change, you won't see the spinner flicker and the client state should be persisted. If you scroll/filter/sort any of the tables, then swap tabs and swap back, the table will be in the same state as when you left the tab.

from deephaven import ui, empty_table
from deephaven.plot import express as dx

_stocks = dx.data.stocks()

my_tabs_basic = ui.tabs(
    ui.tab(_stocks, title="Tab 1"),
    ui.tab(
        ui.flex(
            _stocks,
            empty_table(10).update("I=i"),
        ),
        title="Tab 2",
    ),
)

@github-actions

github-actions Bot commented May 6, 2025

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

@mattrunyon mattrunyon force-pushed the mattrunyon_dh-18349 branch from 714bcac to 5e2b434 Compare May 6, 2025 21:06
@github-actions

github-actions Bot commented May 6, 2025

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

1 similar comment
@github-actions

github-actions Bot commented May 6, 2025

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

mattrunyon added a commit to deephaven/web-client-ui that referenced this pull request May 6, 2025
…hey are not active (#2434)

Part of DH-18349. Will need a small update in dh.ui to enable support
there which is what the ticket wants.

Does not change default behavior of `TabPanels`, just adds an extra
param to keep static panels mounted (in React, but not actually mounted
in the DOM).

There are unit tests, but can also test with local plugins from this PR
deephaven/deephaven-plugins#1177
mattrunyon added a commit to mattrunyon/web-client-ui that referenced this pull request May 6, 2025
…hey are not active (deephaven#2434)

Part of DH-18349. Will need a small update in dh.ui to enable support
there which is what the ticket wants.

Does not change default behavior of `TabPanels`, just adds an extra
param to keep static panels mounted (in React, but not actually mounted
in the DOM).

There are unit tests, but can also test with local plugins from this PR
deephaven/deephaven-plugins#1177
@mattrunyon mattrunyon marked this pull request as ready for review May 14, 2025 17:58
@mattrunyon mattrunyon requested review from a team and vbabich and removed request for a team May 14, 2025 17:58
@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

@mattrunyon mattrunyon merged commit c3c15e0 into deephaven:main May 14, 2025
16 checks passed
@mattrunyon mattrunyon deleted the mattrunyon_dh-18349 branch May 14, 2025 19:45
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.

2 participants