╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │371 │ │372 pub const View = struct { │ │373 // a vertical stack: the clone url row on top, then a horizontal │ │451 - // split with the commit list on the left and a diff pane on the right │ │452 - // showing the selected commit's diff. │ │374 + // split with the commit list on the left and a pane on the right │ │375 + // showing the selected commit's details. │ │376 box: wgt.Box(ui.Widget), // vert: [header_index] = clone url row, [content_index] = split│ │377 data: *const Self, │ │378 session: *ui.Session, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │456 - // the commit whose diff the pane currently shows (index into data.commits).│ │457 - diffed_index: ?usize, │ │379 + // the commit the pane currently shows (index into data.commits). │ │380 + detailed_index: ?usize, │ │381 │ │382 // the sub-header leads the box where there is one; local mode has none │ │383 const header_index: usize = 0; │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │384 // indices within the content box (the horizontal split). │ │385 const list_index: usize = 0; │ │463 - const diff_index: usize = 1; │ │386 + const detail_index: usize = 1; │ │387 const list_max_width: usize = 35; │ │465 - const diff_min_width: usize = 40; │ │388 + const detail_min_width: usize = 40; │ │389 │ │390 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │391 var outer = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .vert });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │396 errdefer center.deinit(allocator); │ │397 outer.getFocus().child_id = center.getFocus().id; │ │398 try outer.children.put(allocator, center.getFocus().id, .{ .widget = .{ .center = center }, .rect = null, .min_size = null });│ │476 - return .{ .box = outer, .data = data, .session = session, .diffed_index = null }; │ │399 + return .{ .box = outer, .data = data, .session = session, .detailed_index = null }; │ │400 } │ │401 │ │402 // the search box and the clone url at the top. local mode has neither. │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │418 for (data.commits, 0..) |commit, index| { │ │419 // an in-page "ai:" anchor so a commit row is clickable with │ │420 // js off (the browser follows it, rooting the list there); │ │498 - // with wasm the click just selects it and swaps the diff pane. │ │499 - const content = if (index == 0) data.content else Content{ .diff = .{} }; │ │500 - try addRow(allocator, &list_box, firstLine(commit.message), try commitRowLink(session.page_arena, data, commit, content), if (commit.merge) "(merge)" else ""); │ │421 + // with wasm the click just selects it and swaps the pane. │ │422 + try addRow(allocator, &list_box, firstLine(commit.message), try commitRowLink(session.page_arena, data, commit, index == 0 and data.message), if (commit.merge) "(merge)" else "");│ │423 } │ │424 if (data.next_start) |next| { │ │425 try addRow(allocator, &list_box, "next →", try nextPageLink(session.page_arena, data, next), ""); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │431 try box.children.put(allocator, list_scroll.getFocus().id, .{ .widget = .{ .scroll = list_scroll }, .rect = null, .min_size = .{ .width = list_max_width, .height = null }, .max_size = .{ .width = list_max_width, .height = null } });│ │432 } │ │433 │ │512 - // the diff pane — a frame around a scroll of the hunks │ │434 + // the detail pane: a frame around a scroll of its rows │ │435 { │ │514 - var diff_outer = blk: { │ │515 - var diff_scroll = try Diff.View.initEmpty(allocator, session); │ │516 - errdefer diff_scroll.deinit(allocator); │ │436 + var detail_outer = blk: { │ │437 + var detail_scroll = try Diff.View.initEmpty(allocator, session); │ │438 + errdefer detail_scroll.deinit(allocator); │ │439 var frame = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = .hidden, .direction = .vert }); │ │440 errdefer frame.deinit(allocator); │ │441 // the frame's selected child is its scroll, so the focus chain │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │520 - // reaches a hunk (populateDiff points the scroll's inner box at │ │521 - // one), letting focus recovery descend into the diff pane after │ │442 + // reaches a row (populateDetail points the scroll's inner box at │ │443 + // one), letting focus recovery descend into the pane after │ │444 // it's laid out beside a too-narrow list. │ │523 - frame.getFocus().child_id = diff_scroll.getFocus().id; │ │524 - try frame.children.put(allocator, diff_scroll.getFocus().id, .{ .widget = .{ .diff_view = diff_scroll }, .rect = null, .min_size = null }); │ │445 + frame.getFocus().child_id = detail_scroll.getFocus().id; │ │446 + try frame.children.put(allocator, detail_scroll.getFocus().id, .{ .widget = .{ .diff_view = detail_scroll }, .rect = null, .min_size = null }); │ │447 break :blk frame; │ │448 }; │ │527 - errdefer diff_outer.deinit(allocator); │ │528 - diff_outer.getFocus().mode = .mouse; │ │529 - try box.children.put(allocator, diff_outer.getFocus().id, .{ .widget = .{ .box = diff_outer }, .rect = null, .min_size = .{ .width = diff_min_width, .height = null } }); │ │449 + errdefer detail_outer.deinit(allocator); │ │450 + detail_outer.getFocus().mode = .mouse; │ │451 + try box.children.put(allocator, detail_outer.getFocus().id, .{ .widget = .{ .box = detail_outer }, .rect = null, .min_size = .{ .width = detail_min_width, .height = null } });│ │452 } │ │453 │ │454 box.getFocus().child_id = box.children.keys()[list_index]; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────╮ │462 .box = outer, │ │463 .data = data, │ │464 .session = session, │ │543 - .diffed_index = null, │ │465 + .detailed_index = null,│ │466 }; │ │467 } │ │468 │ ╰────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │532 return &self.listScroll().child.box; │ │533 } │ │534 │ │613 - fn diffOuter(self: *View) *wgt.Box(ui.Widget) { │ │614 - return &self.contentBox().children.values()[diff_index].widget.box; │ │535 + fn detailOuter(self: *View) *wgt.Box(ui.Widget) { │ │536 + return &self.contentBox().children.values()[detail_index].widget.box; │ │537 } │ │538 │ │617 - fn diffScroll(self: *View) *wgt.Scroll(ui.Widget) { │ │618 - return &self.diffOuter().children.values()[0].widget.diff_view.scroll; │ │539 + fn detailScroll(self: *View) *wgt.Scroll(ui.Widget) { │ │540 + return &self.detailOuter().children.values()[0].widget.diff_view.scroll;│ │541 } │ │542 │ │621 - fn diffInner(self: *View) *wgt.Box(ui.Widget) { │ │622 - return &self.diffScroll().child.box; │ │543 + fn detailInner(self: *View) *wgt.Box(ui.Widget) { │ │544 + return &self.detailScroll().child.box; │ │545 } │ │546 │ │625 - fn diffActive(self: *View) bool { │ │547 + fn detailActive(self: *View) bool { │ │548 const content = self.contentBox(); │ │549 const cid = content.getFocus().child_id orelse return false; │ │628 - return content.children.getIndex(cid) == diff_index; │ │550 + return content.children.getIndex(cid) == detail_index; │ │551 } │ │552 │ │631 - // what the pane shows for the commit at `sel`. the page's content only │ │632 - // applies to the commit it walks from; the rest show their plain diff. │ │633 - fn paneContent(self: *View, sel: usize) Self.Content { │ │634 - return if (sel == 0) self.data.content else .{ .diff = .{} }; │ │635 - } │ │636 - │ │553 // the selected commit's index, or null when the "next" row is selected. │ │554 fn selectedCommitIndex(self: *View) ?usize { │ │555 const lb = self.listBox(); │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │563 self.clearGrid(); │ │564 if (self.data.no_commits) return self.box.build(allocator, constraint, root_focus);│ │565 │ │650 - // swap the diff pane to the selected commit when it changes. │ │651 - try self.refreshDiff(allocator); │ │566 + // swap the detail pane to the selected commit when it changes. │ │567 + try self.refreshDetail(allocator); │ │568 │ │569 // the selected list row shows a border (the focused TextBox upgrades it │ │570 // to a double border itself); the rest stay borderless. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯