╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1472 var button = try wgt.TextBox(ui.Widget).init(allocator, action, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │1473 errdefer button.deinit(allocator); │ │1474 button.getFocus().focusable = true; │ │1452 - // the renderer distinguishes plain clickables from buttons that │ │1453 - // should POST to a server route by this kind. │ │1475 + // the renderer distinguishes plain clickables from buttons │ │1476 + // that should POST to a server route by this kind. │ │1477 button.getFocus().kind = .{ .custom = "submit" }; │ │1478 + self.status_button_id[index] = button.getFocus().id; │ │1479 try row.children.put(allocator, button.getFocus().id, .{ .widget = .{ .text_box = button }, .rect = null, .min_size = .{ .width = action.len + 2, .height = null } });│ │1480 } │ │1481 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │1490 } │ │1491 } │ │1492 │ │1469 - // the resolve button on a conflicted issue, else the open/close │ │1470 - // button when present, the edit button otherwise │ │1471 - row.getFocus().child_id = row.children.keys()[button_in_row_index];│ │1493 + // the leftmost button: the attachment button when the session has │ │1494 + // one, else the resolve button on a conflicted issue, the │ │1495 + // open/close button when present, the edit button otherwise │ │1496 + row.getFocus().child_id = row.children.keys()[first_in_row_index]; │ │1497 } │ │1498 │ │1499 if (comment_page) |page| { │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1587 break :blk tb.getFocus().id; │ │1588 }; │ │1589 │ │1590 + try Attachment.appendRows(allocator, inner, self.session, self.data.identity, entry.attachments); │ │1591 + │ │1592 if (!description_page) { │ │1593 var reply = try Comment.linkBox(allocator, self.session, "new comment", ui.RoutablePage.repoCommentNewRoute(self.data.identity, entry.id, "") orelse return error.RouteTooLong);│ │1594 errdefer reply.deinit(allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1739 fn toolRowInput(self: *View, allocator: std.mem.Allocator, index: usize, key: Key, root_focus: *Focus) !void { │ │1740 const row = self.toolRow(index); │ │1741 const cur = if (row.getFocus().child_id) |cid| row.children.getIndex(cid) orelse return else return; │ │1715 - const on_status = cur == button_in_row_index and self.statusButton(index) != null; │ │1742 + const on_status = if (self.status_button_id[index]) |id| row.getFocus().child_id == id else false; │ │1743 switch (key) { │ │1717 - .arrow_left => if (cur > button_in_row_index) root_focus.setFocus(row.children.keys()[cur - 1]) else try self.focusList(index, root_focus),│ │1744 + .arrow_left => if (cur > first_in_row_index) root_focus.setFocus(row.children.keys()[cur - 1]) else try self.focusList(index, root_focus), │ │1745 .arrow_right => if (cur + 1 < row.children.count()) root_focus.setFocus(row.children.keys()[cur + 1]), │ │1746 .arrow_up => self.focusHeader(root_focus), │ │1747 .arrow_down => { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1749 self.detailScroll(index).y = 0; │ │1750 }, │ │1751 .enter => if (on_status) try self.toggleIssueStatus(allocator, index), │ │1725 - .mouse => |mouse| if (self.statusButton(index)) |button| { │ │1726 - if (inp.leftClickOn(root_focus, button.getFocus().id, mouse)) try self.toggleIssueStatus(allocator, index);│ │1752 + .mouse => |mouse| if (self.status_button_id[index]) |id| { │ │1753 + if (inp.leftClickOn(root_focus, id, mouse)) try self.toggleIssueStatus(allocator, index); │ │1754 }, │ │1755 else => {}, │ │1756 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │2443 } │ │2444 } │ │2445 │ │2419 - const button_in_row_index: usize = 1; │ │2446 const title_child_index: usize = 0; │ │2447 const tags_child_index: usize = 2; │ │2448 + │ │2449 + // the tool row's first child after the spacer that pushes it right│ │2450 + const first_in_row_index: usize = 1; │ │2451 │ │2452 fn tagFlow(self: *View, index: usize) ?*ui.TagFlow { │ │2453 const inner = self.detailInner(index); │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2464 return inner.children.getIndex(cid) == tags_child_index and self.tagFlow(index) != null;│ │2465 } │ │2466 │ │2438 - // the open/close button inside the detail frame's tool row, identified │ │2439 - // by its posting kind; a logged-out session's or conflicted issue's row │ │2440 - // has none. │ │2441 - fn statusButton(self: *View, index: usize) ?*wgt.TextBox(ui.Widget) { │ │2442 - const row = self.toolRow(index); │ │2443 - if (row.children.count() <= button_in_row_index) return null; │ │2444 - switch (row.children.values()[button_in_row_index].widget) { │ │2445 - .text_box => |*tb| switch (tb.box.focus.kind) { │ │2446 - .custom => |custom| if (std.mem.eql(u8, custom, "submit")) return tb, │ │2447 - else => {}, │ │2448 - }, │ │2449 - else => {}, │ │2450 - } │ │2451 - return null; │ │2452 - } │ │2453 - │ │2467 fn toolRowFocused(self: *View, index: usize) bool { │ │2468 const outer = self.detailOuter(index); │ │2469 const cid = outer.getFocus().child_id orelse return false; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯