Skip to content

fix: hook deps without exhaustive-deps disables - #931

Merged
EVWorth merged 3 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h
Oct 30, 2026
Merged

EVWorth merged 3 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h

Conversation

@EVWorth

@EVWorth EVWorth commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Done by the implementer-frontend lane. After this and #927, no react-hooks/exhaustive-deps disables are left in app code.

Closes #930

Changes

  • FormatterSettingsDialog. The dialog should reset its fields only when it opens, which is why the effect had only isOpen as a dependency. Adding the setting it also read would have wiped in-progress edits whenever the saved settings changed. The effect is replaced with React's "adjust state when a prop changes" pattern, so the file no longer has an effect at all.
  • SchemaTree preload. The effect was keyed on the joined database names but looped over the databases array. That array is rebuilt on every render, so listing it as a dependency made a failing load retry forever. The effect now reads the names back from the key it depends on.
  • useTreeNavigation. The effect ran after every render so that it would notice when the focused row disappeared. It is now a layout effect keyed on activeKey, plus a MutationObserver on the tree. This also catches a row removed by a child component that re-renders on its own, which the old version missed.
  • Stale directive. Removed the unused no-unused-expressions disable in src/types/__tests__/index.test.ts.

Tests

  • New tests, each confirmed to fail against the wrong dependency list:
    • the dialog drops cancelled edits when it reopens;
    • the dialog keeps in-progress edits while the saved settings change;
    • the tree falls back to the first row when the focused row's parent closes.
  • The existing "tries a failing folder once per database, not in a loop" test covers the SchemaTree change. With the old dependency list it hangs instead of finishing.
  • npm run test:unit: 3730 tests pass. SchemaTree and FormatterSettingsDialog tests ran 5 times in a row, all passing.
  • Browser tests, one file at a time: QueryToolbar, AppLayout and Sidebar all pass.
  • Lint: 0 errors, warnings down from 158 to 157. type-check and dprint are clean, including after merging main with fix: SQLite foreign keys, mock version, import deps #927.

Generated by Claude Code

The reset ran in an effect that listed only isOpen, with the dependency
check switched off. It now runs while rendering, when isOpen changes, so
it still resets only on opening and keeps in-progress edits if the saved
settings change while the dialog is open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The filter preload depended on a key built from the database names but
read the array; it now reads the names back out of the key. The tree
navigation fallback ran after every render to notice a vanished tab
stop; it now watches the tree's rows with a MutationObserver keyed on
the active row, which also sees rows a child removes on its own. Drops
an unused eslint-disable directive in a types test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g

Closes #930
@EVWorth
EVWorth merged commit db3a3b7 into main Oct 30, 2026
12 checks passed
@EVWorth
EVWorth deleted the claude/hopeful-bardeen-1k4d1h branch October 30, 2026 12:01
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026
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.

chore: remaining exhaustive-deps disables

2 participants