-
Notifications
You must be signed in to change notification settings - Fork 104
Improve workflow visualizer functionality #1343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b30a565
Include a detailed view of node via side panel
wenli-cai 42eeef9
Clean up project structure
wenli-cai 7db8039
Clean up project structure
wenli-cai 6dea47e
Change file names.
wenli-cai da2da0c
Edit composables to align with their responsibilities
wenli-cai d85d0ff
Add scroll bar functionality to allow indexing different states withi…
wenli-cai bdbc65f
Bugfix with switching between different files and UI change for top row
wenli-cai 6831535
Add missing Kdocs
wenli-cai d2626f2
Apply changes from apiDump
wenli-cai 6bdc3d4
Fix for PR comments
wenli-cai 1a6d868
Apply changes from apiDump
wenli-cai 4255a8f
More fix for PR comments
wenli-cai ebe259b
Improve error handling
wenli-cai 1beba35
Apply changes from apiDump
wenli-cai b7fd015
Final fixes for PR comments
wenli-cai d9b1a19
Apply changes from apiDump
wenli-cai 1c09fd5
Merge branch 'main' into wenli/workflow-viewer-open-nodes
wenli-cai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/Main.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package com.squareup.workflow1.traceviewer | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.window.singleWindowApplication | ||
|
||
/** | ||
* Main entry point for the desktop application, see [README.md] for more details. | ||
*/ | ||
fun main() { | ||
singleWindowApplication(title = "Workflow Trace Viewer") { | ||
App() | ||
App(Modifier.fillMaxSize()) | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
...-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/WorkflowJsonParser.kt
This file was deleted.
Oops, something went wrong.
87 changes: 0 additions & 87 deletions
87
workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/WorkflowTree.kt
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/model/Node.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.squareup.workflow1.traceviewer.model | ||
|
||
/** | ||
* Since the logic of Workflow is hierarchical (where each workflow may have parent workflows and/or | ||
* children workflows, a tree structure is most appropriate for representing the data rather than | ||
* using flat data structures like an array. | ||
* | ||
* TBD what more metadata should be involved with each node, e.g. (props, states, # of render passes) | ||
*/ | ||
public class Node( | ||
val id: String, | ||
val name: String, | ||
val children: List<Node> | ||
) |
51 changes: 51 additions & 0 deletions
51
...w-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/ui/FrameSelectTab.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.squareup.workflow1.traceviewer.ui | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.LazyRow | ||
import androidx.compose.foundation.lazy.rememberLazyListState | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.Surface | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import com.squareup.workflow1.traceviewer.model.Node | ||
|
||
/** | ||
* A trace tab selector that allows devs to switch between different states within the provided trace. | ||
*/ | ||
@Composable | ||
public fun FrameSelectTab( | ||
frames: List<Node>, | ||
currentIndex: Int, | ||
onIndexChange: (Int) -> Unit, | ||
modifier: Modifier = Modifier | ||
) { | ||
val state = rememberLazyListState() | ||
|
||
Surface( | ||
modifier = modifier | ||
.padding(4.dp), | ||
color = Color.White, | ||
) { | ||
LazyRow( | ||
modifier = Modifier | ||
.padding(8.dp), | ||
state = state | ||
) { | ||
items(frames.size) { index -> | ||
Text( | ||
text = "State ${index + 1}", | ||
color = if (index == currentIndex) Color.Black else Color.LightGray, | ||
modifier = Modifier | ||
.clip(RoundedCornerShape(16.dp)) | ||
.clickable { onIndexChange(index) } | ||
.padding(10.dp) | ||
) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set some standard for naming terminology in this project. Open to changing it though!