╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────╮ │55 comment_id: []const u8, │ │56 comments_start: usize, │ │57 comment_page: ?Comment.Permalink = null,│ │58 -all: Window, │ │58 +recent: Window, │ │59 view: ui.RoutablePage.DiscussionsView, │ │60 description_page: bool = false, │ │61 tags: []const []const u8, │ ╰────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │64 const Self = @This(); │ │65 │ │66 pub const Event = evt.Discussion; │ │67 -pub const Status = enum { all }; │ │67 +pub const Status = enum { recent }; │ │68 pub const ViewKind = ui.RoutablePage.DiscussionsView; │ │69 │ │70 pub fn selectedThread(self: *const Self) ?*const DiscussionWithId {│ ╰───────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │71 if (self.selected_id.len == 0) return null; │ │72 - for (self.all.items) |*entry| { │ │72 + for (self.recent.items) |*entry| { │ │73 if (std.mem.eql(u8, entry.id, self.selected_id)) return entry;│ │74 } │ │75 return null; │ ╰──────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────╮ │76 } │ │77 │ │78 pub fn window(self: *const Self, _: Status) *const Window {│ │79 - return &self.all; │ │79 + return &self.recent; │ │80 } │ │81 │ │82 pub fn emptyResult( │ ╰───────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │ 94 .selected_id = try aa.dupe(u8, selected_id), │ │ 95 .comment_id = try aa.dupe(u8, comment_id), │ │ 96 .comments_start = comments_start, │ │ 97 - .all = .empty, │ │ 98 - .view = if (view == .description) .all else view, │ │ 97 + .recent = .empty, │ │ 98 + .view = if (view == .description) .recent else view,│ │ 99 .description_page = view == .description, │ │100 .tags = &.{}, │ │101 }; │ ╰─────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │160 const record_cursor = try records.getCursor(hash.hashInt(repo_opts.hash, &id)) orelse return error.NotFound; │ │161 const record = try evt.read(evt.Discussion.Record, DB, repo_opts.hash, arena, try DB.HashMap(.read_only).init(record_cursor));│ │162 if (record.removed) return error.NotFound; │ │163 - const order_key = try aa.dupe(u8, &evt.orderKeyDesc(record.created_ts, &id)); │ │163 + const activity_order = try evt.Discussion.activityOrder(DB, repo_opts.hash, haxy_moment, &id); │ │164 + const order_key = try aa.dupe(u8, &evt.orderKeyDesc(activity_order, &id)); │ │165 const set = set_maybe orelse return error.NotFound; │ │166 if (!try set.contains(order_key)) return error.NotFound; │ │167 root_key = order_key; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │193 .comment_id = empty.comment_id, │ │194 .comments_start = comments_start, │ │195 .comment_page = comment_page, │ │195 - .all = loaded_window, │ │196 + .recent = loaded_window, │ │197 .view = empty.view, │ │198 .description_page = empty.description_page,│ │199 .tags = tag_names.items, │ ╰────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │281 │ │282 const aa = session.page_arena.allocator(); │ │283 │ │283 - // all discussions │ │284 + // recent discussions │ │285 { │ │286 const route = ui.RoutablePage.repoDiscussionsRoute(data.identity, data.tag, "") orelse return error.RouteTooLong;│ │287 const link = try std.fmt.allocPrint(aa, "ai:{s}", .{try route.toUrl(session.page_arena)}); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │287 - const label = try std.fmt.allocPrint(aa, "all ({d})", .{data.all.count}); │ │288 + const label = try std.fmt.allocPrint(aa, "recent ({d})", .{data.recent.count});│ │289 try addTab(allocator, &box, &tab_ids, label, link); │ │290 } │ │291 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯