-
Notifications
You must be signed in to change notification settings - Fork 108
Stream emulator data into workflow visualizer app #1374
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
Open
wenli-cai
wants to merge
24
commits into
main
Choose a base branch
from
wenli/visualizer-uds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+408
−102
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e9579fc
Log data retrieved from socket
wenli-cai a121bf4
Change moshi adapter to use generics
wenli-cai ccdd35c
Create new toggle to switch between tracing modes
wenli-cai f678ab7
Fix moshi adapter
wenli-cai c63c43a
Extract socket setup and reading logic.
wenli-cai d326385
WIP
wenli-cai 6e71ae9
Consolidate logic to take in TraceMode rather than specific params
wenli-cai f5fdb6e
Apply changes from apiDump
wenli-cai 8c1b2dd
Stream data from emulator directly into visualizer
wenli-cai 9d50d60
Return to using generics for Moshi adapter
wenli-cai 70c9b45
Allow for auto scrolling during Live Mode
wenli-cai e233921
Fix SocketException
wenli-cai f414e75
Fix lint violations
wenli-cai fff11db
Consolidate live and trace mode render on result logic
wenli-cai cd8b4ab
Clean up compose violations
wenli-cai a5d20ac
Change function visibility for test
wenli-cai b8c62ab
Merge branch 'main' into wenli/visualizer-uds
wenli-cai febd6d5
Fix merge bug
wenli-cai 764f991
Fix PR comments
wenli-cai a0f22da
Extract parsing logic from tree rendering logic
wenli-cai 2ae9051
Refactor SocketClient
wenli-cai a03fcc9
Apply changes from apiDump
wenli-cai be3fbd1
More socket refactoring
wenli-cai 9319e1d
Apply changes from apiDump
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
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
58 changes: 58 additions & 0 deletions
58
...-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/ui/TraceModeToggleSwitch.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,58 @@ | ||
package com.squareup.workflow1.traceviewer.ui | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.Switch | ||
import androidx.compose.material.SwitchDefaults | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.font.FontStyle | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.squareup.workflow1.traceviewer.TraceMode | ||
|
||
@Composable | ||
internal fun TraceModeToggleSwitch( | ||
onToggle: () -> Unit, | ||
traceMode: TraceMode, | ||
modifier: Modifier = Modifier | ||
) { | ||
// File mode is unchecked by default, and live mode is checked. | ||
var checked by remember { | ||
mutableStateOf(traceMode is TraceMode.Live) | ||
} | ||
|
||
Column( | ||
modifier = modifier.padding(16.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Switch( | ||
checked = checked, | ||
onCheckedChange = { | ||
checked = it | ||
onToggle() | ||
}, | ||
colors = SwitchDefaults.colors( | ||
checkedThumbColor = Color.Black, | ||
checkedTrackColor = Color.Black, | ||
) | ||
) | ||
|
||
Text( | ||
text = if (traceMode is TraceMode.Live) { | ||
"Live Mode" | ||
} else { | ||
"File Mode" | ||
}, | ||
fontSize = 12.sp, | ||
fontStyle = FontStyle.Italic | ||
) | ||
} | ||
} |
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
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.
nit, consider calling the traceMode instance under evaluation as "currentTraceMode"
IMO, it's a bit clearer that the left side is the new state and the right side is existing state.
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.
Changed