Skip to content

refactor: replace NotificationCenter panel sync with shared Observable#616

Merged
datlechin merged 1 commit intomainfrom
refactor/right-panel-shared-visibility
Apr 7, 2026
Merged

refactor: replace NotificationCenter panel sync with shared Observable#616
datlechin merged 1 commit intomainfrom
refactor/right-panel-shared-visibility

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

  • Extract panel visibility (isPresented, panelWidth) from RightPanelState into RightPanelVisibility — a shared @Observable singleton
  • All windows observe the same instance, so panel state syncs automatically without NotificationCenter
  • Removes: NotificationCenter observer/poster, isSyncing boolean gate, manual observer cleanup in teardown()/deinit, UserDefaults-as-message-bus pattern
  • RightPanelState retains per-window state: editState, aiViewModel, activeTab, onSave
  • Net -53 lines

Test plan

  • Toggle right panel in one window — all windows toggle together
  • Drag panel resize handle — width persists across app restart
  • Close and reopen app — panel visibility state restored
  • Open AI chat panel via error dialog — right panel opens correctly

@datlechin datlechin merged commit d460be8 into main Apr 7, 2026
2 checks passed
@datlechin datlechin deleted the refactor/right-panel-shared-visibility branch April 7, 2026 09:21
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.

1 participant