Skip to content
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

feat(ui): add hash handler for configuration ids #2002

Merged

Conversation

ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Jan 8, 2024

Description

This PR adds a hash handler to allow navigating to ids which are not normally available unless the correct tab is selected. Originally I was going to dynamically determine the closest "tab" to the element in the hash, but the element is not available unless the tab is already loaded, so I had to add a mapping of each tab to the options that they contain.

In adding this new mapping, I decided that the defaultConfig mapping could be moved to this new mapping. A small bug was also discovered and fixed when moving the defaultConfig, which was that the values that were not string encoded previously would not be evaluate properly when comparing the default value to the value in the UI.

The hash watcher can be tested by visiting https://localhost:47990/config/#encoder. This should work when the page is loaded fresh, as well as if you already on the config page and then add the #encoder hash.

Moving forward, all config options, and tabs should have a matching id, which will be referenced in the docs. See #2000.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@ReenigneArcher ReenigneArcher force-pushed the feat(ui)-add-hash-handler-for-configuration-ids branch 5 times, most recently from 1e5374d to 1a2c2f0 Compare January 8, 2024 03:27
@ReenigneArcher ReenigneArcher marked this pull request as ready for review January 8, 2024 03:28
Copy link
Collaborator

@cgutman cgutman left a comment

Choose a reason for hiding this comment

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

Seems fine to me, but you might want @TheElixZammuto to take a look too.

@ReenigneArcher ReenigneArcher force-pushed the feat(ui)-add-hash-handler-for-configuration-ids branch from 1a2c2f0 to b8d1741 Compare January 14, 2024 03:04
@ReenigneArcher ReenigneArcher merged commit 1ccda51 into nightly Jan 14, 2024
42 checks passed
@ReenigneArcher ReenigneArcher deleted the feat(ui)-add-hash-handler-for-configuration-ids branch January 14, 2024 04:46
KuleRucket pushed a commit to KuleRucket/Sunshine that referenced this pull request Jun 6, 2024
e-dong pushed a commit to e-dong/Sunshine that referenced this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants