Skip to content

split up unlock / accounts / config / shell stores#29162

Merged
chrisnojima-zoom merged 4 commits intonojima/HOTPOT-next-670-clean-2from
nojima/ZCLIENT-config-split-1
Apr 20, 2026
Merged

split up unlock / accounts / config / shell stores#29162
chrisnojima-zoom merged 4 commits intonojima/HOTPOT-next-670-clean-2from
nojima/ZCLIENT-config-split-1

Conversation

@chrisnojima-zoom
Copy link
Copy Markdown
Contributor

No description provided.

@chrisnojima chrisnojima changed the title move unlock folders part 1 split up unlock / accounts / config / shell stores Apr 20, 2026
@chrisnojima chrisnojima requested a review from Copilot April 20, 2026 13:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors application state by splitting previously config-owned concerns into dedicated stores (unlock-folders + shell), and updates desktop/native init + UI consumers accordingly.

Changes:

  • Introduces a new unlock-folders Zustand store and migrates unlock-folders UI/remote plumbing off config.
  • Introduces a new shell Zustand store (focus/activity, window state, reachability/network status, shell prefs) and migrates multiple consumers off config.
  • Moves “bootstrap configured accounts” loading logic out of the daemon store into shared init, and updates related tests.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
shared/unlock-folders/store.tsx New unlock-folders Zustand store (devices + paper key error + dispatch).
shared/unlock-folders/remote-proxy.desktop.tsx Uses unlock-folders store instead of config for remote window props.
shared/unlock-folders/main2.desktop.tsx Updates prop typing to use UnlockFolderDevice from new store.
shared/unlock-folders/index.desktop.tsx Updates prop typing to use UnlockFolderDevice from new store.
shared/unlock-folders/device-list.desktop.tsx Updates device typing to UnlockFolderDevice.
shared/stores/unlock-folders.tsx Routes engine rekey refresh events into unlock-folders store.
shared/stores/tests/unlock-folders.test.ts Updates mocks/assertions for the new unlock-folders store entrypoint.
shared/stores/tests/shell.test.ts Adds test coverage for new shell store actions/reset behavior.
shared/stores/tests/config.test.ts Updates config reset tests after moving fields out of config store.
shared/stores/shell.tsx New shell Zustand store (prefs, focus/activity, network/window state).
shared/stores/daemon.tsx Removes daemon-owned “load accounts” helper and hardcoded wait-key constant.
shared/stores/convostate.tsx Switches notification sound lookup from config to shell store.
shared/stores/config.tsx Removes shell/unlock-folders fields + actions; adds dispatch wrapper for gregor reachability updates.
shared/settings/display.tsx Moves forceSmallNav binding from config to shell store.
shared/settings/chat.tsx Moves notification sound binding from config to shell store.
shared/settings/advanced.tsx Moves useNativeFrame + openAtLogin bindings from config to shell store.
shared/router-v2/tab-bar.desktop.tsx Reads forceSmallNav from shell store.
shared/router-v2/header/index.desktop.tsx Reads useNativeFrame and window maximized state from shell store.
shared/desktop/renderer/remote-event-handler.desktop.tsx Routes window state + unlock-folders events to new shell/unlock stores.
shared/desktop/renderer/main2.desktop.tsx Initializes shell prefs (sound, small-nav, open-at-login) on startup.
shared/constants/init/shared.tsx Adds bootstrap account-loading helper and adds a shell subscription for activity changes.
shared/constants/init/push-listener.native.tsx Subscribes to mobileAppState from shell store instead of config.
shared/constants/init/index.native.tsx Migrates platform listeners for app-state + network status to shell store.
shared/constants/init/index.desktop.tsx Migrates desktop platform listeners (focus, reachability, open-at-login persistence) to shell store.
shared/constants/chat/common.tsx Reads appFocused/active from shell store for “actively looking” logic.
shared/chat/inbox/use-inbox-search.tsx Uses mobileAppState from shell store.
shared/chat/conversation/normal/container.tsx Uses active and mobileAppState from shell store.
shared/app/index.native.tsx Sends mobile app state updates to shell store instead of config.
Comments suppressed due to low confidence (1)

shared/constants/init/shared.tsx:269

  • markThreadAsRead() is triggered on any change to s.active, including transitions from active → inactive. Since active is used as a proxy for whether the user is actively looking at the app (see constants/chat/common.tsx), marking the thread as read when the user becomes inactive can incorrectly clear unread state while the user is away/idle. Consider gating this to only run when becoming active (and possibly when appFocused is true).
    useShellState.subscribe((s, old) => {
      if (s.active !== old.active) {
        const cs = getConvoState(getSelectedConversation())
        cs.dispatch.markThreadAsRead()
      }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread shared/unlock-folders/store.tsx Outdated
@chrisnojima-zoom chrisnojima-zoom merged commit c4310a2 into nojima/HOTPOT-next-670-clean-2 Apr 20, 2026
@chrisnojima-zoom chrisnojima-zoom deleted the nojima/ZCLIENT-config-split-1 branch April 20, 2026 13:45
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