Raxol.UI.Components.Dashboard.LayoutPersistence (Raxol v0.4.0)

View Source

Handles saving and loading dashboard widget layouts to disk.

Summary

Functions

Loads the widget layout from the file. Returns the list of widget configurations [map()] or nil if load fails or file doesn't exist.

Saves the current widget layout (list of widget configs) to a file.

Functions

load_layout()

@spec load_layout() :: [map()] | nil

Loads the widget layout from the file. Returns the list of widget configurations [map()] or nil if load fails or file doesn't exist.

save_layout(widgets)

@spec save_layout([map()]) :: :ok | {:error, term()}

Saves the current widget layout (list of widget configs) to a file.

Only saves fields essential for reconstructing the layout and widget state: :id, :type, :title, :grid_spec, :component_opts, :data.