╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │454 // "a:" link) reloads the page on the adjacent window — same on TUI and web. │ │455 fn addNavLink(self: *View, allocator: std.mem.Allocator, box: *wgt.Box(ui.Widget), label: []const u8, oid: []const u8, target_start: usize, path: []const u8) !void {│ │456 const link = try commitsLink(self.session.page_arena, self.data.identity, oid, target_start, path); │ │439 - var tb = try wgt.TextBox(ui.Widget).init(allocator, label, .{ .border_style = .hidden, .rounded_corners = true, .wrap_kind = .none }); │ │457 + var tb = try wgt.TextBox(ui.Widget).init(allocator, label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │458 errdefer tb.deinit(allocator); │ │459 tb.getFocus().focusable = true; │ │460 tb.getFocus().kind = .{ .custom = link }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │465 // this commit's tree, so its files are always viewable as of this object. │ │466 fn addViewFilesLink(self: *View, allocator: std.mem.Allocator, box: *wgt.Box(ui.Widget), oid: []const u8) !void { │ │467 const link = try filesObjectLink(self.session.page_arena, self.data.identity, oid); │ │450 - var tb = try wgt.TextBox(ui.Widget).init(allocator, "view files at this commit", .{ .border_style = .hidden, .rounded_corners = true, .wrap_kind = .none });│ │468 + var tb = try wgt.TextBox(ui.Widget).init(allocator, "view files at this commit", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │469 errdefer tb.deinit(allocator); │ │470 tb.getFocus().focusable = true; │ │471 tb.getFocus().kind = .{ .custom = link }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │472 try box.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │473 } │ │474 │ │475 + // the selected commit's full message, focusable like the rows around it. it │ │476 + // word-wraps, which needs a bounded width: the diff scroll grants its rows │ │477 + // an unbounded one, so build caps this row via `message_id`. │ │478 + fn addMessageBox(self: *View, allocator: std.mem.Allocator, box: *wgt.Box(ui.Widget), message: []const u8) !void { │ │479 + if (message.len == 0) return; │ │480 + var tb = try wgt.TextBox(ui.Widget).init(allocator, message, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .word, .label = "commit message" });│ │481 + errdefer tb.deinit(allocator); │ │482 + tb.getFocus().focusable = true; │ │483 + try box.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │484 + self.message_id = tb.getFocus().id; │ │485 + } │ │486 + │ │487 pub fn deinit(self: *View, allocator: std.mem.Allocator) void { │ │488 self.box.deinit(allocator); │ │489 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │557 } │ │558 } │ │559 │ │530 - // the selected hunk (or a window-navigation row) shows a single border │ │531 - // (the focused TextBox upgrades it to a double border itself, so it │ │532 - // stays single when focus is on the commit list); the rest keep their │ │533 - // space-reserving hidden border. │ │534 - const inner = self.diffInner(); │ │535 - for (inner.children.keys(), inner.children.values()) |id, *child| { │ │536 - switch (child.widget) { │ │537 - .text_box => |*tb| tb.options.border_style = if (inner.getFocus().child_id == id) .single else .hidden,│ │538 - else => {}, │ │539 - } │ │540 - } │ │541 - │ │560 // cap the list at list_max_width only while the diff pane fits beside it. │ │561 // the box drops the diff when the width can't hold both minimums, so when │ │562 // it's that narrow we lift the cap and let the list fill the whole width. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │566 // stretch the diff pane across the rest of the width so it fills the area │ │567 // rather than shrinking to its content; its scroll fills the pane. when │ │568 // too narrow for both, it fills the whole width. │ │551 - if (constraint.max_size.width) |w| { │ │552 - self.contentBox().children.values()[diff_index].min_size = .{ .width = if (both_panes_fit) w - list_max_width else w, .height = null };│ │553 - } else { │ │554 - self.contentBox().children.values()[diff_index].min_size = .{ .width = diff_min_width, .height = null }; │ │569 + const diff_width: usize = if (constraint.max_size.width) |w| │ │570 + (if (both_panes_fit) w - list_max_width else w) │ │571 + else │ │572 + diff_min_width; │ │573 + self.contentBox().children.values()[diff_index].min_size = .{ .width = diff_width, .height = null }; │ │574 + │ │575 + // cap the message row so it wraps within the pane, leaving room for the │ │576 + // pane's border and its scrollbar column. │ │577 + if (self.message_id) |id| { │ │578 + if (self.diffInner().children.getPtr(id)) |child| { │ │579 + child.max_size = .{ .width = diff_width -| 3, .height = null }; │ │580 + } │ │581 } │ │582 │ │583 // the web bounds the layout to the browser viewport like the terminal; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │608 for (inner.children.values()) |*child| child.widget.deinit(allocator); │ │609 inner.children.clearAndFree(allocator); │ │610 inner.getFocus().child_id = null; │ │611 + self.message_id = null; │ │612 │ │613 if (path.len != 0) { │ │614 // the file's path, then a row returning to this commit's unfiltered diff.│ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │588 - var label = try wgt.TextBox(ui.Widget).init(allocator, path, .{ .border_style = .hidden, .rounded_corners = true, .wrap_kind = .none });│ │615 + var label = try wgt.TextBox(ui.Widget).init(allocator, path, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │616 errdefer label.deinit(allocator); │ │617 label.getFocus().focusable = true; │ │618 try inner.children.put(allocator, label.getFocus().id, .{ .widget = .{ .text_box = label }, .rect = null, .min_size = null }); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │619 try self.addNavLink(allocator, inner, "← all files", commit.oid, 0, ""); │ │620 } else { │ │594 - // the first row always links to viewing the repo's files at this commit.│ │621 + try self.addMessageBox(allocator, inner, commit.message); │ │622 try self.addViewFilesLink(allocator, inner, commit.oid); │ │623 } │ │624 │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯