Files
orca/src
Neil 306118dbee refactor: eliminate useEffect anti-patterns (audit pass 2) (#665)
* refactor: eliminate useEffect anti-patterns across 5 components

- MonacoEditor, RichMarkdownEditor: assign callback/prop refs directly
  during render instead of via useEffect, so ProseMirror and Monaco
  handlers always read the current closure rather than a one-render-
  stale copy.

- SettingsFormControls (FontAutocomplete): replace useEffect that reset
  highlightedIndex on filteredSuggestions/open changes with the
  "adjusting state during render" pattern (track prevOpen /
  prevFilteredSuggestions), so the correct item is highlighted on the
  same paint as the dropdown opens or the filter updates.

- ChecksPanel: replace useEffect that reset 5 local state fields on
  activeWorktreeId change with the "adjusting during render" pattern
  (track prevActiveWorktreeId), so stale title/loading UI from the
  previous worktree is cleared before the first paint of the new one.

- SshPassphraseDialog: split one useEffect that both reset form state
  and focused the input into (a) during-render state reset and (b) a
  focused DOM-only useEffect, so the cleared input is visible
  immediately rather than after a post-paint effect flush.

* fix: resync font autocomplete highlight on value change
2026-04-14 23:28:58 -07:00
..