Skip to content

We should save the (minimal) widget state in the notebook file by default #3108

@maartenbreddels

Description

@maartenbreddels

Problem

People just want to save a notebook with widgets, and the state should be embedded, they by default should not have to worry about saving the widget state, nor do they want the state of 'stale' (unused) widgets in the notebook output.

Proposed Solution

Similar to what we do on the Python side in

def _get_recursive_state(widget, store=None, drop_defaults=False):
we should simply start from all visible widgets, and collect all children, and children of children etc, till we have a consistent (small) state. By default we should store the widget state, unless the user disables it (because saving can be slow).

Maybe there are edge cases where we cannot detect the children, to protect for that we should have a method in WidgetModel to override finding the children, but I think in 99.99% I can find them.

Related #2598

cc @martinRenou

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions