Skip to content

Comments

chore: update webviews to retain context when hidden#1800

Open
scottdover wants to merge 3 commits intomainfrom
feat/1791-maintain-row
Open

chore: update webviews to retain context when hidden#1800
scottdover wants to merge 3 commits intomainfrom
feat/1791-maintain-row

Conversation

@scottdover
Copy link
Contributor

Summary:
This changes how DataViewer maintains context. In our first iteration, retainContextWhenHidden: true was avoided because the documentation said:

keep in mind that this has high memory overhead and should only be used when other persistence techniques will not work

With that in mind, the implementation relied on re-fetching data each time a view was displayed. As DataViewer grows increasingly complex, the amount of state required to persist/fetch data will be increase.

Thus, this PR changes things such that we retain context when switching between tabs. The downside is that there is a higher memory footprint (it was hard to find data on this but a stack overflow post suggested an empty web view using retainContextWhenHidden: true consumes 50mb of memory). However, there are numerous upsides:

  • Bugs like this go away entirely: Table Viewer - Maintain selected row when changing between windows #1791
  • Grid state no longer has to be persisted/fetched when a tab is displayed
  • The excess xhr requests that were made to re-fetch data are no longer needed
  • From a developer perspective, adding new features to the dataviewer will require less time worrying about data persistence/retrieval for things that should be in-memory

Testing:

  • Open a table, apply filters & sorts, change scroll position, etc
  • Tab away and back to table, and make sure state hasn't changed

Scott Dover added 2 commits February 20, 2026 11:29
Signed-off-by: Scott Dover <Scott.Dover@sas.com>
Signed-off-by: Scott Dover <Scott.Dover@sas.com>
@scottdover scottdover changed the title Feat/1791 maintain row chore: update webviews to retain context when hidden Feb 20, 2026
@scottdover scottdover marked this pull request as ready for review February 20, 2026 18:44
Signed-off-by: Scott Dover <Scott.Dover@sas.com>
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.

Table Viewer - Maintain selected row when changing between windows

1 participant