refactor: one copy of the UI's repeated helpers
- Text inputs come from newTextInput; the link and folder prompts share one width. - One starred-first sort for sources, vaults and secrets; accountOf where the account was cut from the label by hand. - One helper each for the reveal and clipboard countdowns' tick and seconds, the "Open with" choices, the vaults-loaded count, and Go to's and the panes' tabs. - The details pane builds its label prefix, indent, note and source once; list rows mark matches with MarkMatches. - The release page opens through openPage, so it now says it opened, as other pages do. - The cache's account filter is built once per load or save, not per key.
This commit is contained in:
18 files changed
+171
-217
No files matched your search
@@ -69,3 +69,20 @@ func TitleStyle(st styles.Styles, focused bool) lipgloss.Style {
|
||||
}
|
||||
return st.TitleBlurred
|
||||
}
|
||||
|
||||
// Tabs draws tab names for a title in style ts, the current one
|
||||
// underlined and the rest muted.
|
||||
func Tabs(st styles.Styles, ts lipgloss.Style, names []string, current int) string {
|
||||
var out string
|
||||
for i, name := range names {
|
||||
if i > 0 {
|
||||
out += ts.Render(" - ")
|
||||
}
|
||||
if i == current {
|
||||
out += ts.Underline(true).Render(name)
|
||||
} else {
|
||||
out += st.Muted.Render(name)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
Reference in new issue
Block a user