╭ changed ────────────╮ │src/ui/Home/Users.zig│ ╰─────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │59 return result; │ │60 } │ │61 │ │62 +// a first window without users, which shows the empty message │ │63 +fn isEmpty(self: *const Self) bool { │ │64 + return self.users.len == 0 and self.start == 0; │ │65 +} │ │66 + │ │67 pub const View = struct { │ │68 // a vertical box: the search sub-header above the scrolling list. focus│ │69 // points at the header's box or the list's selected row. │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 96 try box.children.put(allocator, header.getFocus().id, .{ .widget = .{ .box = header }, .rect = null, .min_size = .{ .width = null, .height = ui.widget.SearchBox.min_size.height } });│ │ 97 } │ │ 98 │ │ 94 - { │ │ 99 + // an empty first window has no rows, not even paging ones │ │100 + if (data.isEmpty()) { │ │101 + var center = try ui.widget.initEmpty(allocator); │ │102 + errdefer center.deinit(allocator); │ │103 + try box.children.put(allocator, center.getFocus().id, .{ .widget = .{ .center = center }, .rect = null, .min_size = null }); │ │104 + } else { │ │105 var list = try ui.widget.FlowBox.Scroll.init(allocator, .{ .cell_height = 1 }, !session.is_terminal); │ │106 errdefer list.deinit(allocator); │ │107 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │159 const direction = inp.vertDirection(key); │ │160 if (self.headerActive()) { │ │161 const search_box = self.searchBox(); │ │152 - if (direction == .down) return root_focus.setFocus(self.listScroll().getFocus().id);│ │162 + if (direction == .down) { │ │163 + // the empty message has nothing to focus │ │164 + if (!self.data.isEmpty()) root_focus.setFocus(self.listScroll().getFocus().id); │ │165 + return; │ │166 + } │ │167 if (key == .enter) { │ │168 const text = try search_box.text(allocator); │ │169 defer allocator.free(text); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯