Skip to content

Commit 761c987

Browse files
committed
clean up imports and comments to ready PR
1 parent 35567b1 commit 761c987

File tree

5 files changed

+10
-41
lines changed

5 files changed

+10
-41
lines changed

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
11
package com.squareup.workflow1.traceviewer
22

3-
import androidx.compose.foundation.background
43
import androidx.compose.foundation.layout.Box
5-
import androidx.compose.foundation.layout.fillMaxSize
6-
import androidx.compose.foundation.layout.padding
7-
import androidx.compose.foundation.layout.size
8-
import androidx.compose.foundation.shape.CircleShape
9-
import androidx.compose.material.Button
10-
import androidx.compose.material.ButtonDefaults.buttonColors
114
import androidx.compose.material.Text
125
import androidx.compose.runtime.Composable
136
import androidx.compose.runtime.LaunchedEffect
147
import androidx.compose.runtime.mutableStateOf
158
import androidx.compose.runtime.remember
16-
import androidx.compose.ui.Alignment
17-
import androidx.compose.ui.graphics.Color
18-
import androidx.compose.ui.unit.dp
19-
import androidx.compose.ui.Modifier
20-
import androidx.compose.ui.unit.sp
219
import io.github.vinceglb.filekit.PlatformFile
22-
import io.github.vinceglb.filekit.dialogs.FileKitType
23-
import io.github.vinceglb.filekit.dialogs.compose.rememberFilePickerLauncher
2410
import io.github.vinceglb.filekit.readString
2511

26-
2712
@Composable
2813
public fun App() {
2914
Box {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public fun SandboxBackground(
4545
event.changes.forEach { it.consume() }
4646
}
4747

48-
// panning: this tracks multiple events within one gesture to see what the user is doing, then calculates the offset and pans the screen accordingly
48+
// panning: this tracks multiple events within one gesture to see what the user is doing,
49+
// then calculates the offset and pans the screen accordingly
4950
val drag = event.changes.firstOrNull()
5051
if (drag != null && drag.pressed) {
5152
var prev = drag.position

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
package com.squareup.workflow1.traceviewer
22

3-
import androidx.compose.foundation.background
43
import androidx.compose.foundation.layout.Box
54
import androidx.compose.foundation.layout.fillMaxSize
65
import androidx.compose.foundation.layout.padding
7-
import androidx.compose.foundation.layout.size
86
import androidx.compose.foundation.shape.CircleShape
97
import androidx.compose.material.Button
108
import androidx.compose.material.ButtonDefaults.buttonColors
119
import androidx.compose.material.Text
1210
import androidx.compose.runtime.Composable
13-
import androidx.compose.runtime.LaunchedEffect
14-
import androidx.compose.runtime.mutableStateOf
15-
import androidx.compose.runtime.remember
1611
import androidx.compose.ui.Alignment
12+
import androidx.compose.ui.Modifier
1713
import androidx.compose.ui.graphics.Color
1814
import androidx.compose.ui.unit.dp
19-
import androidx.compose.ui.Modifier
2015
import androidx.compose.ui.unit.sp
2116
import io.github.vinceglb.filekit.PlatformFile
2217
import io.github.vinceglb.filekit.dialogs.FileKitType

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import java.io.IOException
77

88
/**
99
* Parses a JSON string into [WorkflowNode] with Moshi adapters
10-
* All the caught exceptions should be handled by the caller, and appropriate UI feedback should be provided to user
1110
*
11+
* All the caught exceptions should be handled by the caller, and appropriate UI feedback should be
12+
* provided to user
1213
*/
1314
public fun FetchRoot(json: String): WorkflowNode? {
1415
return try{

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

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Arrangement
66
import androidx.compose.foundation.layout.Box
77
import androidx.compose.foundation.layout.Column
88
import androidx.compose.foundation.layout.Row
9-
import androidx.compose.foundation.layout.Spacer
109
import androidx.compose.foundation.layout.fillMaxSize
1110
import androidx.compose.foundation.layout.padding
1211
import androidx.compose.material.Text
@@ -19,28 +18,17 @@ import androidx.compose.ui.graphics.Color
1918
import androidx.compose.ui.unit.dp
2019

2120
/**
22-
* Since the logic of Workflow is hierarchical (where each workflow may have parent workflows and/or children workflows,
23-
* a tree structure is most appropriate for representing the data rather than using flat data structures like an array.
21+
* Since the logic of Workflow is hierarchical (where each workflow may have parent workflows and/or
22+
* children workflows, a tree structure is most appropriate for representing the data rather than
23+
* using flat data structures like an array.
2424
*
2525
* TBD what more metadata should be involved with each node, e.g. (props, states, # of render passes)
2626
*/
2727
public data class WorkflowNode (
2828
val id: String,
2929
val name: String,
3030
val children: List<WorkflowNode>
31-
) {
32-
// fun findParentForId(id: String): WorkflowNode? {
33-
// if (this.id == id) {
34-
// return null // This is the root node, so it has no parent
35-
// }
36-
// if (children.any { it.id == id }) {
37-
// return this
38-
// }
39-
// return children.firstNotNullOfOrNull {
40-
// it.findParentForId(id)
41-
// }
42-
// }
43-
}
31+
)
4432

4533
/**
4634
* Since the workflow nodes present a tree structure, we utilize a recursive function to draw the tree
@@ -73,8 +61,7 @@ public fun DrawWorkflowTree(
7361
}
7462

7563
/**
76-
* Basic data, for now.
77-
* These can be designed to be clickable and be expanded to show more information.
64+
* A basic box that represents a workflow node
7865
*/
7966
@Composable
8067
private fun drawNode(

0 commit comments

Comments
 (0)