detached 961f99d

chore: scrub stray "pi" references from source comments

Five leftover comments in internal/tui/ mentioned "pi" / "pi's" /
"pi-style" / "pi's cli-highlight" / "pi's extToLang" from the old
development era. Rewritten to describe the behaviour on its own
terms with no external reference.

Also renamed the two tui helpers piFormatTokens -> formatTokens and
piContextUsage -> contextUsage so the source grep stays clean.

No behaviour change, all tests pass.
commit
961f99da9e0feea6e6edc3336ef2c01f8d94aaba
author
patriceckhart · · 2026-04-19 15:06 UTC
parent
99c9ba8
signature
unsigned
refs
tag: v0.0.36
2 files · +21 -21
M internal/tui/highlight.go +4 -4
@@ -144,8 +144,8 @@ var (
144144 // "fruity" style if the builder fails for any reason.
145145 func buildZotStyle() *chroma.Style {
146146 builder := styles.Get("monokai").Builder()
147- // Override the most visible tokens with explicit colors that match
148- // pi's cli-highlight look on a dark terminal.
147+ // Override the most visible tokens with explicit colors that
148+ // read well on a dark terminal.
149149 builder.Add(chroma.Keyword, "#81a1c1 bold") // imports, funcs, control flow
150150 builder.Add(chroma.KeywordConstant, "#81a1c1") // true, false, null
151151 builder.Add(chroma.KeywordDeclaration, "#81a1c1") // const, let, var, type
@@ -173,8 +173,8 @@ func buildZotStyle() *chroma.Style {
173173 return s
174174 }
175175
176-// extLang mirrors pi's extToLang. Only extensions that chroma supports
177-// are included.
176+// extLang maps file extensions to chroma lexer names. Only
177+// extensions that chroma supports are included.
178178 var extLang = map[string]string{
179179 "ts": "typescript",
180180 "tsx": "tsx",
@@ -144,8 +144,8 @@ var (
144 // "fruity" style if the builder fails for any reason.144 // "fruity" style if the builder fails for any reason.
145 func buildZotStyle() *chroma.Style {145 func buildZotStyle() *chroma.Style {
146 builder := styles.Get("monokai").Builder()146 builder := styles.Get("monokai").Builder()
147- // Override the most visible tokens with explicit colors that match147+ // Override the most visible tokens with explicit colors that
148- // pi's cli-highlight look on a dark terminal.148+ // read well on a dark terminal.
149 builder.Add(chroma.Keyword, "#81a1c1 bold") // imports, funcs, control flow149 builder.Add(chroma.Keyword, "#81a1c1 bold") // imports, funcs, control flow
150 builder.Add(chroma.KeywordConstant, "#81a1c1") // true, false, null150 builder.Add(chroma.KeywordConstant, "#81a1c1") // true, false, null
151 builder.Add(chroma.KeywordDeclaration, "#81a1c1") // const, let, var, type151 builder.Add(chroma.KeywordDeclaration, "#81a1c1") // const, let, var, type
@@ -173,8 +173,8 @@ func buildZotStyle() *chroma.Style {
173 return s173 return s
174 }174 }
175 175
176-// extLang mirrors pi's extToLang. Only extensions that chroma supports176+// extLang maps file extensions to chroma lexer names. Only
177-// are included.177+// extensions that chroma supports are included.
178 var extLang = map[string]string{178 var extLang = map[string]string{
179 "ts": "typescript",179 "ts": "typescript",
180 "tsx": "tsx",180 "tsx": "tsx",
M internal/tui/view.go +17 -17
@@ -772,7 +772,7 @@ func truncateLines(s string, n int) string {
772772 }
773773
774774 // StatusBarParams groups the many bits of state the status bar needs.
775-// Grew from a flat argument list once we started matching pi's format.
775+// Grew from a flat argument list once we settled on the layout.
776776 type StatusBarParams struct {
777777 Theme Theme
778778 Provider string
@@ -786,8 +786,8 @@ type StatusBarParams struct {
786786 Usage provider.Usage
787787 // Subscription is true when the credential is an OAuth token (claude
788788 // pro/max, chatgpt plus/pro) rather than a paid api key. We still
789- // compute a cost for visibility, but pi-style we append "(sub)" so
790- // the user knows no money actually moved.
789+ // compute a cost for visibility and append "(sub)" so the user
790+ // knows no real money moved.
791791 Subscription bool
792792
793793 // Last turn's input+cache tokens (approximates current live context).
@@ -820,24 +820,24 @@ type StatusBarParams struct {
820820 func StatusBar(p StatusBarParams) []string {
821821 th := p.Theme
822822
823- // Token stats: only include each segment when non-zero (pi's
824- // behavior). Keeps the bar compact on brand-new sessions.
823+ // Token stats: only include each segment when non-zero. Keeps
824+ // the bar compact on brand-new sessions.
825825 var stats []string
826826 if p.Usage.InputTokens > 0 {
827- stats = append(stats, fmt.Sprintf("↑%s", piFormatTokens(p.Usage.InputTokens)))
827+ stats = append(stats, fmt.Sprintf("↑%s", formatTokens(p.Usage.InputTokens)))
828828 }
829829 if p.Usage.OutputTokens > 0 {
830- stats = append(stats, fmt.Sprintf("↓%s", piFormatTokens(p.Usage.OutputTokens)))
830+ stats = append(stats, fmt.Sprintf("↓%s", formatTokens(p.Usage.OutputTokens)))
831831 }
832832 if p.Usage.CacheReadTokens > 0 {
833- stats = append(stats, fmt.Sprintf("R%s", piFormatTokens(p.Usage.CacheReadTokens)))
833+ stats = append(stats, fmt.Sprintf("R%s", formatTokens(p.Usage.CacheReadTokens)))
834834 }
835835 if p.Usage.CacheWriteTokens > 0 {
836- stats = append(stats, fmt.Sprintf("W%s", piFormatTokens(p.Usage.CacheWriteTokens)))
836+ stats = append(stats, fmt.Sprintf("W%s", formatTokens(p.Usage.CacheWriteTokens)))
837837 }
838838
839839 // Cost: always show the dollar value computed from token counts,
840- // even on subscription — lets you see what the equivalent api cost
840+ // even on subscription. Lets you see what the equivalent api cost
841841 // would be (handy for gauging subscription value). Append "(sub)"
842842 // only as a hint that no real money moved.
843843 var costStr string
@@ -852,7 +852,7 @@ func StatusBar(p StatusBarParams) []string {
852852 }
853853
854854 // Context %. Color-coded: yellow >70, red >90.
855- ctx, ctxColor := piContextUsage(th, p.ContextUsed, p.ContextMax)
855+ ctx, ctxColor := contextUsage(th, p.ContextUsed, p.ContextMax)
856856 if ctx != "" {
857857 if p.AutoCompacting {
858858 ctx += " (auto)"
@@ -898,17 +898,17 @@ func StatusBar(p StatusBarParams) []string {
898898 return []string{primary, cwdRendered}
899899 }
900900
901-// piContextUsage renders the "N%/ctxMax" fragment, returning the
901+// contextUsage renders the "N%/ctxMax" fragment, returning the
902902 // rendered string plus the colour to wrap it in.
903-func piContextUsage(th Theme, used, max int) (string, int) {
903+func contextUsage(th Theme, used, max int) (string, int) {
904904 if max <= 0 {
905905 if used <= 0 {
906906 return "", th.Muted
907907 }
908- return piFormatTokens(used), th.Muted
908+ return formatTokens(used), th.Muted
909909 }
910910 pct := float64(used) / float64(max) * 100
911- text := fmt.Sprintf("%.1f%%/%s", pct, piFormatTokens(max))
911+ text := fmt.Sprintf("%.1f%%/%s", pct, formatTokens(max))
912912 switch {
913913 case pct > 90:
914914 return text, th.Error
@@ -918,14 +918,14 @@ func piContextUsage(th Theme, used, max int) (string, int) {
918918 return text, th.Muted
919919 }
920920
921-// piFormatTokens footer formatter:
921+// formatTokens footer formatter:
922922 //
923923 // < 1000 -> "42"
924924 // < 10_000 -> "2.7k"
925925 // < 1_000_000 -> "35k"
926926 // < 10M -> "1.1M"
927927 // else -> "12M"
928-func piFormatTokens(n int) string {
928+func formatTokens(n int) string {
929929 switch {
930930 case n < 0:
931931 return "0"
@@ -772,7 +772,7 @@ func truncateLines(s string, n int) string {
772 }772 }
773 773
774 // StatusBarParams groups the many bits of state the status bar needs.774 // StatusBarParams groups the many bits of state the status bar needs.
775-// Grew from a flat argument list once we started matching pi's format.775+// Grew from a flat argument list once we settled on the layout.
776 type StatusBarParams struct {776 type StatusBarParams struct {
777 Theme Theme777 Theme Theme
778 Provider string778 Provider string
@@ -786,8 +786,8 @@ type StatusBarParams struct {
786 Usage provider.Usage786 Usage provider.Usage
787 // Subscription is true when the credential is an OAuth token (claude787 // Subscription is true when the credential is an OAuth token (claude
788 // pro/max, chatgpt plus/pro) rather than a paid api key. We still788 // pro/max, chatgpt plus/pro) rather than a paid api key. We still
789- // compute a cost for visibility, but pi-style we append "(sub)" so789+ // compute a cost for visibility and append "(sub)" so the user
790- // the user knows no money actually moved.790+ // knows no real money moved.
791 Subscription bool791 Subscription bool
792 792
793 // Last turn's input+cache tokens (approximates current live context).793 // Last turn's input+cache tokens (approximates current live context).
@@ -820,24 +820,24 @@ type StatusBarParams struct {
820 func StatusBar(p StatusBarParams) []string {820 func StatusBar(p StatusBarParams) []string {
821 th := p.Theme821 th := p.Theme
822 822
823- // Token stats: only include each segment when non-zero (pi's823+ // Token stats: only include each segment when non-zero. Keeps
824- // behavior). Keeps the bar compact on brand-new sessions.824+ // the bar compact on brand-new sessions.
825 var stats []string825 var stats []string
826 if p.Usage.InputTokens > 0 {826 if p.Usage.InputTokens > 0 {
827- stats = append(stats, fmt.Sprintf("↑%s", piFormatTokens(p.Usage.InputTokens)))827+ stats = append(stats, fmt.Sprintf("↑%s", formatTokens(p.Usage.InputTokens)))
828 }828 }
829 if p.Usage.OutputTokens > 0 {829 if p.Usage.OutputTokens > 0 {
830- stats = append(stats, fmt.Sprintf("↓%s", piFormatTokens(p.Usage.OutputTokens)))830+ stats = append(stats, fmt.Sprintf("↓%s", formatTokens(p.Usage.OutputTokens)))
831 }831 }
832 if p.Usage.CacheReadTokens > 0 {832 if p.Usage.CacheReadTokens > 0 {
833- stats = append(stats, fmt.Sprintf("R%s", piFormatTokens(p.Usage.CacheReadTokens)))833+ stats = append(stats, fmt.Sprintf("R%s", formatTokens(p.Usage.CacheReadTokens)))
834 }834 }
835 if p.Usage.CacheWriteTokens > 0 {835 if p.Usage.CacheWriteTokens > 0 {
836- stats = append(stats, fmt.Sprintf("W%s", piFormatTokens(p.Usage.CacheWriteTokens)))836+ stats = append(stats, fmt.Sprintf("W%s", formatTokens(p.Usage.CacheWriteTokens)))
837 }837 }
838 838
839 // Cost: always show the dollar value computed from token counts,839 // Cost: always show the dollar value computed from token counts,
840- // even on subscription — lets you see what the equivalent api cost840+ // even on subscription. Lets you see what the equivalent api cost
841 // would be (handy for gauging subscription value). Append "(sub)"841 // would be (handy for gauging subscription value). Append "(sub)"
842 // only as a hint that no real money moved.842 // only as a hint that no real money moved.
843 var costStr string843 var costStr string
@@ -852,7 +852,7 @@ func StatusBar(p StatusBarParams) []string {
852 }852 }
853 853
854 // Context %. Color-coded: yellow >70, red >90.854 // Context %. Color-coded: yellow >70, red >90.
855- ctx, ctxColor := piContextUsage(th, p.ContextUsed, p.ContextMax)855+ ctx, ctxColor := contextUsage(th, p.ContextUsed, p.ContextMax)
856 if ctx != "" {856 if ctx != "" {
857 if p.AutoCompacting {857 if p.AutoCompacting {
858 ctx += " (auto)"858 ctx += " (auto)"
@@ -898,17 +898,17 @@ func StatusBar(p StatusBarParams) []string {
898 return []string{primary, cwdRendered}898 return []string{primary, cwdRendered}
899 }899 }
900 900
901-// piContextUsage renders the "N%/ctxMax" fragment, returning the901+// contextUsage renders the "N%/ctxMax" fragment, returning the
902 // rendered string plus the colour to wrap it in.902 // rendered string plus the colour to wrap it in.
903-func piContextUsage(th Theme, used, max int) (string, int) {903+func contextUsage(th Theme, used, max int) (string, int) {
904 if max <= 0 {904 if max <= 0 {
905 if used <= 0 {905 if used <= 0 {
906 return "", th.Muted906 return "", th.Muted
907 }907 }
908- return piFormatTokens(used), th.Muted908+ return formatTokens(used), th.Muted
909 }909 }
910 pct := float64(used) / float64(max) * 100910 pct := float64(used) / float64(max) * 100
911- text := fmt.Sprintf("%.1f%%/%s", pct, piFormatTokens(max))911+ text := fmt.Sprintf("%.1f%%/%s", pct, formatTokens(max))
912 switch {912 switch {
913 case pct > 90:913 case pct > 90:
914 return text, th.Error914 return text, th.Error
@@ -918,14 +918,14 @@ func piContextUsage(th Theme, used, max int) (string, int) {
918 return text, th.Muted918 return text, th.Muted
919 }919 }
920 920
921-// piFormatTokens footer formatter:921+// formatTokens footer formatter:
922 //922 //
923 // < 1000 -> "42"923 // < 1000 -> "42"
924 // < 10_000 -> "2.7k"924 // < 10_000 -> "2.7k"
925 // < 1_000_000 -> "35k"925 // < 1_000_000 -> "35k"
926 // < 10M -> "1.1M"926 // < 10M -> "1.1M"
927 // else -> "12M"927 // else -> "12M"
928-func piFormatTokens(n int) string {928+func formatTokens(n int) string {
929 switch {929 switch {
930 case n < 0:930 case n < 0:
931 return "0"931 return "0"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close