diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d98bae5..77ccab6c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The Pulls screen opens on an index of the project's pull requests across the whole screen, and a pull request opens in its place instead of beside the list. A back button over its title returns to the index as you left it; beside it, the number opens a menu of the other pull requests, and previous and next walk the index's filter. On the Files tab only the file tree sits beside the diff, which gains the width the list took. The Overview puts the description beside a column with the reviewers, checks, mergeability and the checkout the branch sits in; the tab strip ends with the pull request's size. Open in Session and Merge stay in the header, with Resolve conflicts or Fix checks beside them when the pull request needs one, and Approve, Refresh and Open on GitHub move to the ⋯ menu. The screen lines up on the sidebar's spacing, its buttons are the size of the rest of the window's, and the code a review thread is about sits in a block of its own, apart from the comments. On the index, j and k or the arrows move, Enter opens and / goes to the filter; on a pull request, Escape goes back and Alt with an arrow steps to the previous or next one. - The bundled Dark theme gives the interface and terminal the same neutral charcoal background, removing the terminal's blue-black cast, and uses a brighter terminal and syntax palette of green, coral, amber, blue, violet and cyan. The Light theme uses darker counterparts of those colors, tuned for contrast on its light terminal background. - A session's browser is no longer closed without asking. When no pane shows it and nobody has used it for five minutes, a toast asks whether to close it: Close closes it, and Keep open, or swiping the toast away, keeps it for another five minutes. Unanswered, the toast stays up and the browser stays open, so a page left open over lunch is still there when you come back. Using the browser, or the agent using it, takes the toast down. Before, the browser was closed after five minutes away from its session, and its page, tabs and login were lost. +- The sidebar's resize strip sits on the sidebar's own right edge, as the Code and Review panel's does, instead of in the gap between the sidebar and the sessions. ### Fixed diff --git a/native/cmd/lich-native/sidebar.go b/native/cmd/lich-native/sidebar.go index 1b6b7cb51..8135b0359 100644 --- a/native/cmd/lich-native/sidebar.go +++ b/native/cmd/lich-native/sidebar.go @@ -262,9 +262,10 @@ func (s *sidebar) panel(gtx C, th *ui.Theme, m *model, active string) (D, sideba children = append(children, layout.Rigid(func(gtx C) D { return s.filterRow(gtx, on, view) }), ui.VGap(2)) } children = append(children, layout.Flexed(1, func(gtx C) D { - // -mr-2: the scroll column reaches the panel's edge, so its - // scrollbar sits in the padding and its pr-2 keeps the cards off it. - gtx.Constraints.Max.X += gtx.Dp(ui.Space(2)) + // The scroll column reaches into the padding up to the resize + // strip, so its scrollbar sits clear of the strip and its pr-2 + // keeps the cards off it. + gtx.Constraints.Max.X += gtx.Dp(ui.Space(2)) - gtx.Dp(ui.ResizeWidth) return s.blockList(gtx, on, view, active, &act) })) if p, ok := m.project(); ok { @@ -283,11 +284,9 @@ func (s *sidebar) panel(gtx C, th *ui.Theme, m *model, active string) (D, sideba return D{Size: size}, act } -// resizeHandle lays the resize strip out in the gutter past the panel's -// right edge: on the edge itself its lit strip would cover the block list's -// scrollbar, which runs in the panel's padding. +// resizeHandle lays the resize strip out on the panel's own right edge. func (s *sidebar) resizeHandle(gtx C, th *ui.Theme, panel image.Point) { - gtx.Constraints = layout.Exact(image.Pt(panel.X+gtx.Dp(ui.ResizeWidth), panel.Y)) + gtx.Constraints = layout.Exact(panel) s.resize.Layout(gtx, th) } diff --git a/native/cmd/lich-native/sidebar_handle_test.go b/native/cmd/lich-native/sidebar_handle_test.go index d1f5812a5..186acdc69 100644 --- a/native/cmd/lich-native/sidebar_handle_test.go +++ b/native/cmd/lich-native/sidebar_handle_test.go @@ -14,7 +14,7 @@ import ( "github.com/lichdotdev/lich/native/ui" ) -func TestSidebarHandleSitsInTheGutterClearOfTheBlockListsScrollbar(t *testing.T) { +func TestSidebarHandleSitsOnThePanelsOwnRightEdge(t *testing.T) { th := &ui.Theme{Palette: ui.Dark} press := func(x float32) bool { s := newSidebar(new(ui.Root)) @@ -28,10 +28,13 @@ func TestSidebarHandleSitsInTheGutterClearOfTheBlockListsScrollbar(t *testing.T) s.resize.Update(gtx, 300, 200, 500) return s.resize.Dragging() } - if press(297) { - t.Error("a press on the panel's own right edge, where the block list's scrollbar runs, grabbed the handle") + if !press(297) { + t.Error("a press on the panel's own right edge missed the handle") } - if !press(303) { - t.Error("a press in the gutter past the panel missed the handle") + if press(293) { + t.Error("a press left of the strip, where the block list's scrollbar runs, grabbed the handle") + } + if press(303) { + t.Error("a press in the gutter past the panel grabbed the handle") } }