Skip to content

Extract connection activation into a shared hook - #2261

Merged
kmcginnes merged 1 commit into
mainfrom
use-activate-connection
Sep 24, 2026
Merged

kmcginnes merged 1 commit into
mainfrom
use-activate-connection

Conversation

@kmcginnes

Copy link
Copy Markdown
Collaborator

Description

  • Pulled the "switch to this connection" logic out of ConnectionRow into a useActivateConnection hook, with its own tests. No behavior change.

The connect route in Add connection links via a dedicated #/connect route activates a matching connection the same way the connections list does. Sharing one hook keeps the two from drifting, and splitting it out keeps the refactor from hiding inside a feature diff.

Validation

Clicking a connection in the connections list should still activate it and reset the graph view, exactly as before.

Related Issues

Prep for Add connection links via a dedicated #/connect route.

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

Pure refactor: the activate-and-reset logic ConnectionRow inlined moves
to its own hook so other callers can reuse it without duplicating the
no-op-when-already-active check.
@kmcginnes
kmcginnes marked this pull request as ready for review September 24, 2026 22:36
@kmcginnes
kmcginnes merged commit fc31e20 into main Sep 24, 2026
6 checks passed
@kmcginnes
kmcginnes deleted the use-activate-connection branch September 24, 2026 22:36
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