Skip to content

Commit 4bcf3d2

Browse files
committed
impl: rename project_path query param to folder
1 parent 88f4cb0 commit 4bcf3d2

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
### Changed
1111

1212
- action buttons on the token input step were swapped to achieve better keyboard navigation
13+
- URI `project_path` query parameter was renamed to `folder`
1314

1415
## 0.1.3 - 2025-04-09
1516

src/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ open class CoderProtocolHandler(
169169
context.envPageManager.showEnvironmentPage(environmentId, false)
170170
val productCode = params.ideProductCode()
171171
val buildNumber = params.ideBuildNumber()
172-
val projectPath = params.projectPath()
172+
val projectFolder = params.projectFolder()
173173
if (!productCode.isNullOrBlank() && !buildNumber.isNullOrBlank()) {
174174
context.cs.launch {
175175
val ideVersion = "$productCode-$buildNumber"
@@ -179,7 +179,7 @@ open class CoderProtocolHandler(
179179
}
180180
job.join()
181181
context.logger.info("launching $ideVersion on $environmentId")
182-
context.ideOrchestrator.connectToIde(environmentId, ideVersion, projectPath)
182+
context.ideOrchestrator.connectToIde(environmentId, ideVersion, projectFolder)
183183
}
184184
}
185185
}
@@ -275,7 +275,7 @@ internal fun resolveRedirects(url: URL): URL {
275275
/**
276276
* Return the agent matching the provided agent ID or name in the parameters.
277277
* The name is ignored if the ID is set. If neither was supplied and the
278-
* workspace has only one agent, return that. Otherwise throw an error.
278+
* workspace has only one agent, return that. Otherwise, throw an error.
279279
*
280280
* @throws [IllegalArgumentException]
281281
*/
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
package com.coder.toolbox.util
22

3-
// These are keys that we support in our Gateway links and must not be changed.
4-
private const val TYPE = "type"
53
const val URL = "url"
64
const val TOKEN = "token"
75
const val WORKSPACE = "workspace"
86
const val AGENT_NAME = "agent"
97
const val AGENT_ID = "agent_id"
108
private const val IDE_PRODUCT_CODE = "ide_product_code"
119
private const val IDE_BUILD_NUMBER = "ide_build_number"
12-
private const val PROJECT_PATH = "project_path"
13-
14-
// Helper functions for reading from the map. Prefer these to directly
15-
// interacting with the map.
16-
17-
fun Map<String, String>.isCoder(): Boolean = this[TYPE] == "coder"
10+
private const val FOLDER = "folder"
1811

1912
fun Map<String, String>.url() = this[URL]
2013

@@ -30,4 +23,4 @@ fun Map<String, String>.ideProductCode() = this[IDE_PRODUCT_CODE]
3023

3124
fun Map<String, String>.ideBuildNumber() = this[IDE_BUILD_NUMBER]
3225

33-
fun Map<String, String>.projectPath() = this[PROJECT_PATH]
26+
fun Map<String, String>.projectFolder() = this[FOLDER]

0 commit comments

Comments
 (0)