Skip to content

Commit 97fbc05

Browse files
committed
feat: display frankenphp tab in 2nd position if enabled
1 parent 096d82a commit 97fbc05

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

internal/ui/app.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"slices"
78
"strings"
89
"time"
910

@@ -46,9 +47,9 @@ type tab int
4647

4748
const (
4849
tabCaddy tab = iota
50+
tabFrankenPHP
4951
tabConfig
5052
tabCertificates
51-
tabFrankenPHP
5253
)
5354

5455
type tabState struct {
@@ -112,7 +113,7 @@ func NewApp(f fetcher.Fetcher, cfg Config) *App {
112113
tabs := []tab{tabCaddy, tabConfig, tabCertificates}
113114
activeTab := tabCaddy
114115
if cfg.HasFrankenPHP {
115-
tabs = append(tabs, tabFrankenPHP)
116+
tabs = slices.Insert(tabs, 1, tabFrankenPHP)
116117
}
117118

118119
ts := make(map[tab]*tabState)

internal/ui/tabbar.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ import (
88

99
var (
1010
activeTabStyle = lipgloss.NewStyle().
11-
Bold(true).
12-
Foreground(ember)
11+
Bold(true).
12+
Foreground(ember)
1313
inactiveTabStyle = lipgloss.NewStyle().
14-
Foreground(subtle)
14+
Foreground(subtle)
1515
)
1616

1717
func tabLabel(t tab) string {
1818
switch t {
1919
case tabCaddy:
2020
return "Caddy"
21+
case tabFrankenPHP:
22+
return "FrankenPHP"
2123
case tabConfig:
2224
return "Caddy Config"
2325
case tabCertificates:
2426
return "Certificates"
25-
case tabFrankenPHP:
26-
return "FrankenPHP"
2727
default:
2828
return "?"
2929
}

0 commit comments

Comments
 (0)