╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │453 │ │454 fn entryDraft(entry: Entry) bool { │ │455 return if (supports_drafts) entry.draft else false; │ │456 - } │ │457 - │ │458 - fn entryHasFork(entry: Entry) bool { │ │459 - return if (supports_forks) entry.fork_exists else false;│ │456 } │ │457 │ │458 const StatusChange = struct { │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │532 const row = self.toolRow(); │ │533 const pa = self.session.page_arena.allocator(); │ │534 │ │539 - if (entryHasFork(entry) and self.session.data.current_page.parent() != .fork) { │ │540 - const diff_route = ui.RoutablePage.forkDiffRoute(self.data.identity, entry.id, 0, "") orelse return error.RouteTooLong; │ │541 - try addToolButton(allocator, row, "view diff", "", try std.fmt.allocPrint(pa, "a:{s}", .{try diff_route.toUrl(self.session.page_arena)})); │ │542 - const commits_route = ui.RoutablePage.forkCommitsRoute(self.data.identity, entry.id, "", 0, "") orelse return error.RouteTooLong; │ │543 - const commit_count = if (supports_forks) entry.commit_count else null; │ │544 - const label = if (commit_count) |count| try std.fmt.allocPrint(pa, "view commits ({d})", .{count}) else "view commits"; │ │545 - try addToolButton(allocator, row, label, "", try std.fmt.allocPrint(pa, "a:{s}", .{try commits_route.toUrl(self.session.page_arena)})); │ │535 + if (supports_forks and self.session.data.current_page.parent() != .fork) { │ │536 + if (entry.fork_exists) { │ │537 + const diff_route = ui.RoutablePage.forkDiffRoute(self.data.identity, entry.id, 0, "") orelse return error.RouteTooLong; │ │538 + try addToolButton(allocator, row, "view diff", "", try std.fmt.allocPrint(pa, "a:{s}", .{try diff_route.toUrl(self.session.page_arena)}));│ │539 + } │ │540 + if (try Data.commitsRoute(pa, self.data.identity, entry)) |route| { │ │541 + const label = if (entry.commit_count) |count| try std.fmt.allocPrint(pa, "view commits ({d})", .{count}) else "view commits"; │ │542 + try addToolButton(allocator, row, label, "", try std.fmt.allocPrint(pa, "a:{s}", .{try route.toUrl(self.session.page_arena)})); │ │543 + } │ │544 } │ │545 │ │546 { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │595 const route = ui.RoutablePage.repoThreadRemoveRoute(kind, self.data.identity, entry.id, "") orelse return error.RouteTooLong;│ │596 try addToolButton(allocator, row, "✕", "", try std.fmt.allocPrint(pa, "a:{s}", .{try route.toUrl(self.session.page_arena)}));│ │597 } │ │600 - } │ │601 - │ │602 - for (row.children.keys(), row.children.values()) |id, *child| { │ │603 - if (child.widget.getFocus().mode != .all) continue; │ │604 - row.getFocus().child_id = id; │ │605 - break; │ │598 } │ │599 } │ │600 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │749 if (child_id == self.title_id) { │ │750 switch (key) { │ │751 .arrow_left => self.exit = .list, │ │760 - .arrow_up => if (!self.moveVertical(root_focus, false)) self.focusToolRow(root_focus),│ │752 + .arrow_up => if (!self.moveVertical(root_focus, false)) { │ │753 + self.exit = .header; │ │754 + }, │ │755 .arrow_down => _ = self.moveVertical(root_focus, true), │ │756 else => {}, │ │757 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │774 switch (child.*) { │ │775 .tag_flow => |*tags| self.tagsInput(child_index, tags, key, root_focus), │ │776 .copyable_text => |*copyable| switch (key) { │ │783 - .arrow_up => if (!self.moveVertical(root_focus, false)) self.focusToolRow(root_focus),│ │777 + .arrow_up => if (!self.moveVertical(root_focus, false)) { │ │778 + self.exit = .header; │ │779 + }, │ │780 .arrow_down => _ = self.moveVertical(root_focus, true), │ │781 .arrow_left => if (copyable.selected == 0) { │ │782 self.exit = .list; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1121 │ │1122 fn toolRowFocused(self: *This, root_focus: *Focus) bool { │ │1123 return self.focusedChild(root_focus) == tool_row_index; │ │1128 - } │ │1129 - │ │1130 - fn focusToolRow(self: *This, root_focus: *Focus) void { │ │1131 - const child_id = self.toolRow().getFocus().child_id orelse { │ │1132 - self.exit = .header; │ │1133 - return; │ │1134 - }; │ │1135 - root_focus.setFocus(child_id); │ │1136 - if (self.inner().children.values()[tool_row_index].rect) |rect| self.scroll.scrollToRect(rect);│ │1124 } │ │1125 │ │1126 pub fn focusFirst(self: *This, root_focus: ?*Focus) bool { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────╮ │1127 const inner_box = self.inner(); │ │1141 - for (tool_row_index + 1..inner_box.children.count()) |child_index| { │ │1142 - if (!self.childFocusable(child_index)) continue; │ │1128 + for (inner_box.children.values(), 0..) |*child, child_index| { │ │1129 + switch (child.widget) { │ │1130 + .box => |*box| { │ │1131 + for (box.children.keys(), box.children.values()) |id, *item| {│ │1132 + if (item.widget.getFocus().mode != .all) continue; │ │1133 + box.getFocus().child_id = id; │ │1134 + break; │ │1135 + } else continue; │ │1136 + }, │ │1137 + else => if (!self.childFocusable(child_index)) continue, │ │1138 + } │ │1139 if (root_focus) |focus| │ │1140 self.focusChild(child_index, false, focus) │ │1141 else │ ╰────────────────────────────────────────────────────────────────────────────────────────────╯