refactor: replace canvas.show with canvas.present
This commit is contained in:
@@ -282,7 +282,7 @@ class NodeRuntime(context: Context) {
|
||||
|
||||
val invokeCommands =
|
||||
buildList {
|
||||
add(ClawdisCanvasCommand.Show.rawValue)
|
||||
add(ClawdisCanvasCommand.Present.rawValue)
|
||||
add(ClawdisCanvasCommand.Hide.rawValue)
|
||||
add(ClawdisCanvasCommand.Navigate.rawValue)
|
||||
add(ClawdisCanvasCommand.Eval.rawValue)
|
||||
@@ -558,7 +558,11 @@ class NodeRuntime(context: Context) {
|
||||
}
|
||||
|
||||
return when (command) {
|
||||
ClawdisCanvasCommand.Show.rawValue -> BridgeSession.InvokeResult.ok(null)
|
||||
ClawdisCanvasCommand.Present.rawValue -> {
|
||||
val url = CanvasController.parseNavigateUrl(paramsJson)
|
||||
canvas.navigate(url)
|
||||
BridgeSession.InvokeResult.ok(null)
|
||||
}
|
||||
ClawdisCanvasCommand.Hide.rawValue -> BridgeSession.InvokeResult.ok(null)
|
||||
ClawdisCanvasCommand.Navigate.rawValue -> {
|
||||
val url = CanvasController.parseNavigateUrl(paramsJson)
|
||||
|
||||
@@ -8,7 +8,7 @@ enum class ClawdisCapability(val rawValue: String) {
|
||||
}
|
||||
|
||||
enum class ClawdisCanvasCommand(val rawValue: String) {
|
||||
Show("canvas.show"),
|
||||
Present("canvas.present"),
|
||||
Hide("canvas.hide"),
|
||||
Navigate("canvas.navigate"),
|
||||
Eval("canvas.eval"),
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.junit.Test
|
||||
class ClawdisProtocolConstantsTest {
|
||||
@Test
|
||||
fun canvasCommandsUseStableStrings() {
|
||||
assertEquals("canvas.show", ClawdisCanvasCommand.Show.rawValue)
|
||||
assertEquals("canvas.present", ClawdisCanvasCommand.Present.rawValue)
|
||||
assertEquals("canvas.hide", ClawdisCanvasCommand.Hide.rawValue)
|
||||
assertEquals("canvas.navigate", ClawdisCanvasCommand.Navigate.rawValue)
|
||||
assertEquals("canvas.eval", ClawdisCanvasCommand.Eval.rawValue)
|
||||
|
||||
Reference in New Issue
Block a user