╭ changed ──────╮ │src/test/ui.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const ui = @import("../ui.zig"); │ │3 const Commits = @import("../ui/Repo/Commits.zig"); │ │4 -const SubHeader = @import("../ui/Repo/Commits/SubHeader.zig"); │ │4 │ │5 // the "next" row at the bottom of the commits list must be recognized as a │ │6 // cross-page link (so a click navigates), exactly like the diff pane's "next".│ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │21 .{ .oid = oid0, .date = "2024-01-01", .message = "first", .hunks = &.{}, .window_start = 0, .has_prev = false, .has_more = false },│ │22 }, │ │23 .next_start = next_oid, │ │25 - .sub_header = try SubHeader.init(arena.allocator(), .object, oid0), │ │24 + .header = try Commits.Header.init(arena.allocator(), .object, oid0), │ │25 }; │ │26 │ │27 var session = ui.Session{ .arena = &arena, .page_arena = &arena, .is_terminal = true }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────╮ │1116 home_header: Home.Header.View, │ │1117 user_header: User.Header.View, │ │1118 repo_header: Repo.Header.View, │ │1119 - repo_files_sub_header: Repo.Files.SubHeader.View, │ │1120 - repo_commits_sub_header: Repo.Commits.SubHeader.View,│ │1121 - repo_issues_sub_header: Repo.Issues.SubHeader.View, │ │1119 + repo_files_header: Repo.Files.Header.View, │ │1120 + repo_commits_header: Repo.Commits.Header.View, │ │1121 + repo_issues_header: Repo.Issues.Header, │ │1122 repo_files: Repo.Files.View, │ │1123 repo_commits: Repo.Commits.View, │ │1124 repo_refs: Repo.Refs.View, │ ╰───────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────╮ │12 const Grid = xitui.grid.Grid; │ │13 const Focus = xitui.focus.Focus; │ │14 const inp = @import("../input.zig"); │ │15 - │ │16 -pub const SubHeader = @import("Commits/SubHeader.zig"); │ │15 │ │16 // how many commits a page shows before a "next" link appears.│ │17 const page_size = 20; │ ╰──────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │48 // the first oid of the next page, or null when this is the last page.│ │49 next_start: ?[]const u8, │ │50 // the "viewing <ref> <value>" banner shown above the log. │ │53 -sub_header: SubHeader, │ │51 +header: Header, │ │52 │ │53 const Self = @This(); │ │54 │ ╰──────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │137 .ref_or_oid_value = resolved.value, │ │138 .commits = try aa.dupe(Commit, buf[0..count]), │ │139 .next_start = next_start, │ │142 - .sub_header = try SubHeader.init(aa, resolved.ref_or_oid, resolved.value),│ │140 + .header = try Header.init(aa, resolved.ref_or_oid, resolved.value), │ │141 }; │ │142 } │ │143 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │149 .ref_or_oid_value = try aa.dupe(u8, value), │ │150 .commits = &.{}, │ │151 .next_start = null, │ │154 - .sub_header = try SubHeader.init(aa, ref_or_oid, value),│ │152 + .header = try Header.init(aa, ref_or_oid, value), │ │153 }; │ │154 } │ │155 │ ╰─────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │300 // a vertical stack: the "viewing <ref>" banner on top, then a horizontal │ │301 // split with the commit list on the left and a diff pane on the right │ │302 // showing the selected commit's diff. │ │305 - box: wgt.Box(ui.Widget), // vert: [sub_header_index] = banner, [content_index] = split│ │303 + box: wgt.Box(ui.Widget), // vert: [header_index] = banner, [content_index] = split │ │304 data: *const Self, │ │305 session: *ui.Session, │ │306 // the commit whose diff the pane currently shows (index into data.commits). │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────╮ │307 diffed_index: ?usize, │ │308 │ │311 - const sub_header_index: usize = 0; │ │309 + const header_index: usize = 0; │ │310 const content_index: usize = 1; │ │311 // indices within the content box (the horizontal split).│ │312 const list_index: usize = 0; │ ╰──────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │320 │ │321 // the ref banner at the top. │ │322 { │ │325 - var sub_header = try SubHeader.View.init(allocator, &data.sub_header, session); │ │326 - errdefer sub_header.deinit(allocator); │ │327 - try outer.children.put(allocator, sub_header.getFocus().id, .{ .widget = .{ .repo_commits_sub_header = sub_header }, .rect = null, .min_size = .{ .width = null, .height = 3 } });│ │323 + var header = try Header.View.init(allocator, &data.header, session); │ │324 + errdefer header.deinit(allocator); │ │325 + try outer.children.put(allocator, header.getFocus().id, .{ .widget = .{ .repo_commits_header = header }, .rect = null, .min_size = .{ .width = null, .height = 3 } }); │ │326 } │ │327 │ │328 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .horiz }); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯