╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────╮ │src/event/User.zig│ ╰──────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │37 // the moment keys `evt.merge` reads and writes for this kind│ │38 pub const merge_policy: evt.MergePolicy = .target_wins; │ │39 pub const record_map_key = "event-id->user"; │ │40 -pub const id_set_key = "user-id-set"; │ │40 +pub const all_id_set_key = "user-id-set"; │ │41 +pub const active_id_set_key = "active-user-id-set"; │ │42 pub const name_index_key = "name->user-id"; │ │43 │ │44 // resolves a commit's author email to its user at read time │ ╰─────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │112 │ │113 // the id set retains removed records so merges can carry removals │ │114 if (existing_cursor_maybe == null) { │ │114 - const user_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key)); │ │115 + const user_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, all_id_set_key));│ │116 const user_id_set = try DB.SortedSet(.read_write).init(user_id_set_cursor); │ │117 try user_id_set.put(&order_key); │ │118 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │119 │ │119 - if (!record_to_write.removed) { │ │120 + const active = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, active_id_set_key)));│ │121 + if (record_to_write.removed) { │ │122 + _ = try active.remove(&order_key); │ │123 + } else { │ │124 + try active.put(&order_key); │ │125 try name_to_user_id.put(hash.hashInt(hash_kind, record_to_write.event.name), .{ .bytes = event_id }); │ │126 try email_to_user_id.put(hash.hashInt(hash_kind, record_to_write.event.email), .{ .bytes = event_id }); │ │127 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │2185 // native-TUI navigation │ │2186 pub const Nav = struct { │ │2187 root: Widget, │ │2188 - route: RoutablePage, │ │2188 // backs the current page (its Page data and the page-scoped strings its │ │2189 // widgets build). owned here, swapped on each navigation. session.page_arena│ │2190 // tracks whichever of these is current so widgets allocate into it. │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │2215 page.* = try Page.init(arena, session, route); │ │2216 return .{ │ │2217 .root = try initRoot(allocator, page, session),│ │2219 - .route = route, │ │2218 .arena = arena, │ │2219 .history = .empty, │ │2220 }; │ ╰─────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────╮ │2259 self.root.deinit(allocator); │ │2260 freeArena(allocator, self.arena);│ │2261 self.root = new_root; │ │2264 - self.route = route; │ │2262 self.arena = arena; │ │2263 } │ │2264 return; │ ╰───────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │2270 self.root.deinit(allocator); │ │2271 freeArena(allocator, self.arena); │ │2272 self.root = entry.root; │ │2276 - self.route = entry.route; │ │2273 self.arena = entry.arena; │ │2274 session.page_arena = entry.arena; │ │2275 session.data.current_page = entry.route;│ ╰──────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │2307 if (session.next_page) |route| { │ │2308 session.next_page = null; │ │2309 if (session.haxy_moment == null and session.local == null) return;│ │2310 + const previous_route = session.data.current_page; │ │2311 // the page we navigated to becomes the current page │ │2312 session.data.current_page = route; │ │2313 session.back = .available; │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2322 page.* = try Page.init(arena, session, route); │ │2323 const new_root = try initRoot(allocator, page, session); │ │2324 │ │2328 - try self.history.append(allocator, .{ .root = self.root, .route = self.route, .arena = self.arena }); │ │2325 + try self.history.append(allocator, .{ .root = self.root, .route = previous_route, .arena = self.arena });│ │2326 // drop the oldest entry (freeing its widget tree and arena) once over cap │ │2327 if (self.history.items.len > max_history) { │ │2328 var oldest = self.history.orderedRemove(0); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │2330 freeArena(allocator, oldest.arena);│ │2331 } │ │2332 self.root = new_root; │ │2336 - self.route = route; │ │2333 self.arena = arena; │ │2334 } │ │2335 } │ ╰─────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯