Skip to content

Commit 54e15a3

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

File tree

9 files changed

+15
-4817
lines changed

9 files changed

+15
-4817
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: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.squareup.workflow1.traceviewer.ui.control
22

33
import androidx.compose.foundation.layout.padding
4+
import androidx.compose.foundation.layout.widthIn
45
import androidx.compose.foundation.shape.CircleShape
56
import androidx.compose.material.Button
67
import androidx.compose.material.ButtonDefaults.buttonColors
@@ -24,29 +25,34 @@ internal fun FileDump(
2425
trace: String,
2526
modifier: Modifier = Modifier
2627
) {
28+
var filePath by remember { mutableStateOf("") }
2729
var clicked by remember { mutableStateOf(false) }
2830
Button(
29-
modifier = modifier.padding(16.dp),
31+
modifier = modifier
32+
.padding(16.dp)
33+
.widthIn(max = 300.dp),
3034
shape = CircleShape,
3135
colors = buttonColors(Color.Black),
3236
onClick = {
3337
clicked = true
34-
writeToFile(trace)
38+
filePath = writeToFile(trace)
3539
}
3640
) {
3741
val text = if (clicked) {
38-
"Trace saved to Downloads"
42+
"Trace saved to $filePath"
3943
} else {
4044
"Save trace to file"
4145
}
4246
Text(
4347
text = text,
44-
color = Color.White
48+
color = Color.White,
49+
maxLines = 3,
50+
softWrap = true
4551
)
4652
}
4753
}
4854

49-
private fun writeToFile(trace: String) {
55+
private fun writeToFile(trace: String): String{
5056
val timestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss"))
5157
val home = System.getProperty("user.home")
5258
val path = "$home/Downloads/workflow-trace_$timestamp.json".toPath()
@@ -58,4 +64,6 @@ private fun writeToFile(trace: String) {
5864
bufferedSink.writeUtf8("]")
5965
}
6066
}
67+
68+
return path.toString()
6169
}

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

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

0 commit comments

Comments
 (0)