╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────╮ │11 const Comment = @import("Comment.zig"); │ │12 const Attachment = @import("Attachment.zig"); │ │13 const thread = ui.widget.thread; │ │14 +const srch_thrd = @import("../../search_thread.zig");│ │15 const fork = @import("../../fork.zig"); │ │16 const pch = @import("../../patch.zig"); │ │17 │ ╰─────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │212 // "owner:name", so the view can build /owner:name/patches/... links. │ │213 identity: []const u8, │ │214 default_target_branch: []const u8 = "", │ │214 -// the url-encoded label the lists are filtered to ("" = unfiltered). │ │215 -label: []const u8, │ │215 // the decoded query the lists are filtered to, or null when unfiltered. │ │216 search: ?[]const u8 = null, │ │217 // the hex event id of the patch its status's window is rooted at ("" = the│ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │260 return event.status.kind(); │ │261 } │ │262 │ │264 -pub fn listRoute(identity: []const u8, status: Status, label: []const u8, selected: []const u8) ?ui.RoutablePage {│ │265 - return ui.RoutablePage.repoPatchesRoute(identity, status, label, selected); │ │263 +pub fn listRoute(identity: []const u8, status: Status, selected: []const u8) ?ui.RoutablePage { │ │264 + return ui.RoutablePage.repoPatchesRoute(identity, status, selected); │ │265 } │ │266 │ │267 // a fork route's identity names the forker and the target repo │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │504 } │ │505 │ │506 // an empty listing, for the wasm / no-repo paths. │ │508 -pub fn emptyResult(aa: std.mem.Allocator, identity: []const u8, label: []const u8, search: []const u8, selected_id: []const u8, comment_id: []const u8, comments_start: usize, theirs_picks: []const u8, view: ui.RoutablePage.PatchesView) !Self {│ │507 +pub fn emptyResult(aa: std.mem.Allocator, identity: []const u8, search: []const u8, selected_id: []const u8, comment_id: []const u8, comments_start: usize, theirs_picks: []const u8, view: ui.RoutablePage.PatchesView) !Self { │ │508 return .{ │ │509 .identity = try aa.dupe(u8, identity), │ │510 .default_target_branch = "", │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │512 - .label = try aa.dupe(u8, label), │ │511 .search = if (search.len == 0) null else std.Uri.percentDecodeInPlace(try aa.dupe(u8, search)),│ │512 .selected_id = try aa.dupe(u8, selected_id), │ │513 .comment_id = try aa.dupe(u8, comment_id), │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │531 } │ │532 │ │533 pub fn detailResult(aa: std.mem.Allocator, identity: []const u8, entry: PatchWithId) !Self { │ │536 - var result = try emptyResult(aa, identity, "", "", entry.id, "", 0, "", .open); │ │534 + var result = try emptyResult(aa, identity, "", entry.id, "", 0, "", .open); │ │535 const items = try aa.dupe(PatchWithId, &.{entry}); │ │536 const detail_window = Window{ .items = items, .prev_id = null, .next_id = null, .count = 1 };│ │537 if (entry.draft) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │551 return result; │ │552 } │ │553 │ │556 -// read one window per status of an opened repo's patches (filtered to `label` │ │557 -// when set), ordered by creation (newest first). the window of the patch │ │554 +// read one window per status of an opened repo's patches (filtered to the │ │555 +// search when set), ordered by creation (newest first). the window of the patch│ │556 // `selected_id` names starts at it ("" = the beginning). a git repo reads the │ │557 // event db next to it (synced from the events branch on each page build); a │ │558 // xit repo reads its own db. │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────╮ │569 repo_id_maybe: ?[evt.event_id_size]u8,│ │570 identity: []const u8, │ │571 target_branch: []const u8, │ │574 - label: []const u8, │ │572 search: []const u8, │ │573 selected_id: []const u8, │ │574 comment_id: []const u8, │ ╰───────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │578 viewer: ?ui.Viewer, │ │579 ) !Self { │ │580 const allowed_view: ui.RoutablePage.PatchesView = if (session.local != null and view == .drafts) .open else view; │ │584 - var empty = try emptyResult(arena.allocator(), identity, label, search, selected_id, comment_id, comments_start, theirs_picks, allowed_view);│ │581 + var empty = try emptyResult(arena.allocator(), identity, search, selected_id, comment_id, comments_start, theirs_picks, allowed_view); │ │582 empty.default_target_branch = try arena.allocator().dupe(u8, target_branch); │ │583 // the early returns below still let the viewer write │ │584 empty.viewer = viewer; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │586 const aa = arena.allocator(); │ │587 const DB = evt.EventDB(repo_opts.hash); │ │588 const rooted = empty.selected_id.len != 0; │ │592 - const labeled = empty.label.len != 0; │ │589 const drafts_window = if (admin_moment) |admin| │ │590 if (repo_id_maybe) |repo_id| │ │591 if (session.data.user_id != null and session.users_dir != null)│ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯