detached 384a283

test(daemon): reuse legacy render dimmers

commit
384a2835064c2cb6572453268e7b318457247868
author
brice · · 2026-07-15 04:56 UTC
parent
699a232
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +9 -7
M internal/usecase/daemon/render_legacy_test.go +9 -7
@@ -158,6 +158,9 @@ func composeTabFrameIntoWithLayout(tb *tab, frame renderer.Frame, area domain.Re
158158 func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area domain.Rect, theme themeui.Theme, layoutSnap tabLayoutSnapshot, cacheValid bool, consumeDamage bool, titleGenerations map[layout.PaneID]uint64) []renderer.Damage {
159159 contentArea := domain.Rect{Width: area.Width, Height: area.Height}
160160 root := tb.tree.Root
161+ styles := newThemeStyles(theme)
162+ defaultDimmer := themeui.NewDimmer(theme)
163+ inactivePaneDimmer := themeui.NewDimmer(theme, themeui.WithForegroundDimming(inactivePaneForegroundDimming))
161164 placements, ok := layoutSnap.placements, layoutSnap.ok && layoutSnap.root == root && layoutSnap.area == contentArea
162165 if !ok {
163166 placements, ok = layout.Solve(root, contentArea)
@@ -176,7 +179,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
176179 clear(titleGenerations)
177180 }
178181 if ok && !cacheValid {
179- drawDividers(frame, root, area, themeui.NewDimmer(theme).Dim(newThemeStyles(theme).border))
182+ drawDividers(frame, root, area, defaultDimmer.Dim(styles.border))
180183 }
181184 var damage []renderer.Damage
182185 for _, pl := range placements {
@@ -190,7 +193,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
190193 focused := tb.tree.Focus == pl.ID
191194 pl = offsetPlacement(pl, area.X, area.Y)
192195 if pl.TitleBar.Height > 0 {
193- generation := drawPaneTitleBar(frame, pl, p, focused, theme)
196+ generation := drawPaneTitleBar(frame, pl, p, focused, styles, defaultDimmer)
194197 if cacheValid && (titleGenerations == nil || titleGenerations[pl.ID] != generation) {
195198 titleDamage := pl.TitleBar
196199 titleDamage.X -= area.X
@@ -222,7 +225,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
222225 p.mu.Lock()
223226 paneDamage = p.screen.Damage()
224227 if !cacheValid || len(paneDamage) > 0 {
225- blitPaneFrame(frame, pl.Content, p.screen.Frame, !focused, themeui.NewDimmer(theme, themeui.WithForegroundDimming(inactivePaneForegroundDimming)))
228+ blitPaneFrame(frame, pl.Content, p.screen.Frame, !focused, inactivePaneDimmer)
226229 }
227230 for _, d := range paneDamage {
228231 localContent := pl.Content
@@ -234,7 +237,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
234237 continue
235238 }
236239 if !cacheValid || len(paneDamage) > 0 {
237- blitPaneFrame(frame, pl.Content, paneFrame, !focused, themeui.NewDimmer(theme, themeui.WithForegroundDimming(inactivePaneForegroundDimming)))
240+ blitPaneFrame(frame, pl.Content, paneFrame, !focused, inactivePaneDimmer)
238241 }
239242 for _, d := range paneDamage {
240243 localContent := pl.Content
@@ -259,13 +262,12 @@ func clearFrameRect(frame renderer.Frame, r domain.Rect) {
259262 }
260263 }
261264
262-func drawPaneTitleBar(frame renderer.Frame, pl layout.Placement, p *pane, focused bool, theme themeui.Theme) uint64 {
263- styles := newThemeStyles(theme)
265+func drawPaneTitleBar(frame renderer.Frame, pl layout.Placement, p *pane, focused bool, styles themeStyles, dimmer themeui.Dimmer) uint64 {
264266 style := styles.border
265267 if focused {
266268 style = styles.statusBar
267269 } else {
268- style = themeui.NewDimmer(theme).Dim(style)
270+ style = dimmer.Dim(style)
269271 }
270272 for x := pl.TitleBar.X; x < pl.TitleBar.X+pl.TitleBar.Width && x < frame.Width; x++ {
271273 frame.Set(x, pl.TitleBar.Y, renderer.Cell{Rune: ' ', Style: style})
@@ -158,6 +158,9 @@ func composeTabFrameIntoWithLayout(tb *tab, frame renderer.Frame, area domain.Re
158 func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area domain.Rect, theme themeui.Theme, layoutSnap tabLayoutSnapshot, cacheValid bool, consumeDamage bool, titleGenerations map[layout.PaneID]uint64) []renderer.Damage {158 func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area domain.Rect, theme themeui.Theme, layoutSnap tabLayoutSnapshot, cacheValid bool, consumeDamage bool, titleGenerations map[layout.PaneID]uint64) []renderer.Damage {
159 contentArea := domain.Rect{Width: area.Width, Height: area.Height}159 contentArea := domain.Rect{Width: area.Width, Height: area.Height}
160 root := tb.tree.Root160 root := tb.tree.Root
161+ styles := newThemeStyles(theme)
162+ defaultDimmer := themeui.NewDimmer(theme)
163+ inactivePaneDimmer := themeui.NewDimmer(theme, themeui.WithForegroundDimming(inactivePaneForegroundDimming))
161 placements, ok := layoutSnap.placements, layoutSnap.ok && layoutSnap.root == root && layoutSnap.area == contentArea164 placements, ok := layoutSnap.placements, layoutSnap.ok && layoutSnap.root == root && layoutSnap.area == contentArea
162 if !ok {165 if !ok {
163 placements, ok = layout.Solve(root, contentArea)166 placements, ok = layout.Solve(root, contentArea)
@@ -176,7 +179,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
176 clear(titleGenerations)179 clear(titleGenerations)
177 }180 }
178 if ok && !cacheValid {181 if ok && !cacheValid {
179- drawDividers(frame, root, area, themeui.NewDimmer(theme).Dim(newThemeStyles(theme).border))182+ drawDividers(frame, root, area, defaultDimmer.Dim(styles.border))
180 }183 }
181 var damage []renderer.Damage184 var damage []renderer.Damage
182 for _, pl := range placements {185 for _, pl := range placements {
@@ -190,7 +193,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
190 focused := tb.tree.Focus == pl.ID193 focused := tb.tree.Focus == pl.ID
191 pl = offsetPlacement(pl, area.X, area.Y)194 pl = offsetPlacement(pl, area.X, area.Y)
192 if pl.TitleBar.Height > 0 {195 if pl.TitleBar.Height > 0 {
193- generation := drawPaneTitleBar(frame, pl, p, focused, theme)196+ generation := drawPaneTitleBar(frame, pl, p, focused, styles, defaultDimmer)
194 if cacheValid && (titleGenerations == nil || titleGenerations[pl.ID] != generation) {197 if cacheValid && (titleGenerations == nil || titleGenerations[pl.ID] != generation) {
195 titleDamage := pl.TitleBar198 titleDamage := pl.TitleBar
196 titleDamage.X -= area.X199 titleDamage.X -= area.X
@@ -222,7 +225,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
222 p.mu.Lock()225 p.mu.Lock()
223 paneDamage = p.screen.Damage()226 paneDamage = p.screen.Damage()
224 if !cacheValid || len(paneDamage) > 0 {227 if !cacheValid || len(paneDamage) > 0 {
225- blitPaneFrame(frame, pl.Content, p.screen.Frame, !focused, themeui.NewDimmer(theme, themeui.WithForegroundDimming(inactivePaneForegroundDimming)))228+ blitPaneFrame(frame, pl.Content, p.screen.Frame, !focused, inactivePaneDimmer)
226 }229 }
227 for _, d := range paneDamage {230 for _, d := range paneDamage {
228 localContent := pl.Content231 localContent := pl.Content
@@ -234,7 +237,7 @@ func composeTabFrameIntoWithLayoutOptions(tb *tab, frame renderer.Frame, area do
234 continue237 continue
235 }238 }
236 if !cacheValid || len(paneDamage) > 0 {239 if !cacheValid || len(paneDamage) > 0 {
237- blitPaneFrame(frame, pl.Content, paneFrame, !focused, themeui.NewDimmer(theme, themeui.WithForegroundDimming(inactivePaneForegroundDimming)))240+ blitPaneFrame(frame, pl.Content, paneFrame, !focused, inactivePaneDimmer)
238 }241 }
239 for _, d := range paneDamage {242 for _, d := range paneDamage {
240 localContent := pl.Content243 localContent := pl.Content
@@ -259,13 +262,12 @@ func clearFrameRect(frame renderer.Frame, r domain.Rect) {
259 }262 }
260 }263 }
261 264
262-func drawPaneTitleBar(frame renderer.Frame, pl layout.Placement, p *pane, focused bool, theme themeui.Theme) uint64 {265+func drawPaneTitleBar(frame renderer.Frame, pl layout.Placement, p *pane, focused bool, styles themeStyles, dimmer themeui.Dimmer) uint64 {
263- styles := newThemeStyles(theme)
264 style := styles.border266 style := styles.border
265 if focused {267 if focused {
266 style = styles.statusBar268 style = styles.statusBar
267 } else {269 } else {
268- style = themeui.NewDimmer(theme).Dim(style)270+ style = dimmer.Dim(style)
269 }271 }
270 for x := pl.TitleBar.X; x < pl.TitleBar.X+pl.TitleBar.Width && x < frame.Width; x++ {272 for x := pl.TitleBar.X; x < pl.TitleBar.X+pl.TitleBar.Width && x < frame.Width; x++ {
271 frame.Set(x, pl.TitleBar.Y, renderer.Cell{Rune: ' ', Style: style})273 frame.Set(x, pl.TitleBar.Y, renderer.Cell{Rune: ' ', Style: style})

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 12

Tags 11

↑↓ moveenter openesc close