refactor(web): migrate NOTE_SHOW_AUTHOR_STORAGE_KEY to useLocalStorage/useSetLocalStorage#36915
Merged
lyzno1 merged 4 commits intoJun 2, 2026
Conversation
…e/useSetLocalStorage Migrates direct localStorage.getItem/setItem calls for NOTE_SHOW_AUTHOR_STORAGE_KEY to useLocalStorage and useSetLocalStorage hooks from @/hooks/use-local-storage. Changes: - note-node/hooks.ts: replaced localStorage.setItem with useSetLocalStorage - operator/hooks.ts: replaced localStorage.getItem with useLocalStorage Closes langgenius#36898 Co-authored-by: lingxiu58 <86288566+lingxiu58@users.noreply.github.com> Co-authored-by: pojian68 <232320289+pojian68@users.noreply.github.com> Signed-off-by: Cocoon-Break <54054995+kuishou68@users.noreply.github.com>
6 tasks
lyzno1
reviewed
Jun 2, 2026
lyzno1
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates all direct
localStorage.getItem/setItemcalls forNOTE_SHOW_AUTHOR_STORAGE_KEYtouseLocalStorageanduseSetLocalStoragehooks from@/hooks/use-local-storage.This is part of the broader refactor tracked in #36898 — one storage concern at a time.
Changes
2 source files touched, both using
{ raw: true }option for raw string storage:Setter-only (useSetLocalStorage)
web/app/components/workflow/note-node/hooks.ts— replacedlocalStorage.setItemwithuseSetLocalStorage<string>Getter (useLocalStorage)
web/app/components/workflow/operator/hooks.ts— replacedlocalStorage.getItemwithuseLocalStorage<string>(key, '0', { raw: true }), maintaining the existing!== 'false'checkChecklist
localStorage.*NOTE_SHOW_AUTHOR_STORAGE_KEYreferences in source files have been migratedCloses #36898