Skip to content

move default dashboard setting to user settings #25702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bramkragten
Copy link
Member

@bramkragten bramkragten commented Jun 5, 2025

Proposed change

Following the sidebar settings that are moved to the user settings, also move the setting for default dashboard to user settings.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@dcapslock
Copy link
Contributor

Which version are you targetting this PR for? There will be many custom components including Browser Mod that will need updating. I believe this should also be marked as breaking as currently there will be users who will have different Dashboards set as default for different devices for the same user, which is entirely possible with the existing standard UI and storage in localStorage.

@bramkragten
Copy link
Member Author

Which version are you targetting this PR for? There will be many custom components including Browser Mod that will need updating. I believe this should also be marked as breaking as currently there will be users who will have different Dashboards set as default for different devices for the same user, which is entirely possible with the existing standard UI and storage in localStorage.

We are targeting the june release, so it goes in the same release as the sidebar changes that will have the same change.

@bramkragten bramkragten requested a review from piitaya June 10, 2025 08:37
@bramkragten bramkragten marked this pull request as ready for review June 10, 2025 08:37
@bramkragten bramkragten added this to the 2025.6 milestone Jun 10, 2025
@dcapslock
Copy link
Contributor

We are targeting the june release, so it goes in the same release as the sidebar changes that will have the same change.

So that is tomorrow (11th June?).

@bramkragten
Copy link
Member Author

Yes

@dcapslock
Copy link
Contributor

dcapslock commented Jun 10, 2025

The PR has not been reviewed, nor has the beta discussion mentioned changes for defaultPanel, only Sidebar Settings, for which I have made allowances and have a beta of Browser Mod with required changes. However now I will need to speed through custom component changes based on a PR that is yet to be reviewed and so may change. I find this all a bit rushed and no chance to adjust custom components to work with the change. This should be delayed until a June point release.

Copy link
Member

@piitaya piitaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have this issue when open the sidebar on my safari browser. But I don't have in with my Chrome browser (I guess it depends of the value in the local storage)

[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'this.hass.sidebar.panelOrder')
	(fonction anonyme) (reactive-element.js:280)
[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'this.hass.sidebar.panelOrder')
	performUpdate (reactive-element.js:280)
	scheduleUpdate (reactive-element.js:765)
	(fonction anonyme) (reactive-element.js:738)

I guess the sidebar object can be undefined...

EDIT : Looks like it was a cache issue on my side...

Also, some wording needs to be adapted : "Set as default on this device"

CleanShot 2025-06-10 at 11 13 14

@dcapslock
Copy link
Contributor

dcapslock commented Jun 10, 2025

@bramkragten I have looked at the PR and have some review points for consideration.

  1. frontend/set_user_data has "sidebar" as a value that can be set. After Save sidebar in user data #25555 I could clear Sidebar settings by calling the api with sidebar: {}. Now that defaultPanel is part of "sidebar" I have to decide what to do with defaulPanel when I just want to clear sidebar settings (or vice versa if dealing with defaultPanel). [The rationale here to provide Browser Mod users a way to clear user settings so to fallback to locaStorage which Browser Mod uses for per device/browser and global Sidebar settings.]
  2. defaultPanel and sidebar are different elements. Sidebar does use defaultPanel information to show icons, but defaultPanel is not exclusive to Sidebar information. Having defaultPanel as part of the "sidebar" vale does not make real sense to me. They should be able to be managed independently as far as storing, clearing etc.
  3. Demo will need update like Fix sidebar loading and demo #25606
  4. I am still getting my head around how <home-assistant> first deals with defaultPanel, then panel resolver does, which after this PR would be reading via frontend/get_user_data. I am not sure what the outcome is leaving getStorageDefaultPanelUrlPath reading from local storage, but panel/sidebar reading from user data?

Thank you for your time to consider these reveiw points.

@bramkragten
Copy link
Member Author

I kind of agree with your 2 point, and was thinking the same.

But your first point, sorry, we just really don't support this, and I would like to ask you not to mess with stuff like this, as it will likely break, and then users will blame us...

@frenck frenck removed this from the 2025.6 milestone Jun 10, 2025
@dcapslock
Copy link
Contributor

But your first point, sorry, we just really don't support this, and I would like to ask you not to mess with stuff like this, as it will likely break, and then users will blame us...

How else can a user clear their sidebar settings back to default? If there was a way for a user to do this then we can instruct them to use that way.

@MindFreeze MindFreeze marked this pull request as draft June 11, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants