Skip to content

Commit 2c50fde

Browse files
committed
Clean up comments
1 parent ad8a784 commit 2c50fde

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/App.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public fun App(
6868

6969
// The states are reset when a new file is selected.
7070
UploadFile(
71-
onFileSelect = {
71+
resetOnFileSelect = {
7272
selectedTraceFile = it
7373
selectedNode = null
7474
frameIndex = 0

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/ui/WorkflowInfoPanel.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ internal fun RightInfoPanel(
4040
selectedNode: Node?,
4141
modifier: Modifier = Modifier
4242
) {
43-
// This row is aligned to the right of the screen.
4443
Row(
4544
modifier = modifier
4645
) {

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/ui/WorkflowTree.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ internal fun RenderDiagram(
6767
}
6868

6969
if (!isLoading) {
70-
// DrawTree(frames[frameInd], affectedNodes[frameInd], onNodeSelect)
7170
DrawTree(fullTree[frameInd], affectedNodes[frameInd], onNodeSelect)
7271
}
7372
}

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/util/JsonParser.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal suspend fun parseTrace(
2424
val workflowAdapter = createMoshiAdapter()
2525
val unParsedTrace = try {
2626
workflowAdapter.fromJson(jsonString) ?: return ParseResult.Failure(
27-
IllegalArgumentException("The provided file does not contain a valid trace.")
27+
IllegalArgumentException("Provided trace file is empty or malformed.")
2828
)
2929
} catch (e: Exception) {
3030
return ParseResult.Failure(e)
@@ -81,8 +81,11 @@ private fun buildTree(node: Node, childrenByParent: Map<String, List<Node>>): No
8181
}
8282

8383
/**
84-
* Every new frame starts with the same roots as the main tree, so we can do a simple traversal to
85-
* add any missing child nodes from the frame.
84+
* Every new frame starts with the same roots as the main tree, so we can fold each frame into the
85+
* current tree, add all the missing children or replace any new ones, and then store the newly
86+
* merged tree.
87+
*
88+
* @return Node the newly formed tree with the frame merged into it.
8689
*/
8790
internal fun mergeFrameIntoMainTree(
8891
frame: Node,

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/util/UploadFile.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ import io.github.vinceglb.filekit.dialogs.compose.rememberFilePickerLauncher
2020
*/
2121
@Composable
2222
public fun UploadFile(
23-
onFileSelect: (PlatformFile?) -> Unit,
23+
resetOnFileSelect: (PlatformFile?) -> Unit,
2424
modifier: Modifier = Modifier,
2525
) {
2626
val launcher = rememberFilePickerLauncher(
2727
type = FileKitType.File(listOf("json", "txt")),
2828
title = "Select Workflow Trace File"
2929
) {
30-
onFileSelect(it)
30+
resetOnFileSelect(it)
3131
}
3232

3333
Button(

0 commit comments

Comments
 (0)