Skip to content

Commit

Permalink
hof/tui: support running flows in the playground (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm authored Sep 18, 2023
1 parent dac7812 commit ce1c022
Show file tree
Hide file tree
Showing 23 changed files with 229 additions and 737 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/hofstadter-io/hof
go 1.19

require (
cuelang.org/go v0.6.1-0.20230825121609-3165a5e1aaec
cuelang.org/go v0.6.1-0.20230914115114-8709d8aa9009
dagger.io/dagger v0.8.4
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/BurntSushi/toml v1.3.2
Expand Down Expand Up @@ -42,7 +42,7 @@ require (
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.25.0
golang.org/x/mod v0.12.0
golang.org/x/text v0.12.0
golang.org/x/text v0.13.0
gopkg.in/errgo.v2 v2.1.0
gopkg.in/inconshreveable/log15.v2 v2.16.0
gopkg.in/irc.v3 v3.1.4
Expand All @@ -65,7 +65,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cockroachdb/apd/v3 v3.2.0 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
Expand Down Expand Up @@ -139,7 +139,7 @@ require (
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
golang.org/x/tools v0.12.1-0.20230831182430-914b218fc34e // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ cuelang.org/go v0.6.0 h1:dJhgKCog+FEZt7OwAYV1R+o/RZPmE8aqFoptmxSWyr8=
cuelang.org/go v0.6.0/go.mod h1:9CxOX8aawrr3BgSdqPj7V0RYoXo7XIb+yDFC6uESrOQ=
cuelang.org/go v0.6.1-0.20230825121609-3165a5e1aaec h1:eHTn+cwWCuEh85i0YHKzAsqviWA3DMBWclHVjY9bVlw=
cuelang.org/go v0.6.1-0.20230825121609-3165a5e1aaec/go.mod h1:wa/Zpkjd2eUdCKwiRjfKSHpg43H2l9Xt1ARCG/Pv6kQ=
cuelang.org/go v0.6.1-0.20230914115114-8709d8aa9009 h1:o4qbXmMH3p06p8R7wTP6Kt3RgWgl6klnvgIJ+Nvl9dI=
cuelang.org/go v0.6.1-0.20230914115114-8709d8aa9009/go.mod h1:o4D6mLEcJA0vEeMkkj+BbDxxxrs99BFI9PQcpPkr/k4=
dagger.io/dagger v0.8.4 h1:2zNu40cBvPZc/CSgMnLRfayfQj5VtbJlDtWJyWGwGSQ=
dagger.io/dagger v0.8.4/go.mod h1:Nwl7WI8YETaZhGjPJvkiOZnKLJXBaJOkSarp5m4+FxA=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
Expand Down Expand Up @@ -104,6 +106,8 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cockroachdb/apd/v3 v3.2.0 h1:79kHCn4tO0VGu3W0WujYrMjBDk8a2H4KEUYcXf7whcg=
github.com/cockroachdb/apd/v3 v3.2.0/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc=
github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg=
github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc=
github.com/codemodus/kace v0.5.1 h1:4OCsBlE2c/rSJo375ggfnucv9eRzge/U5LrrOZd47HA=
github.com/codemodus/kace v0.5.1/go.mod h1:coddaHoX1ku1YFSe4Ip0mL9kQjJvKkzb9CfIdG1YR04=
github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k=
Expand Down Expand Up @@ -639,6 +643,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -696,6 +702,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/tools v0.12.1-0.20230831182430-914b218fc34e h1:LCH4vhLjJj+bC1UcCsMV5PgdNURPVrAd46hk0A9R6Uw=
golang.org/x/tools v0.12.1-0.20230831182430-914b218fc34e/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
178 changes: 0 additions & 178 deletions lib/structural/input.go

This file was deleted.

47 changes: 0 additions & 47 deletions lib/structural/pick_test.go

This file was deleted.

8 changes: 7 additions & 1 deletion lib/tui/components/cue/browser/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ func (C *Browser) GetValue() cue.Value {
return C.value
}

func (C *Browser) SetValue(v cue.Value) {
C.value = v
}

func (VB *Browser) GetValueExpr(expr string) func () cue.Value {
// tui.Log("trace", fmt.Sprintf("View.GetConnValueExpr from: %s/%s %s", VB.Id(), VB.Name(), expr))
p := cue.ParsePath(expr)
Expand Down Expand Up @@ -225,13 +229,15 @@ func (VB *Browser) SetupKeybinds() {
VB.nextMode = "cue"
case 'T':
VB.nextMode = "tree"
case 't':
VB.nextMode = "text"

// info about CUE value? (stats)
//case 'I':
// VB.nextMode = "info"

// show settings, hidden?

case 'X':
VB.nextMode = "settings"

// todo, dive values, and walk back up
Expand Down
1 change: 1 addition & 0 deletions lib/tui/components/cue/browser/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type HandlerFunc func (B *Browser, action string, args []string, context map[str

// action registry
var actions = map[string]HandlerFunc{
"clear": handleClear,
"create": handleSet,
"set": handleSet,
"add": handleAdd,
Expand Down
Loading

0 comments on commit ce1c022

Please sign in to comment.