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
Detailed steps to reproduce the issue on a fresh Nova installation:
If you navigate to Example A resource details screen and collapse the Settings panel
nova.panels.Settings.collapsed is written to local storage with a value of true
Navigate to Example B resource details screen and the Settings panel will be collapsed
This is because it ends up using the same nova.panels.Settings.collapsed key
Proposed solution
The resource uriKey should be included in the localStorage key?
Additional request
Another issue is if we are on a multi language application where the panel label is translated.
For a simple example:
English: Settings
Other: Sëttïngs
Then because the key is being generated using the translated panel name if a user switches language they are going to lose all their collapsed panels because the key is changed between languages.
English key: nova.panels.Settings.collapsed
Other: nova.panels.Sëttïngs.collapsed
It would be helpful, if you allowed us to provide an attribute like we do for all other fields to the Panel which when it is provided will prefer to use that in the local storage key rather than the panel name. For example:
Panels already have a slug property, but you're right, we do currently use the name in the localStorage key. Changing this would technically be a breaking change, but seems harmless enough that we could do it in a patch release.
@davidhemphill thanks for looking at this. Would be nice DX if you could make it possible to set the attribute via a fluent method too? Happy if you disagree though 😜
Description:
Say you have these two resources with collapsable panels:
Detailed steps to reproduce the issue on a fresh Nova installation:
Example A
resource details screen and collapse theSettings
panelnova.panels.Settings.collapsed
is written to local storage with a value oftrue
Example B
resource details screen and theSettings
panel will be collapsednova.panels.Settings.collapsed
keyProposed solution
The resource
uriKey
should be included in the localStorage key?Additional request
Another issue is if we are on a multi language application where the panel label is translated.
For a simple example:
Then because the key is being generated using the translated panel name if a user switches language they are going to lose all their collapsed panels because the key is changed between languages.
nova.panels.Settings.collapsed
nova.panels.Sëttïngs.collapsed
It would be helpful, if you allowed us to provide an
attribute
like we do for all other fields to thePanel
which when it is provided will prefer to use that in the local storage key rather than the panel name. For example:The text was updated successfully, but these errors were encountered: