You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/get_started/installation.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,8 @@ To get you started quickly, we provide a layout component you can copy & paste i
174
174
</Backpex.HTML.Layout.app_shell>
175
175
```
176
176
177
+
These assigns (`@current_theme`, `@sidebar_open`, `@sidebar_section_states`) are populated by `Backpex.InitAssigns` — see [Add resource routes](#add-resource-routes) below for setup.
178
+
177
179
In addition we recommend to add a bodyless function definition and to configure declarative assigns for your layout component.
Copy file name to clipboardExpand all lines: guides/upgrading/v0.19.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,10 @@ The `BackpexSidebarSections` hook has been replaced by `BackpexSidebar`, which n
85
85
86
86
## User Preferences System Overhaul
87
87
88
+
> #### Warning {: .warning}
89
+
>
90
+
> All assigns in this migration fail at render time, not compile time — `@current_theme`, `@sidebar_open`, and `@sidebar_section_states` silently fall back to defaults if missing. After each step below, verify in the browser that the feature works (toggle theme, toggle sidebar, reload page).
91
+
88
92
This version introduces a unified preference system that eliminates UI flickering. User preferences (theme, sidebar state, column visibility, etc.) are now server-rendered from a configurable storage backend on every request.
89
93
90
94
Backpex ships with a Phoenix-session adapter out of the box (matches the legacy behavior — no action needed). Route individual prefixes to a per-user database adapter when you outgrow the ~4KB cookie ceiling or need preferences to follow a user across devices. See the [User Preferences guide](../live_resource/user-preferences.md) for adapter recipes and the opt-in persistence flag for ordering / filters / columns.
Copy file name to clipboardExpand all lines: lib/backpex/html/layout.ex
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -502,12 +502,14 @@ defmodule Backpex.HTML.Layout do
502
502
503
503
attr:sidebar_section_states,:map,
504
504
default: %{},
505
-
doc: "map of section states (populated automatically from assigns if not provided)"
505
+
doc:
506
+
"map of section states. Read from the parent's `@sidebar_section_states` assign when not passed explicitly; falls back to `%{}` (all sections open by default)."
506
507
507
508
slot:inner_block
508
509
slot:label,required: true,doc: "label to be displayed on the section."
0 commit comments