Skip to content

refactor(web): migrate NOTE_SHOW_AUTHOR_STORAGE_KEY to useLocalStorage/useSetLocalStorage#36915

Merged
lyzno1 merged 4 commits into
langgenius:mainfrom
kuishou68:fix/issue-36898-migrate-note-show-author-to-hook
Jun 2, 2026
Merged

refactor(web): migrate NOTE_SHOW_AUTHOR_STORAGE_KEY to useLocalStorage/useSetLocalStorage#36915
lyzno1 merged 4 commits into
langgenius:mainfrom
kuishou68:fix/issue-36898-migrate-note-show-author-to-hook

Conversation

@kuishou68
Copy link
Copy Markdown
Contributor

Summary

Migrates all direct localStorage.getItem/setItem calls for NOTE_SHOW_AUTHOR_STORAGE_KEY to useLocalStorage and useSetLocalStorage hooks 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 — replaced localStorage.setItem with useSetLocalStorage<string>

Getter (useLocalStorage)

  • web/app/components/workflow/operator/hooks.ts — replaced localStorage.getItem with useLocalStorage<string>(key, '0', { raw: true }), maintaining the existing !== 'false' check

Checklist

  • TypeScript compiles with zero errors
  • All localStorage.*NOTE_SHOW_AUTHOR_STORAGE_KEY references in source files have been migrated

Closes #36898

…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>
@kuishou68 kuishou68 requested review from iamjoel and zxhlyh as code owners June 2, 2026 02:47
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. javascript Pull requests that update javascript code refactor labels Jun 2, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 2, 2026
Comment thread web/app/components/workflow/operator/hooks.ts Outdated
@lyzno1 lyzno1 enabled auto-merge June 2, 2026 03:42
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 2, 2026
@lyzno1 lyzno1 added this pull request to the merge queue Jun 2, 2026
Merged via the queue into langgenius:main with commit e530e84 Jun 2, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code lgtm This PR has been approved by a maintainer refactor size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] Move localStorage/window.localStorage to @/hooks/use-local-storage

2 participants