Skip to content

Commit 7520167

Browse files
committed
Fix more PR comments
1 parent 6a056ca commit 7520167

File tree

9 files changed

+11
-4816
lines changed

9 files changed

+11
-4816
lines changed

workflow-trace-viewer/docs/demo.gif

-730 KB
Binary file not shown.
-431 KB
Binary file not shown.
-217 KB
Binary file not shown.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal data class NodeUpdate(
2121
past == null -> NodeState.NEW
2222
current.props != past.props -> NodeState.PROPS_CHANGED
2323
current.state != past.state -> NodeState.STATE_CHANGED
24-
else -> NodeState.CHILDREN_CHANGED
24+
else -> NodeState.RENDERED
2525
}
2626

2727
return NodeUpdate(current, past, state)
@@ -33,6 +33,6 @@ internal enum class NodeState(val color: Color) {
3333
NEW(Color(0x804CAF50)), // green
3434
STATE_CHANGED(Color(0xFFE57373)), // red
3535
PROPS_CHANGED(Color(0xFFFF8A65)), // orange
36-
CHILDREN_CHANGED(Color(0x802196F3)), // blue
36+
RENDERED(Color(0x802196F3)), // blue
3737
UNCHANGED(Color.LightGray.copy(alpha = 0.3f)),
3838
}

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
@@ -62,7 +62,6 @@ internal fun RightInfoPanel(
6262
.clip(CircleShape)
6363
.background(Color.White)
6464
.padding(8.dp)
65-
.size(40.dp)
6665
.align(Alignment.Top)
6766
) {
6867
Icon(

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,32 @@ internal fun FileDump(
2424
trace: String,
2525
modifier: Modifier = Modifier
2626
) {
27+
var filePath by remember { mutableStateOf("") }
2728
var clicked by remember { mutableStateOf(false) }
2829
Button(
2930
modifier = modifier.padding(16.dp),
3031
shape = CircleShape,
3132
colors = buttonColors(Color.Black),
3233
onClick = {
3334
clicked = true
34-
writeToFile(trace)
35+
filePath = writeToFile(trace)
3536
}
3637
) {
3738
val text = if (clicked) {
38-
"Trace saved to Downloads"
39+
"Trace saved to $filePath"
3940
} else {
4041
"Save trace to file"
4142
}
4243
Text(
4344
text = text,
44-
color = Color.White
45+
color = Color.White,
46+
maxLines = 3,
47+
softWrap = true
4548
)
4649
}
4750
}
4851

49-
private fun writeToFile(trace: String) {
52+
private fun writeToFile(trace: String): String{
5053
val timestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss"))
5154
val home = System.getProperty("user.home")
5255
val path = "$home/Downloads/workflow-trace_$timestamp.json".toPath()
@@ -58,4 +61,6 @@ private fun writeToFile(trace: String) {
5861
bufferedSink.writeUtf8("]")
5962
}
6063
}
64+
65+
return path.toString()
6166
}

workflow-trace-viewer/src/jvmMain/resources/workflow-20.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)