taskCompletionViewChanges protobus migration (#3588)

This commit is contained in:
canvrno authored and GitHub committed 2025-05-18 13:30:33 -07:00
1 parent 95750f8c9c
commit eb19731843
9 files changed
+51 -17

No files matched your search

+2
View File
@@ -12,6 +12,7 @@ import { exportTaskWithId } from "./exportTaskWithId"
import { getTaskHistory } from "./getTaskHistory"
import { newTask } from "./newTask"
import { showTaskWithId } from "./showTaskWithId"
import { taskCompletionViewChanges } from "./taskCompletionViewChanges"
import { taskFeedback } from "./taskFeedback"
import { toggleTaskFavorite } from "./toggleTaskFavorite"
@@ -27,6 +28,7 @@ export function registerAllMethods(): void {
registerMethod("getTaskHistory", getTaskHistory)
registerMethod("newTask", newTask)
registerMethod("showTaskWithId", showTaskWithId)
registerMethod("taskCompletionViewChanges", taskCompletionViewChanges)
registerMethod("taskFeedback", taskFeedback)
registerMethod("toggleTaskFavorite", toggleTaskFavorite)
}
@@ -0,0 +1,21 @@
import { Controller } from ".."
import { Empty } from "../../../shared/proto/common"
import { Int64Request } from "../../../shared/proto/common"
/**
* Shows task completion changes in a diff view
* @param controller The controller instance
* @param request The request containing the timestamp of the message
* @returns Empty response
*/
export async function taskCompletionViewChanges(controller: Controller, request: Int64Request): Promise<Empty> {
try {
if (request.value && controller.task) {
await controller.task.presentMultifileDiff(request.value, true)
}
return Empty.create()
} catch (error) {
console.error("Error in taskCompletionViewChanges handler:", error)
throw error
}
}