Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Give theme cookie an expiration - #5429

#5429
Merged
JamesNK merged 4 commits into
mainmicrosoft/aspire:mainfrom
jamesnk/theme-cookiemicrosoft/aspire:jamesnk/theme-cookieCopy head branch name to clipboard
Aug 26, 2024
Merged

Give theme cookie an expiration#5429
JamesNK merged 4 commits into
mainmicrosoft/aspire:mainfrom
jamesnk/theme-cookiemicrosoft/aspire:jamesnk/theme-cookieCopy head branch name to clipboard

Conversation

@JamesNK

@JamesNK JamesNK commented Aug 26, 2024

Copy link
Copy Markdown
Member

Description

I noticed that Aspire dashboard sometimes lost the theme. The reason is the theme cookie had a session lifetime. Once all browsers are closed the cookie is cleared and the dashboard forgets the configured theme.

This PR:

  • Gives the cookie a 1 year expiration
  • If the theme cookie is present when the dashboard loads, it is set again to create a sliding expiration (i.e. cookie expires 1 year after the dashboard was last loaded)
  • Specifies a path when working with the cookie to be explicit about where it is set
  • Deletes the cookie if "System" is selected in the UI. No point having a cookie set and updating it if it is the default value.

image

Fixes #5430

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
      • Link to aspire-docs issue:
    • No
Microsoft Reviewers: Open in CodeFlow

Comment thread src/Aspire.Dashboard/wwwroot/js/app-theme.js
Comment thread src/Aspire.Dashboard/wwwroot/js/app-theme.js
@JamesNK
JamesNK merged commit e0042ce into main Aug 26, 2024
@JamesNK
JamesNK deleted the jamesnk/theme-cookie branch August 26, 2024 23:55
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist dashboard theme

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.