You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): SSH rows show IPv6 hosts with a port in brackets - #44747
A saved SSH environment with an IPv6 host and a port shows its address without brackets. The SSH add form accepts [::1]:2222 and stores host ::1 with port 2222, but the Environments row then reads SSH root@::1:2222. That looks like a different host, ::1:2222, with no port. The Add environment SSH list shows known_hosts entries the same way: [2001:db8::10]:2222 appears as 2001:db8::10:2222.
Change
formatDesktopSshTarget now puts brackets around a host that contains : when it shows a port, so the label reads root@[::1]:2222. With no port, an IPv6 host stays ::1, and named or IPv4 hosts don't change.
Scope
This is a small, obvious display bug, so no issue was filed. The change is one function in apps/web/src/components/settings/EnvironmentRow.tsx, plus tests. The Add environment dialog uses the same text to compare discovered hosts with saved ones. Both sides change together, so a match stays a match.
Verification
New tests in ConnectionsSettings.logic.test.ts:
{ username: "root", hostname: "::1", port: 2222 } gives root@[::1]:2222, and parseManualDesktopSshTarget reads that back as user root, host ::1, port 2222. With the old function the test fails: Expected: "root@[::1]:2222", Received: "root@::1:2222". The old label reads back as host ::1:2222 with no port.
With no port, host ::1 stays ::1, and devbox with port 2222 still gives root@devbox:2222.
Setup: Linux desktop build on each commit, light theme, fresh isolated data. One saved SSH environment (root, ::1, port 2222) and one known_hosts line [2001:db8::10]:2222. Steps: Settings → Environments → List → Add environment → SSH → open the host list.
Before (d838e95)
After (5c67e21)
Environments row
Row reads SSH root@::1:2222
Row reads SSH root@[::1]:2222
SSH host list
Host list reads 2001:db8::10:2222
Host list reads [2001:db8::10]:2222
Not shown
No live SSH connection. The saved environment was loaded from the desktop app's saved-environments file, and the test sandbox made no SSH connection, so the row shows a "did not answer" line. The label comes from the saved target, not from the connection.
Reviewing files that changed from the base of the PR and between 5c67e21 and 15a6c0d.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The SSH target formatter now brackets IPv6 hostnames when a port is present. Tests cover IPv6 targets with and without ports, named hosts, and parsing a formatted target.
Changes: SSH target formatting
Layer / File(s)
Summary
Format and verify SSH targets apps/web/src/components/settings/EnvironmentRow.tsx, apps/web/src/components/settings/ConnectionsSettings.logic.test.ts
The formatter brackets colon-containing hostnames when a port is present. Tests check IPv6 and named-host formatting, and verify parsed values for a bracketed target.
This change makes IPv6 SSH addresses with a port display unambiguously, for example root@[::1]:2222. Other host formats are unchanged and tests cover the new behavior, so merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: SSH rows now show IPv6 hosts with a port in brackets. The raw summary and objectives confirm that formatDesktopSshTarget brackets IPv6 hosts when a port is shown, and …
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug and reproduction context. The Change section explains the fix and the …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: SSH rows now show IPv6 hosts with a port in brackets. The raw summary and objectives confirm that formatDesktopSshTarget brackets IPv6 hosts when a port is shown, and that tests were added for this. The title follows a conventional commit format with a clear scope.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug and reproduction context. The Change section explains the fix and the unchanged cases. The Scope section explains why no issue was filed and names the one function changed. The Verification section lists the new tests with observed failure output and includes before/after screenshots and a setup/steps table. It does not include the model and harness line in the template's closing comment, though the author did add 'Generated with Gemini 4 Neon in T3 Code Nightly' at the end. The description also notes that no live SSH connection was made.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A saved SSH environment with an IPv6 host and a port shows its address without brackets. The SSH add form accepts
[::1]:2222and stores host::1with port2222, but the Environments row then readsSSH root@::1:2222. That looks like a different host,::1:2222, with no port. The Add environment SSH list showsknown_hostsentries the same way:[2001:db8::10]:2222appears as2001:db8::10:2222.Change
formatDesktopSshTargetnow puts brackets around a host that contains:when it shows a port, so the label readsroot@[::1]:2222. With no port, an IPv6 host stays::1, and named or IPv4 hosts don't change.Scope
This is a small, obvious display bug, so no issue was filed. The change is one function in
apps/web/src/components/settings/EnvironmentRow.tsx, plus tests. The Add environment dialog uses the same text to compare discovered hosts with saved ones. Both sides change together, so a match stays a match.Verification
New tests in
ConnectionsSettings.logic.test.ts:{ username: "root", hostname: "::1", port: 2222 }givesroot@[::1]:2222, andparseManualDesktopSshTargetreads that back as userroot, host::1, port2222. With the old function the test fails:Expected: "root@[::1]:2222",Received: "root@::1:2222". The old label reads back as host::1:2222with no port.::1stays::1, anddevboxwith port2222still givesroot@devbox:2222.Setup: Linux desktop build on each commit, light theme, fresh isolated data. One saved SSH environment (
root,::1, port 2222) and oneknown_hostsline[2001:db8::10]:2222.Steps: Settings → Environments → List → Add environment → SSH → open the host list.
d838e95)5c67e21)SSH root@::1:2222SSH root@[::1]:22222001:db8::10:2222[2001:db8::10]:2222Not shown
No live SSH connection. The saved environment was loaded from the desktop app's saved-environments file, and the test sandbox made no SSH connection, so the row shows a "did not answer" line. The label comes from the saved target, not from the connection.
Generated with Gemini 4 Neon in T3 Code Nightly