╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │114 defer arena.deinit(); │ │115 const aa = arena.allocator(); │ │116 │ │117 - const lines = try aa.alloc([]const u8, data.repos.len); │ │118 - const links = try aa.alloc([]const u8, data.repos.len); │ │119 - for (data.repos, 0..) |repo, i| { │ │120 - lines[i] = try std.fmt.allocPrint(aa, "{s} - {s}", .{ repo.name, repo.description }); │ │117 + var items: std.ArrayList(ui.FlowBox.Item) = .empty; │ │118 + for (data.repos) |repo| │ │119 // clicking a repo opens its page; the "a:" prefix makes the web │ │120 // renderer emit an <a href="/repo/alice/foo"> anchor. │ │123 - links[i] = try std.fmt.allocPrint(aa, "a:/repo/{s}/{s}", .{ data.user.name, repo.name }); │ │124 - } │ │125 - try list.setItems(allocator, lines, links); │ │121 + try items.append(aa, .{ │ │122 + .text = try std.fmt.allocPrint(aa, "{s} - {s}", .{ repo.name, repo.description }), │ │123 + .link = try std.fmt.allocPrint(aa, "a:/repo/{s}/{s}", .{ data.user.name, repo.name }),│ │124 + }); │ │125 + try list.setItems(allocator, items.items); │ │126 │ │127 try stack.children.put(allocator, list.getFocus().id, .{ .flow_box_scroll = list }); │ │128 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯