╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │355 // caps the files tab's url-encoded search term. │ │356 pub const find_route_max_len = 100 * 3; │ │357 │ │375 - // caps the commits tab's url-encoded search query. │ │376 - pub const search_route_max_len = 100 * 3; │ │358 + // caps a url-encoded search query, room enough for an email assignee term.│ │359 + pub const search_route_max_len = 512 * 3; │ │360 │ │361 // the identity stored by every repo route. Local routes elide it. │ │362 pub const RepoIdentity = struct { │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │667 pub fn withSearch(self: RoutablePage, query: []const u8) ?RoutablePage { │ │668 const search = encodeParam(search_route_max_len, query) orelse return null; │ │669 return withEncodedSearch(self, search.slice()); │ │687 - } │ │688 - │ │689 - // the label, assignee and search segments of a thread list url, each optional │ │690 - fn writeListFilters(writer: *std.Io.Writer, label: []const u8, assignee: []const u8, search: []const u8) !void { │ │691 - if (label.len != 0) try writer.print("/" ++ label_filter_seg ++ "{s}", .{label}); │ │692 - if (assignee.len != 0) try writer.print("/" ++ assignee_seg ++ "{s}", .{assignee}); │ │693 - if (search.len != 0) try writer.print("/" ++ search_seg ++ "{s}", .{search}); │ │694 - } │ │695 - │ │696 - // carry the already-encoded list filters a selected thread's url names │ │697 - fn withEncodedFilters(self: ?RoutablePage, label: []const u8, search: []const u8) ?RoutablePage { │ │698 - var route = withEncodedSearch(self, search) orelse return null; │ │699 - switch (route) { │ │700 - inline .repo_issues, .repo_patches, .repo_discussions => |*thread| thread.label = @TypeOf(thread.label).from(label) orelse return null,│ │701 - else => return null, │ │702 - } │ │703 - return route; │ │704 - } │ │705 - │ │706 - // carry an already-encoded assignee filter on an issues route │ │707 - pub fn withEncodedAssignee(self: ?RoutablePage, value: []const u8) ?RoutablePage { │ │708 - var route = self orelse return null; │ │709 - switch (route) { │ │710 - .repo_issues => |*i| i.assignee = Array(assignee_route_max_len).from(value) orelse return null, │ │711 - else => return null, │ │712 - } │ │713 - return route; │ │670 } │ │671 │ │672 // carry an already-encoded search param, as a url hands it over │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │792 } │ │793 │ │794 // build a `.repo_issues` route for "owner:name" (identity) showing │ │839 - // `status`'s list, filtered to the url-encoded `label` ("" = unfiltered) and │ │840 - // rooted at the issue with hex event id `selected` ("" = the first window). │ │841 - pub fn repoIssuesRoute(identity: []const u8, status: evt.Issue.Status, label: []const u8, selected: []const u8) ?RoutablePage {│ │795 + // `status`'s list, rooted at the issue with hex event id `selected` ("" = │ │796 + // the first window). │ │797 + pub fn repoIssuesRoute(identity: []const u8, status: evt.Issue.Status, selected: []const u8) ?RoutablePage { │ │798 return .{ .repo_issues = .{ │ │799 .name = Array(repo_route_max_len).from(identity) orelse return null, │ │844 - .label = Array(issue_label_route_max_len).from(label) orelse return null, │ │800 .selected = Array(evt.event_id_size * 2).from(selected) orelse return null, │ │801 .view = switch (status) { │ │802 .open => .open, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │805 } }; │ │806 } │ │807 │ │853 - pub fn repoPatchesRoute(identity: []const u8, status: evt.Patch.StatusKind, label: []const u8, selected: []const u8) ?RoutablePage {│ │808 + pub fn repoPatchesRoute(identity: []const u8, status: evt.Patch.StatusKind, selected: []const u8) ?RoutablePage { │ │809 return .{ .repo_patches = .{ │ │810 .name = Array(repo_route_max_len).from(identity) orelse return null, │ │856 - .label = Array(patch_label_route_max_len).from(label) orelse return null, │ │811 .selected = Array(evt.event_id_size * 2).from(selected) orelse return null, │ │812 .view = switch (status) { │ │813 .open => .open, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │826 │ │827 pub fn repoPatchPublishRoute(identity: []const u8, selected: []const u8) ?RoutablePage {│ │828 if (selected.len == 0) return null; │ │875 - var route = repoPatchesRoute(identity, .open, "", selected) orelse return null; │ │829 + var route = repoPatchesRoute(identity, .open, selected) orelse return null; │ │830 switch (route) { │ │831 .repo_patches => |*patch| patch.view = .publish, │ │832 else => unreachable, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │836 │ │837 pub fn repoPatchMergeRoute(identity: []const u8, selected: []const u8) ?RoutablePage {│ │838 if (selected.len == 0) return null; │ │885 - var route = repoPatchesRoute(identity, .open, "", selected) orelse return null; │ │839 + var route = repoPatchesRoute(identity, .open, selected) orelse return null; │ │840 switch (route) { │ │841 .repo_patches => |*patch| patch.view = .merge, │ │842 else => unreachable, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │844 return route; │ │845 } │ │846 │ │893 - pub fn repoDiscussionsRoute(identity: []const u8, label: []const u8, selected: []const u8) ?RoutablePage {│ │847 + pub fn repoDiscussionsRoute(identity: []const u8, selected: []const u8) ?RoutablePage { │ │848 return .{ .repo_discussions = .{ │ │849 .name = Array(repo_route_max_len).from(identity) orelse return null, │ │896 - .label = Array(discussion_label_route_max_len).from(label) orelse return null, │ │850 .selected = Array(evt.event_id_size * 2).from(selected) orelse return null, │ │851 } }; │ │852 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │853 │ │854 // build the default list route for a thread event kind. │ │902 - pub fn repoThreadRoute(kind: evt.EventKind, identity: []const u8, label: []const u8, selected: []const u8) ?RoutablePage {│ │855 + pub fn repoThreadRoute(kind: evt.EventKind, identity: []const u8, selected: []const u8) ?RoutablePage { │ │856 return switch (kind) { │ │904 - .issue => repoIssuesRoute(identity, .open, label, selected), │ │905 - .patch => repoPatchesRoute(identity, .open, label, selected), │ │906 - .discuss => repoDiscussionsRoute(identity, label, selected), │ │857 + .issue => repoIssuesRoute(identity, .open, selected), │ │858 + .patch => repoPatchesRoute(identity, .open, selected), │ │859 + .discuss => repoDiscussionsRoute(identity, selected), │ │860 else => null, │ │861 }; │ │862 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │863 │ │864 // build a selected thread route at one of its comment windows. │ │865 pub fn repoThreadCommentsRoute(kind: evt.EventKind, identity: []const u8, selected: []const u8, start: usize) ?RoutablePage {│ │913 - var route = repoThreadRoute(kind, identity, "", selected) orelse return null; │ │866 + var route = repoThreadRoute(kind, identity, selected) orelse return null; │ │867 switch (route) { │ │868 .repo_issues => |*thread| thread.comments_start = start, │ │869 .repo_patches => |*thread| thread.comments_start = start, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │937 return route; │ │938 } │ │939 │ │987 - // build a thread labels route, keeping its url-encoded label filter. │ │988 - pub fn repoThreadLabelsRoute(kind: evt.EventKind, identity: []const u8, label: []const u8) ?RoutablePage {│ │989 - var route = repoThreadRoute(kind, identity, label, "") orelse return null; │ │940 + // build a thread labels route. │ │941 + pub fn repoThreadLabelsRoute(kind: evt.EventKind, identity: []const u8) ?RoutablePage { │ │942 + var route = repoThreadRoute(kind, identity, "") orelse return null; │ │943 switch (route) { │ │944 .repo_issues => |*thread| thread.view = .labels, │ │945 .repo_patches => |*thread| thread.view = .labels, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯