Skip to content

Commit 49b771a

Browse files
authored
feat: add different icon for runnable execs in the library (#267)
1 parent 27912af commit 49b771a

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/charmbracelet/bubbletea v1.3.5
1010
github.com/charmbracelet/lipgloss v1.1.0
1111
github.com/expr-lang/expr v1.17.5
12-
github.com/flowexec/tuikit v0.2.0
12+
github.com/flowexec/tuikit v0.2.1
1313
github.com/flowexec/vault v0.1.2
1414
github.com/gen2brain/beeep v0.11.1
1515
github.com/jahvon/glamour v0.8.1-patch3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ github.com/esiqveland/notify v0.13.3 h1:QCMw6o1n+6rl+oLUfg8P1IIDSFsDEb2WlXvVvIJb
7979
github.com/esiqveland/notify v0.13.3/go.mod h1:hesw/IRYTO0x99u1JPweAl4+5mwXJibQVUcP0Iu5ORE=
8080
github.com/expr-lang/expr v1.17.5 h1:i1WrMvcdLF249nSNlpQZN1S6NXuW9WaOfF5tPi3aw3k=
8181
github.com/expr-lang/expr v1.17.5/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
82-
github.com/flowexec/tuikit v0.2.0 h1:VUceZWwWEbq4UtDtawb2ZbVeMR7ULDYQy4og5f4PKP4=
83-
github.com/flowexec/tuikit v0.2.0/go.mod h1:fjMwEM7FkxbP7bIV4CfEjsixgjicgQqPrejoBZAHf5s=
82+
github.com/flowexec/tuikit v0.2.1 h1:jsW5PrBiem4as3KWmhOB/7OS0LYB0voQnKXvAG0OsPU=
83+
github.com/flowexec/tuikit v0.2.1/go.mod h1:fjMwEM7FkxbP7bIV4CfEjsixgjicgQqPrejoBZAHf5s=
8484
github.com/flowexec/vault v0.1.2 h1:INQ/w81piKRM+zqPBQpxFYl1iK8dI3APIHZ1F1Jm7CA=
8585
github.com/flowexec/vault v0.1.2/go.mod h1:nxoGHIVjwSgg1o6DoTmj5NCJtubu71SvS883LPUXuvg=
8686
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=

internal/io/library/view.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/jahvon/glamour"
1414

1515
"github.com/flowexec/flow/types/common"
16+
"github.com/flowexec/flow/types/executable"
1617
"github.com/flowexec/flow/types/workspace"
1718
)
1819

@@ -172,7 +173,14 @@ func (l *Library) paneOneContent() string {
172173
}
173174
for i, ex := range l.visibleExecutables {
174175
if uint(i) == l.currentExecutable {
175-
sb.WriteString(renderSelection("* "+truncateText(shortRef(ex.Ref(), curWs, curNs), paneWidth), l.theme))
176+
indicator := "*"
177+
if (l.ctx.CurrentWorkspace != nil && ex.Workspace() == l.ctx.CurrentWorkspace.AssignedName()) ||
178+
(ex.Visibility != nil && *ex.Visibility == executable.ExecutableVisibility(common.VisibilityPublic)) {
179+
// indicate if runnable from the current ctx
180+
indicator = "▶"
181+
}
182+
refStr := indicator + " " + truncateText(shortRef(ex.Ref(), curWs, curNs), paneWidth)
183+
sb.WriteString(renderSelection(refStr, l.theme))
176184
} else {
177185
sb.WriteString(renderInactive(" "+truncateText(shortRef(ex.Ref(), curWs, curNs), paneWidth), l.theme))
178186
}

0 commit comments

Comments
 (0)