Skip to content

Commit 370d1c7

Browse files
committed
Clean up comments
1 parent 7481f36 commit 370d1c7

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
@@ -30,7 +30,7 @@ internal suspend fun parseTrace(
3030
val workflowAdapter = createMoshiAdapter()
3131
val parsedRenderPasses = try {
3232
workflowAdapter.fromJson(jsonString) ?: return ParseResult.Failure(
33-
IllegalArgumentException("The provided file does not contain a valid trace.")
33+
IllegalArgumentException("Provided trace file is empty or malformed.")
3434
)
3535
/*
3636
this parsing method can never be called without a provided file, so we can assume that there
@@ -94,8 +94,11 @@ private fun buildTree(node: Node, childrenByParent: Map<String, List<Node>>): No
9494
}
9595

9696
/**
97-
* Every new frame starts with the same roots as the main tree, so we can do a simple traversal to
98-
* add any missing child nodes from the frame.
97+
* Every new frame starts with the same roots as the main tree, so we can fold each frame into the
98+
* current tree, add all the missing children or replace any new ones, and then store the newly
99+
* merged tree.
100+
*
101+
* @return Node the newly formed tree with the frame merged into it.
99102
*/
100103
internal fun mergeFrameIntoMainTree(
101104
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)