╭ changed ─────────────────╮ │src/ui/Repo/Attachment.zig│ ╰──────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │11 name: []const u8, │ │12 }; │ │13 │ │14 -// every attachment on a parent event, oldest first. removed ones are│ │14 +// every attachment on a target event, oldest first. removed ones are│ │15 // left out. │ │16 pub fn load( │ │17 comptime hash_kind: hash.HashKind, │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │18 arena: *std.heap.ArenaAllocator, │ │19 haxy_moment: evt.EventDB(hash_kind).HashMap(.read_only), │ │20 - parent_id: []const u8, │ │20 + target_id: *const [evt.event_id_size]u8, │ │21 ) ![]const WithId { │ │22 const DB = evt.EventDB(hash_kind); │ │23 - const index_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, evt.Attachment.parent_id_to_attachment_id_set_key)) orelse return &.{};│ │23 + const index_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, evt.Attachment.target_id_to_attachment_id_set_key)) orelse return &.{};│ │24 const index = try DB.HashMap(.read_only).init(index_cursor); │ │25 - const set_cursor = try index.getCursor(hash.hashInt(hash_kind, parent_id)) orelse return &.{}; │ │25 + const set_cursor = try index.getCursor(hash.hashInt(hash_kind, target_id)) orelse return &.{}; │ │26 const set = try DB.SortedSet(.read_only).init(set_cursor); │ │27 │ │28 var attachments: std.ArrayList(WithId) = .empty; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────╮ │46 box: *wgt.Box(ui.Widget), │ │47 session: *ui.Session, │ │48 identity: []const u8, │ │49 - parent_url: []const u8, │ │49 + target_url: []const u8, │ │50 attachments: []const WithId, │ │51 ) !void { │ │52 const pa = session.page_arena.allocator();│ ╰──────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │65 tb.getFocus().kind = .{ .custom = try pa.print("{s}{s}", .{ ui.raw_link_prefix, try url(session.page_arena, identity, &entry.id) }) };│ │66 try row.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │67 │ │68 - row.getFocus().kind = .{ .custom = try pa.print("form:{s}/attachment:{s}/remove", .{ parent_url, &entry.id }) }; │ │68 + row.getFocus().kind = .{ .custom = try pa.print("form:{s}/attachment:{s}/remove", .{ target_url, &entry.id }) }; │ │69 var remove = try wgt.TextBox.init(allocator, "✕", .{ .border = .single, .round_corners = true, .wrap_kind = .none }); │ │70 errdefer remove.deinit(allocator); │ │71 remove.getFocus().mode = .all; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯