[PR #81] [MERGED] Use default settings listed in settingsStructure instead of hardcoding default values #114

Closed
opened 2026-02-28 15:42:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/usenocturne/nocturne-ui/pull/81
Author: @angelolz
Created: 1/23/2025
Status: Merged
Merged: 2/17/2025
Merged by: @brandonsaldan

Base: mainHead: feature/fix-default-settings


📝 Commits (5)

  • 2fb617c use settingStructure default value instead of hardcoding
  • 84e4e00 fixed lyric gesture bug
  • 105ae10 reorganized settings to put related ones together
  • 87240a5 fix(pr): update wording to clarify what is being signed out of
  • 1c53475 Merge branch 'main' into feature/fix-default-settings

📊 Changes

7 files changed (+299 additions, -240 deletions)

View changed files

src/components/settings/AccountInfo.jsx (+25 -0)
📝 src/components/settings/Settings.jsx (+249 -227)
📝 src/hooks/useElapsedTime.js (+7 -4)
📝 src/hooks/useLyrics.js (+4 -2)
📝 src/hooks/useNowPlaying.js (+9 -5)
📝 src/hooks/useTrackScroll.js (+4 -2)
📝 src/pages/now-playing.jsx (+1 -0)

📄 Description

This PR updates the logic to use the defaultValue specified in the settingsStructure instead of hardcoding default values when a hook retrieves a setting from localStorage and encounters a null value.

I wasn't able to use the settingsStructure object directly as I would need to have a way to traverse to the right item and get its defaultValue. What I did instead is make a getDefaultSettingValue function so that retrieving it will look cleaner. I would like to know if you have a better way of handling this!

  • AccountInfo has been moved to its own component file
  • Signing out will also clear all the settings
    • Changed the text to specify that ALL settings (not just authentication) will be cleared.
  • Fixed a bug I discovered for the show lyric swipe gesture
    • If "Show Lyric Option" is disabled and the Swipe to Show Lyrics option is enabled, there would be no way to hide the lyrics after doing the gesture.
    • This bug fix also rearranges the playback setting items to put the lyrics menu option and show lyrics gesture option together.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/usenocturne/nocturne-ui/pull/81 **Author:** [@angelolz](https://github.com/angelolz) **Created:** 1/23/2025 **Status:** ✅ Merged **Merged:** 2/17/2025 **Merged by:** [@brandonsaldan](https://github.com/brandonsaldan) **Base:** `main` ← **Head:** `feature/fix-default-settings` --- ### 📝 Commits (5) - [`2fb617c`](https://github.com/usenocturne/nocturne-ui/commit/2fb617c401d7f8bd16a01dbbe8af9419c8ee8769) use settingStructure default value instead of hardcoding - [`84e4e00`](https://github.com/usenocturne/nocturne-ui/commit/84e4e0069aecedc860cc0750bf25ea3ffd67d1d8) fixed lyric gesture bug - [`105ae10`](https://github.com/usenocturne/nocturne-ui/commit/105ae1071d6146cadbb3258b1d10c60d78682bda) reorganized settings to put related ones together - [`87240a5`](https://github.com/usenocturne/nocturne-ui/commit/87240a5b8302d6887aeb922db608ff832dffa074) fix(pr): update wording to clarify what is being signed out of - [`1c53475`](https://github.com/usenocturne/nocturne-ui/commit/1c53475971e0a876f85393a5b3b17a889e5fff13) Merge branch 'main' into feature/fix-default-settings ### 📊 Changes **7 files changed** (+299 additions, -240 deletions) <details> <summary>View changed files</summary> ➕ `src/components/settings/AccountInfo.jsx` (+25 -0) 📝 `src/components/settings/Settings.jsx` (+249 -227) 📝 `src/hooks/useElapsedTime.js` (+7 -4) 📝 `src/hooks/useLyrics.js` (+4 -2) 📝 `src/hooks/useNowPlaying.js` (+9 -5) 📝 `src/hooks/useTrackScroll.js` (+4 -2) 📝 `src/pages/now-playing.jsx` (+1 -0) </details> ### 📄 Description This PR updates the logic to use the defaultValue specified in the settingsStructure instead of hardcoding default values when a hook retrieves a setting from localStorage and encounters a null value. I wasn't able to use the `settingsStructure` object directly as I would need to have a way to traverse to the right item and get its `defaultValue`. What I did instead is make a `getDefaultSettingValue` function so that retrieving it will look cleaner. I would like to know if you have a better way of handling this! - AccountInfo has been moved to its own component file - Signing out will also clear all the settings - Changed the text to specify that ALL settings (not just authentication) will be cleared. - Fixed a bug I discovered for the show lyric swipe gesture - If "Show Lyric Option" is disabled and the Swipe to Show Lyrics option is enabled, there would be no way to hide the lyrics after doing the gesture. - This bug fix also rearranges the playback setting items to put the lyrics menu option and show lyrics gesture option together. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 15:42:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nocturne-ui#114
No description provided.