Skip to content

Stop forcing Discovery for hosts containing 'cfg' - #595

Merged
nassery318 merged 2 commits into
mainfrom
fix/the-connection-modal-cfg-endpoint
Nov 19, 2026
Merged

nassery318 merged 2 commits into
mainfrom
fix/the-connection-modal-cfg-endpoint

Conversation

@nassery318

Copy link
Copy Markdown
Contributor

Summary

Typing a host that contains cfg in the connection modal switched Endpoint Type to Discovery on its own, which also reset the database. The modal now keeps the endpoint type you selected. When Node is selected and the host contains cfg, it shows a hint suggesting Discovery instead. The hint spans the full Host/Port row so it doesn't wrap early.

Builds on #568 by RajGahoi.

Fixes #442

Screenshot 2026-11-19 at 11 00 05 AM

Signed-off-by: Fatehullah [C] Nassery <ufatehul@amazon.com>
@github-actions
github-actions Bot requested a review from ArgusLi November 19, 2026 16:06
@github-actions github-actions Bot added the area/frontend UI components, state, routing label Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The connection modal no longer changes endpoint type when a host contains cfg. It displays a Discovery hint when Node is selected. A test verifies that Node and database 7 remain selected through host edits and connect submission.

Changes: Connection modal cfg host behavior

Layer / File(s) Summary
Advisory hint and preserved endpoint state
apps/frontend/src/components/ui/connection-modal.tsx, apps/frontend/src/components/ui/connection-form.test.tsx
The modal no longer switches endpoint type based on the host. When Node is selected and the host contains cfg, it displays a Discovery hint. The test verifies that Node and database 7 remain selected after host edits, and that connecting dispatches Node with database 7.

Possibly related PRs

Suggested reviewers: ravjotbrar

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to dee19

Typing a host containing "cfg" no longer forces the endpoint type to Discovery or resets the selected database. The modal shows an inline hint instead. The change is small and tested, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Stop forcing Discovery for hosts containing 'cfg'" matches the main change: the connection modal no longer switches the endpoint type to Discovery when the host contains 'cfg'. The raw summ…
Description check Passed The description includes a Summary section that explains the change, the new hint behaviour, and the linked issue (#442) and prior PR (#568). It includes a screenshot, which satisfies the Change Visua…
Linked Issues check Passed [#442] The issue asks that the 'cfg' host check stop forcing Discovery and resetting the DB, or that it become advisory. At the reviewed head, the Host onChange handler in connection-modal.tsx sets on…
Out of Scope Changes check Passed The change set consists of connection-modal.tsx (Host handler no longer changes endpoint type; conditional Node/cfg Discovery hint added) and connection-form.test.tsx (new test for the hint and for pr…
Full details: Title check

Explanation

The title "Stop forcing Discovery for hosts containing 'cfg'" matches the main change: the connection modal no longer switches the endpoint type to Discovery when the host contains 'cfg'. The raw summary confirms that the auto-switch was removed and that a hint is shown for Node mode instead. The title is specific and concise.

Full details: Description check

Explanation

The description includes a Summary section that explains the change, the new hint behaviour, and the linked issue (#442) and prior PR (#568). It includes a screenshot, which satisfies the Change Visualization section of the template. The description is mostly complete. One minor inconsistency exists: the PR objectives note that the commit message says the hint text was removed, while the description still describes the hint. The description itself does not contradict the code summary, which keeps the hint.

Full details: Linked Issues check

Explanation

[#442] The issue asks that the 'cfg' host check stop forcing Discovery and resetting the DB, or that it become advisory. At the reviewed head, the Host onChange handler in connection-modal.tsx sets only host. It no longer sets endpointType, so the forced switch is removed. The modal renders an inline hint when endpointType === "node" and host.includes("cfg"), which matches the suggested fix. The hint uses col-span-2 across the Host/Port row. The reviewed head of connection-form.tsx contains no logic that sets db to 0 on an endpoint change, so the DB selection survives host edits. A new ConnectionForm test checks that Node type and DB index persist across host edits that include 'cfg'. The whole-PR text diff could not be read, so removed-code evidence comes from head file contents and the change summary. All coding requirements of #442 appear met.

Full details: Out of Scope Changes check

Explanation

The change set consists of connection-modal.tsx (Host handler no longer changes endpoint type; conditional Node/cfg Discovery hint added) and connection-form.test.tsx (new test for the hint and for preserved Node type and DB index). Both directly implement #442. The head file for connection-modal.tsx also contains an existing-looking dbHint prop. The whole-PR text diff was unavailable, so it could not be confirmed whether that prop is pre-existing or introduced here. No demonstrated unrelated change was found in the summary or head file contents.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbdfb159-107f-40e0-a8e6-2c3f4b730713
Commits

Reviewing files that changed from the base of the PR and between 3ed8311 and dee1956.

Files selected for processing: 2

  • apps/frontend/src/components/ui/connection-form.test.tsx
  • apps/frontend/src/components/ui/connection-modal.tsx
Files skipped from review as they are similar to previous changes: 2

  • apps/frontend/src/components/ui/connection-form.test.tsx
  • apps/frontend/src/components/ui/connection-modal.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

ArgusLi
ArgusLi previously approved these changes Nov 19, 2026
</div>
{connectionDetails.endpointType === "node" && connectionDetails.host.includes("cfg") && (
<Typography className="col-span-2 -mt-2" variant="bodyXs">
Hint: If this is a cluster configuration endpoint, switch Endpoint Type to Discovery.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: Let's remove the Hint: , no other tool tip has that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed Hint:

Signed-off-by: Fatehullah [C] Nassery <ufatehul@amazon.com>
@nassery318
nassery318 merged commit 858e13e into main Nov 19, 2026
10 checks passed
@ArgusLi
ArgusLi deleted the fix/the-connection-modal-cfg-endpoint branch November 25, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend UI components, state, routing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host containing 'cfg' force-switches endpoint type to Discovery (irreversible)

2 participants