╭ changed ─────────╮ │src/ui/NewRepo.zig│ ╰──────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 93 const child = &self.formBox().children.values()[cur]; │ │ 94 │ │ 95 const on_submit = child.widget == .submit_button; │ │ 96 + const direction = inp.vertDirection(key); │ │ 97 + if (direction == .up or key == .back_tab) return if (cur > 0) root_focus.setFocus(self.formBox().children.keys()[cur - 1]); │ │ 98 + if (direction == .down or key == .tab) return if (cur + 1 < self.formBox().children.count()) root_focus.setFocus(self.formBox().children.keys()[cur + 1]);│ │ 99 switch (key) { │ │ 97 - .arrow_up, .back_tab => return if (cur > 0) root_focus.setFocus(self.formBox().children.keys()[cur - 1]), │ │ 98 - .arrow_down, .tab => return if (cur + 1 < self.formBox().children.count()) root_focus.setFocus(self.formBox().children.keys()[cur + 1]), │ │100 .enter => if (on_submit) return self.submitForm(allocator), │ │101 .mouse => |mouse| if (on_submit) { │ │102 if (inp.leftClickOn(root_focus, child.widget.submit_button.buttonId(), mouse)) return self.submitForm(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/ui/NewUser.zig│ ╰──────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │101 const child = &self.formBox().children.values()[cur]; │ │102 │ │103 const on_submit = child.widget == .submit_button; │ │104 + const direction = inp.vertDirection(key); │ │105 + if (direction == .up or key == .back_tab) return if (cur > 0) root_focus.setFocus(self.formBox().children.keys()[cur - 1]); │ │106 + if (direction == .down or key == .tab) return if (cur + 1 < self.formBox().children.count()) root_focus.setFocus(self.formBox().children.keys()[cur + 1]);│ │107 switch (key) { │ │105 - .arrow_up, .back_tab => return if (cur > 0) root_focus.setFocus(self.formBox().children.keys()[cur - 1]), │ │106 - .arrow_down, .tab => return if (cur + 1 < self.formBox().children.count()) root_focus.setFocus(self.formBox().children.keys()[cur + 1]), │ │108 .enter => if (on_submit) return self.submitForm(allocator), │ │109 .mouse => |mouse| if (on_submit) { │ │110 if (inp.leftClickOn(root_focus, child.widget.submit_button.buttonId(), mouse)) return self.submitForm(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │454 try box.children.put(allocator, detail_outer.getFocus().id, .{ .widget = .{ .box = detail_outer }, .rect = null, .min_size = .{ .width = detail_min_width, .height = null } });│ │455 } │ │456 │ │457 - box.getFocus().child_id = box.children.keys()[list_index]; │ │457 + box.getFocus().child_id = box.children.keys()[if (data.commits.len > 0) detail_index else list_index]; │ │458 try outer.children.put(allocator, box.getFocus().id, .{ .widget = .{ .box = box }, .rect = null, .min_size = null }); │ │459 │ │460 // focus lives in the split, except that search results start in the │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Events.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │416 detail_scroll.getFocus().mode = .mouse; │ │417 try content_box.children.put(allocator, detail_scroll.getFocus().id, .{ .widget = .{ .scroll = detail_scroll }, .rect = null, .min_size = .{ .width = detail_min_width, .height = null } });│ │418 │ │419 - content_box.getFocus().child_id = content_box.children.keys()[list_index]; │ │419 + content_box.getFocus().child_id = content_box.children.keys()[if (event_window.events.len > 0) detail_index else list_index]; │ │420 return content_box; │ │421 } │ │422 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │378 │ │379 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .horiz });│ │380 errdefer box.deinit(allocator); │ │381 + │ │382 + var shows_file = false; │ │383 │ │384 // the directory listing on the left (one focusable row each). │ │385 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │423 const entry_idx = selectedFileIndex(data) orelse if (data.find == null) readmeIndex(data.entries) else null; │ │424 sel = if (entry_idx) |i| i + base else 0; │ │425 list_box.getFocus().child_id = list_box.children.keys()[sel]; │ │426 + shows_file = sel >= base and sel - base < data.entries.len and !data.entries[sel - base].is_dir; │ │427 } │ │428 var sc = try wgt.Scroll(ui.Widget).init(allocator, .{ .box = list_box }, .{ .direction = .vert, .web_native = !session.is_terminal, .fill = true });│ │429 // start scrolled so the selected row begins at the top of the │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │486 try box.children.put(allocator, detail_outer.getFocus().id, .{ .widget = .{ .box = detail_outer }, .rect = null, .min_size = .{ .width = detail_min_width, .height = null } });│ │487 } │ │488 │ │486 - box.getFocus().child_id = box.children.keys()[list_index]; │ │489 + box.getFocus().child_id = box.children.keys()[if (shows_file) detail_index else list_index]; │ │490 try outer.children.put(allocator, box.getFocus().id, .{ .widget = .{ .box = box }, .rect = null, .min_size = null }); │ │491 │ │492 // focus lives in the split, except that search results start in the │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Undo.zig│ ╰────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │456 scroll.getFocus().mode = .mouse; │ │457 try box.children.put(allocator, scroll.getFocus().id, .{ .widget = .{ .scroll = scroll }, .rect = null, .min_size = .{ .width = detail_min_width, .height = null } });│ │458 } │ │459 - box.getFocus().child_id = box.children.keys()[0]; │ │459 + box.getFocus().child_id = box.children.keys()[if (data.items.len > 0) 1 else 0]; │ │460 try outer.children.put(allocator, box.getFocus().id, .{ .widget = .{ .box = box }, .rect = null, .min_size = null }); │ │461 outer.getFocus().child_id = outer.children.keys()[content_index]; │ │462 return .{ .box = outer, .data = data, .session = session }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1769 try box.children.put(allocator, frame.getFocus().id, .{ .widget = .{ .box = frame }, .rect = null, .min_size = .{ .width = detail_min_width, .height = null } });│ │1770 } │ │1771 │ │1772 - box.getFocus().child_id = box.children.keys()[list_index]; │ │1772 + box.getFocus().child_id = box.children.keys()[if (win.items.len > 0) detail_index else list_index]; │ │1773 return box; │ │1774 } │ │1775 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯