╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭─────────────────────────────────────────────────╮ │576 _ = root_focus; │ │577 } │ │578 │ │579 - pub fn clearGrid(self: *TagFlow) void { │ │579 + pub fn clearGrid(self: *WordFlow) void {│ │580 if (self.grid) |*grid| { │ │581 grid.deinit(); │ │582 self.grid = null; │ ╰─────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │584 for (self.text_boxes.items) |*tb| tb.clearGrid();│ │585 } │ │586 │ │587 - pub fn getGrid(self: TagFlow) ?Grid { │ │587 + pub fn getGrid(self: WordFlow) ?Grid { │ │588 return self.grid; │ │589 } │ │590 │ ╰──────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────╮ │591 - pub fn getFocus(self: *TagFlow) *Focus { │ │591 + pub fn getFocus(self: *WordFlow) *Focus {│ │592 return self.focus; │ │593 } │ │594 │ ╰──────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │595 - pub fn indexOfFocusId(self: TagFlow, focus_id: usize) ?usize { │ │595 + pub fn indexOfFocusId(self: WordFlow, focus_id: usize) ?usize {│ │596 for (self.text_boxes.items, 0..) |tb, i| { │ │597 if (tb.focus.id == focus_id) return i; │ │598 } │ ╰────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │601 │ │602 // the first item of the row below (when `downward`) or above, or null at│ │603 // the flow's edge. items are laid out in order, so y is nondecreasing. │ │604 - pub fn rowStep(self: TagFlow, index: usize, downward: bool) ?usize { │ │604 + pub fn rowStep(self: WordFlow, index: usize, downward: bool) ?usize { │ │605 const rects = self.rects.items; │ │606 if (index >= rects.len) return null; │ │607 const cur_y = rects[index].y; │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │20 const Attachment = @import("../Repo/Attachment.zig");│ │21 │ │22 const Widget = widget.Widget; │ │23 -const TagFlow = widget.TagFlow; │ │23 +const WordFlow = widget.WordFlow; │ │24 const Center = widget.Center; │ │25 const SubmitButton = widget.SubmitButton; │ │26 const Spacer = widget.Spacer; │ ╰─────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │86 .ours = .{ .text = ours.event.title, .author = our_author }, │ │87 .theirs = .{ .text = theirs.event.title, .author = their_author }, │ │88 }; │ │89 - } else if (std.mem.eql(u8, field, "tags")) { │ │90 - conflict.tags = .{ │ │91 - .ours = .{ .text = ours.event.tags, .author = our_author }, │ │92 - .theirs = .{ .text = theirs.event.tags, .author = their_author }, │ │89 + } else if (std.mem.eql(u8, field, "labels")) { │ │90 + conflict.labels = .{ │ │91 + .ours = .{ .text = ours.event.labels, .author = our_author }, │ │92 + .theirs = .{ .text = theirs.event.labels, .author = their_author },│ │93 }; │ │94 } else if (std.mem.eql(u8, field, "description")) { │ │95 conflict.description = .{ │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │165 return try DB.SortedSet(.read_only).init(cursor); │ │166 } │ │167 │ │168 -pub fn tagStatusSet( │ │168 +pub fn labelStatusSet( │ │169 comptime Data: type, │ │170 comptime DB: type, │ │171 - tag_statuses: DB.SortedMap(.read_only), │ │172 - tag: []const u8, │ │171 + label_statuses: DB.SortedMap(.read_only), │ │172 + label: []const u8, │ │173 status: Data.Status, │ │174 ) !?DB.SortedSet(.read_only) { │ │175 - var key_buffer: Data.Event.TagStatusKey = undefined; │ │176 - const key = Data.Event.tagStatusKey(&key_buffer, tag, status) catch return null; │ │177 - const cursor = (try tag_statuses.getCursor(key)) orelse return null; │ │175 + var key_buffer: Data.Event.LabelStatusKey = undefined; │ │176 + const key = Data.Event.labelStatusKey(&key_buffer, label, status) catch return null;│ │177 + const cursor = (try label_statuses.getCursor(key)) orelse return null; │ │178 return try DB.SortedSet(.read_only).init(cursor); │ │179 } │ │180 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────╮ │181 -pub fn loadTags( │ │181 +pub fn loadLabels( │ │182 comptime Data: type, │ │183 comptime hash_kind: hash.HashKind,│ │184 arena: *std.heap.ArenaAllocator, │ ╰───────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │186 ) ![]const []const u8 { │ │187 const aa = arena.allocator(); │ │188 const DB = evt.EventDB(hash_kind); │ │189 - const cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, Data.Event.tag_status_to_id_set_key)) orelse return &.{}; │ │190 - const tag_statuses = try DB.SortedMap(.read_only).init(cursor); │ │191 - var tags: std.ArrayList([]const u8) = .empty; │ │192 - var iter = try tag_statuses.iterator(); │ │189 + const cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, Data.Event.label_status_to_id_set_key)) orelse return &.{};│ │190 + const label_statuses = try DB.SortedMap(.read_only).init(cursor); │ │191 + var labels: std.ArrayList([]const u8) = .empty; │ │192 + var iter = try label_statuses.iterator(); │ │193 while (try iter.next()) |pair_cursor| { │ │194 - if (tags.items.len == Data.max_tags) break; │ │194 + if (labels.items.len == Data.max_labels) break; │ │195 var entry_cursor = pair_cursor; │ │196 const pair = try entry_cursor.readKeyValuePair(); │ │197 const key = try pair.key_cursor.readBytesAlloc(aa, null); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯