╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │198 const space = std.mem.indexOfScalar(u8, key, ' ') orelse continue;│ │199 - const tag = key[0..space]; │ │200 - if (tags.getLastOrNull()) |last| { │ │201 - if (std.mem.eql(u8, last, tag)) continue; │ │199 + const label = key[0..space]; │ │200 + if (labels.getLastOrNull()) |last| { │ │201 + if (std.mem.eql(u8, last, label)) continue; │ │202 } │ │203 - try tags.append(aa, tag); │ │203 + try labels.append(aa, label); │ │204 } │ │205 - return tags.items; │ │205 + return labels.items; │ │206 } │ │207 │ │208 // the key a list set (and the search index) stores a thread under │ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │661 return null; │ │662 } │ │663 │ │664 - fn listRoute(identity: []const u8, status: Status, tag: []const u8, selected: []const u8) ?ui.RoutablePage { │ │665 - return Data.listRoute(identity, status, tag, selected); │ │664 + fn listRoute(identity: []const u8, status: Status, label: []const u8, selected: []const u8) ?ui.RoutablePage {│ │665 + return Data.listRoute(identity, status, label, selected); │ │666 } │ │667 │ │668 fn draftsRoute(identity: []const u8) ?ui.RoutablePage { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │681 return if (supports_conflicts) Data.resolveRoute(identity, selected, picks) else null; │ │682 } │ │683 │ │684 - // a list link keeps the filters the page carries: the tag, and the │ │684 + // a list link keeps the filters the page carries: the label, and the │ │685 // search query when one is set │ │686 - fn listLink(page_arena: *std.heap.ArenaAllocator, identity: []const u8, status: Status, tag: []const u8, id: []const u8, search: []const u8) ![]const u8 { │ │687 - var route = listRoute(identity, status, tag, id) orelse return error.RouteTooLong; │ │686 + fn listLink(page_arena: *std.heap.ArenaAllocator, identity: []const u8, status: Status, label: []const u8, id: []const u8, search: []const u8) ![]const u8 {│ │687 + var route = listRoute(identity, status, label, id) orelse return error.RouteTooLong; │ │688 if (search.len != 0) route = route.withSearch(search) orelse return error.RouteTooLong; │ │689 return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{try route.toUrl(page_arena)}); │ │690 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │691 │ │692 - fn tagLink(page_arena: *std.heap.ArenaAllocator, identity: []const u8, status: Status, tag: []const u8, search: []const u8) ![]const u8 { │ │693 - const encoded = try ui.urlEncodeRef(page_arena.allocator(), tag); │ │692 + fn labelLink(page_arena: *std.heap.ArenaAllocator, identity: []const u8, status: Status, label: []const u8, search: []const u8) ![]const u8 {│ │693 + const encoded = try ui.urlEncodeRef(page_arena.allocator(), label); │ │694 return listLink(page_arena, identity, status, encoded, "", search); │ │695 } │ │696 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │829 try inner_box.children.put(allocator, author.getFocus().id, .{ .widget = .{ .text_box = author }, .rect = null, .min_size = null }); │ │830 self.author_id = author.getFocus().id; │ │831 │ │832 - var items: std.ArrayList(TagFlow.Item) = .empty; │ │832 + var items: std.ArrayList(WordFlow.Item) = .empty; │ │833 defer items.deinit(allocator); │ │834 - var tag_iter = Event.tagIterator(entry.record.event.tags); │ │835 - while (tag_iter.next()) |tag| { │ │836 - if (tag.len == 0) continue; │ │837 - try items.append(allocator, .{ .text = tag, .link = try tagLink(self.session.page_arena, self.data.identity, entryStatus(entry), tag, self.data.search orelse "") }); │ │834 + var label_iter = Event.labelIterator(entry.record.event.labels); │ │835 + while (label_iter.next()) |label| { │ │836 + if (label.len == 0) continue; │ │837 + try items.append(allocator, .{ .text = label, .link = try labelLink(self.session.page_arena, self.data.identity, entryStatus(entry), label, self.data.search orelse "") });│ │838 } │ │839 if (items.items.len > 0) { │ │840 - var tags = try TagFlow.init(allocator); │ │841 - errdefer tags.deinit(allocator); │ │842 - try tags.setItems(allocator, items.items); │ │843 - try inner_box.children.put(allocator, tags.getFocus().id, .{ .widget = .{ .tag_flow = tags }, .rect = null, .min_size = null }); │ │840 + var labels = try WordFlow.init(allocator); │ │841 + errdefer labels.deinit(allocator); │ │842 + try labels.setItems(allocator, items.items); │ │843 + try inner_box.children.put(allocator, labels.getFocus().id, .{ .widget = .{ .word_flow = labels }, .rect = null, .min_size = null }); │ │844 } │ │845 } │ │846 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │958 } │ │959 │ │960 switch (child.*) { │ │961 - .tag_flow => |*tags| self.tagsInput(child_index, tags, key, root_focus), │ │961 + .word_flow => |*labels| self.labelsInput(child_index, labels, key, root_focus),│ │962 .copyable_text => |*copyable| switch (key) { │ │963 .arrow_up => if (!self.moveVertical(root_focus, false)) { │ │964 self.exit = .header; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1264 return true; │ │1265 } │ │1266 │ │1267 - fn tagsInput(self: *This, child_index: usize, tags: *TagFlow, key: Key, root_focus: *Focus) void { │ │1268 - const child_id = tags.focus.child_id orelse return; │ │1269 - const cur = tags.indexOfFocusId(child_id) orelse return; │ │1270 - const count = tags.text_boxes.items.len; │ │1267 + fn labelsInput(self: *This, child_index: usize, labels: *WordFlow, key: Key, root_focus: *Focus) void {│ │1268 + const child_id = labels.focus.child_id orelse return; │ │1269 + const cur = labels.indexOfFocusId(child_id) orelse return; │ │1270 + const count = labels.text_boxes.items.len; │ │1271 switch (key) { │ │1272 - .arrow_left => if (cur > 0) self.focusTag(child_index, tags, root_focus, cur - 1) else { │ │1272 + .arrow_left => if (cur > 0) self.focusLabel(child_index, labels, root_focus, cur - 1) else { │ │1273 self.exit = .list; │ │1274 }, │ │1275 - .arrow_right => if (cur + 1 < count) self.focusTag(child_index, tags, root_focus, cur + 1), │ │1276 - .arrow_up => if (tags.rowStep(cur, false)) |index| { │ │1277 - self.focusTag(child_index, tags, root_focus, index); │ │1275 + .arrow_right => if (cur + 1 < count) self.focusLabel(child_index, labels, root_focus, cur + 1),│ │1276 + .arrow_up => if (labels.rowStep(cur, false)) |index| { │ │1277 + self.focusLabel(child_index, labels, root_focus, index); │ │1278 } else { │ │1279 _ = self.moveVertical(root_focus, false); │ │1280 }, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │1281 - .arrow_down => if (tags.rowStep(cur, true)) |index| { │ │1282 - self.focusTag(child_index, tags, root_focus, index); │ │1281 + .arrow_down => if (labels.rowStep(cur, true)) |index| { │ │1282 + self.focusLabel(child_index, labels, root_focus, index);│ │1283 } else { │ │1284 _ = self.moveVertical(root_focus, true); │ │1285 }, │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │1286 - .home => self.focusTag(child_index, tags, root_focus, 0), │ │1287 - .end => self.focusTag(child_index, tags, root_focus, count - 1), │ │1286 + .home => self.focusLabel(child_index, labels, root_focus, 0), │ │1287 + .end => self.focusLabel(child_index, labels, root_focus, count - 1),│ │1288 else => {}, │ │1289 } │ │1290 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1291 │ │1292 - fn focusTag(self: *This, child_index: usize, tags: *TagFlow, root_focus: *Focus, item: usize) void { │ │1293 - root_focus.setFocus(tags.text_boxes.items[item].getFocus().id); │ │1294 - if (self.session.is_terminal and item < tags.rects.items.len) { │ │1292 + fn focusLabel(self: *This, child_index: usize, labels: *WordFlow, root_focus: *Focus, item: usize) void {│ │1293 + root_focus.setFocus(labels.text_boxes.items[item].getFocus().id); │ │1294 + if (self.session.is_terminal and item < labels.rects.items.len) { │ │1295 if (self.inner().children.values()[child_index].rect) |flow_rect| { │ │1296 - var rect = tags.rects.items[item]; │ │1296 + var rect = labels.rects.items[item]; │ │1297 rect.x += flow_rect.x; │ │1298 rect.y += flow_rect.y; │ │1299 self.scroll.scrollToRect(rect); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯