The console manages people, keys, organizations and the mirror, and scrolls a tall sidebar
Accounts, API keys and Organizations views read the store and change it by running the users, keys and org commands in-process, so their checks and messages are the ones shown. A Mirror view lists what the mirror holds and which models use it, downloads into it and removes from it. Models gain adding from a definition file. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c7d5ee16b5
commit
eb7dac8a67
6 files changed
+949
-8
No files matched your search
@@ -68,14 +68,18 @@ func (f frame) render() string {
|
||||
ph := h - 2
|
||||
inner := ph - 2 // borders
|
||||
|
||||
var nav strings.Builder
|
||||
var navLines []string
|
||||
cur := 0
|
||||
for _, it := range f.Nav {
|
||||
mark := " "
|
||||
label := it.Label
|
||||
if it.Heading {
|
||||
nav.WriteString(sDim.Render(label) + "\n")
|
||||
navLines = append(navLines, sDim.Render(label))
|
||||
continue
|
||||
}
|
||||
if it.Current || it.State == "current" {
|
||||
cur = len(navLines)
|
||||
}
|
||||
switch {
|
||||
case it.State == "done":
|
||||
mark = sOK.Render("✓ ")
|
||||
@@ -88,9 +92,22 @@ func (f frame) render() string {
|
||||
case it.Dim || it.State == "todo":
|
||||
label = sDim.Render(label)
|
||||
}
|
||||
nav.WriteString(truncateWidth(mark+label, navWidth-2) + "\n")
|
||||
navLines = append(navLines, truncateWidth(mark+label, navWidth-2))
|
||||
}
|
||||
left := box(fBorder, f.NavTitle, nav.String(), navWidth, inner)
|
||||
// Taller than the screen: the part around the current entry, with a mark
|
||||
// at an edge that has more beyond it.
|
||||
if len(navLines) > inner {
|
||||
total := len(navLines)
|
||||
top := min(max(0, cur-inner/2), total-inner)
|
||||
navLines = append([]string{}, navLines[top:top+inner]...)
|
||||
if top > 0 {
|
||||
navLines[0] = sDim.Render(" ↑ more")
|
||||
}
|
||||
if top+inner < total {
|
||||
navLines[inner-1] = sDim.Render(" ↓ more")
|
||||
}
|
||||
}
|
||||
left := box(fBorder, f.NavTitle, strings.Join(navLines, "\n"), navWidth, inner)
|
||||
|
||||
pw := w - navWidth - 2 - 2
|
||||
lines := strings.Split(strings.TrimRight(f.Body, "\n"), "\n")
|
||||
|
||||
Reference in new issue
Block a user