Skip to content

Commit 3a6fcab

Browse files
authored
Merge pull request #31 from coder/fix-recent-connections-action-button
- Fix: regression in opening a recent connection - Fix: horizontal resize hides the new connection action button
2 parents f436b9d + 3b47a7c commit 3a6fcab

File tree

1 file changed

+27
-29
lines changed

1 file changed

+27
-29
lines changed

src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

+27-29
Original file line numberDiff line numberDiff line change
@@ -62,39 +62,36 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
6262
label(CoderGatewayBundle.message("gateway.connector.recentconnections.title")).applyToComponent {
6363
font = JBFont.h3().asBold()
6464
}
65-
panel {
66-
row {
67-
searchBar = cell(SearchTextField(false)).applyToComponent {
68-
minimumSize = Dimension(350, -1)
69-
textEditor.border = JBUI.Borders.empty(2, 5, 2, 0)
70-
addDocumentListener(object : DocumentAdapter() {
71-
override fun textChanged(e: DocumentEvent) {
72-
val toSearchFor = this@applyToComponent.text
73-
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ?: false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ?: false }
74-
updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
75-
}
76-
})
77-
}.component
65+
label("").resizableColumn().horizontalAlign(HorizontalAlign.FILL)
66+
searchBar = cell(SearchTextField(false)).applyToComponent {
67+
minimumSize = Dimension(350, -1)
68+
textEditor.border = JBUI.Borders.empty(2, 5, 2, 0)
69+
addDocumentListener(object : DocumentAdapter() {
70+
override fun textChanged(e: DocumentEvent) {
71+
val toSearchFor = this@applyToComponent.text
72+
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ?: false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ?: false }
73+
updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
74+
}
75+
})
76+
}.component
7877

79-
actionButton(
80-
object : DumbAwareAction(CoderGatewayBundle.message("gateway.connector.recentconnections.new.wizard.button.tooltip"), null, AllIcons.General.Add) {
81-
override fun actionPerformed(e: AnActionEvent) {
78+
actionButton(
79+
object : DumbAwareAction(CoderGatewayBundle.message("gateway.connector.recentconnections.new.wizard.button.tooltip"), null, AllIcons.General.Add) {
80+
override fun actionPerformed(e: AnActionEvent) {
81+
rootPanel.apply {
82+
removeAll()
83+
addToCenter(CoderGatewayConnectorWizardWrapperView {
8284
rootPanel.apply {
8385
removeAll()
84-
addToCenter(CoderGatewayConnectorWizardWrapperView {
85-
rootPanel.apply {
86-
removeAll()
87-
addToCenter(contentPanel)
88-
updateUI()
89-
}
90-
}.component)
86+
addToCenter(contentPanel)
9187
updateUI()
9288
}
93-
}
94-
},
95-
).gap(RightGap.SMALL)
96-
}
97-
}.horizontalAlign(HorizontalAlign.RIGHT)
89+
}.component)
90+
updateUI()
91+
}
92+
}
93+
},
94+
).gap(RightGap.SMALL)
9895
}.bottomGap(BottomGap.MEDIUM)
9996
separator(background = WelcomeScreenUIManager.getSeparatorColor())
10097
row {
@@ -145,7 +142,8 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
145142
"project_path" to connectionDetails.projectPath!!,
146143
"ide_product_code" to product.productCode,
147144
"ide_build_number" to "${connectionDetails.ideBuildNumber}",
148-
"ide_download_link" to "${connectionDetails.downloadSource}"
145+
"ide_download_link" to "${connectionDetails.downloadSource}",
146+
"web_terminal_link" to "${connectionDetails.webTerminalLink}"
149147
)
150148
)
151149
}

0 commit comments

Comments
 (0)