╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │713 if (self.detailActive()) { │ │714 // the way back to the list, by enter or a click │ │715 if (self.back_id) |id| { │ │716 - if ((key == .enter and root_focus.grandchild_id == id) or (key == .mouse and inp.leftClickOn(root_focus, id, key.mouse))) return self.focusList(root_focus);│ │716 + if (inp.activated(root_focus, id, key)) return self.focusList(root_focus); │ │717 } │ │718 const inner = self.detailInner(); │ │719 if (inp.rowDelta(key, @intCast(inner.children.count()))) |delta| { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │836 fn detailInput(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │837 // the way back to the list, by enter or a click │ │838 if (self.back_id) |id| { │ │839 - if ((key == .enter and root_focus.grandchild_id == id) or (key == .mouse and inp.leftClickOn(root_focus, id, key.mouse))) return self.focusList(root_focus);│ │839 + if (inp.activated(root_focus, id, key)) return self.focusList(root_focus); │ │840 } │ │841 const sc = self.detailScroll(); │ │842 const on_content = self.focusOnContent(root_focus); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Undo.zig│ ╰────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │487 box.children.values()[box.children.count() - 1].widget.text_box.options.top_label.text = label;│ │488 } │ │489 │ │490 - // enter counts only on the focused button; a click counts anywhere on it │ │491 - fn activated(root_focus: *Focus, button_id: usize, key: Key) bool { │ │492 - return switch (key) { │ │493 - .enter => root_focus.grandchild_id == button_id, │ │494 - .mouse => |mouse| inp.leftClickOn(root_focus, button_id, mouse), │ │495 - else => false, │ │496 - }; │ │497 - } │ │498 - │ │490 // the terminal hosts run the action after rendering; the web renderer │ │491 // posts the form instead, and wasm has no repository to act on │ │492 fn requestUndo(self: *View, route: ui.RoutablePage) void { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │600 if (self.detailActive()) { │ │601 const details = &self.detailScroll().child.box; │ │602 if (self.selected()) |index| { │ │612 - if (activated(root_focus, details.children.keys()[0], key) and self.data.handle.canUndo() and self.data.items[index].index > 0) { │ │603 + if (inp.activated(root_focus, details.children.keys()[0], key) and self.data.handle.canUndo() and self.data.items[index].index > 0) { │ │604 self.requestUndo(ui.RoutablePage.repoUndoRoute(self.data.identity, self.data.items[index].index) orelse return error.RouteTooLong);│ │605 return; │ │606 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │624 fn clearInput(self: *View, key: Key, root_focus: *Focus) !void { │ │625 const center = &self.box.children.values()[content_index].widget.center; │ │626 const button_id = center.child.box.getFocus().child_id orelse return; │ │636 - if (!activated(root_focus, button_id, key) or !self.data.handle.canUndo()) return; │ │627 + if (!inp.activated(root_focus, button_id, key) or !self.data.handle.canUndo()) return; │ │628 self.requestUndo(ui.RoutablePage.repoUndoClearRoute(self.data.identity) orelse return error.RouteTooLong);│ │629 } │ │630 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────╮ │src/ui/input.zig│ ╰────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │56 return if (new_tab != current_tab) new_tab else null; │ │57 } │ │58 │ │59 +/// enter counts only on the focused button; a click counts anywhere on it│ │60 +pub fn activated(root_focus: *Focus, button_id: usize, key: Key) bool { │ │61 + return switch (key) { │ │62 + .enter => root_focus.grandchild_id == button_id, │ │63 + .mouse => |mouse| leftClickOn(root_focus, button_id, mouse), │ │64 + else => false, │ │65 + }; │ │66 +} │ │67 + │ ╰──────────────────────────────────────────────────────────────────────────────╯