╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1484 const tab = segments.next() orelse return null; │ │1485 var params = Params{}; │ │1486 if (std.mem.eql(u8, tab, "settings")) return if (segments.next() == null) .{ .repo_settings = Array(repo_route_max_len).from(pair) orelse return null } else null;│ │1487 + if (std.mem.eql(u8, tab, "new-repo")) return if (segments.next() == null) .{ .repo_new_repo = Array(repo_route_max_len).from(pair) orelse return null } else null;│ │1488 if (std.mem.eql(u8, tab, "auth")) return if (segments.next() == null) .{ .repo_auth = Array(repo_route_max_len).from(pair) orelse return null } else null; │ │1489 if (std.mem.eql(u8, tab, "refs")) { │ │1490 const word = params.scanTail(&segments) catch return null; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1741 .user_repos => |a_u| std.mem.eql(u8, a_u.name.slice(), b.user_repos.name.slice()) and a_u.start == b.user_repos.start and std.mem.eql(u8, a_u.search.slice(), b.user_repos.search.slice()),│ │1742 .user_forks => |a_u| std.mem.eql(u8, a_u.name.slice(), b.user_forks.name.slice()) and a_u.start == b.user_forks.start, │ │1743 .user_settings => |a_name| std.mem.eql(u8, a_name.slice(), b.user_settings.slice()), │ │1744 + .user_new_repo => |a_name| std.mem.eql(u8, a_name.slice(), b.user_new_repo.slice()), │ │1745 .user_auth => |a_name| std.mem.eql(u8, a_name.slice(), b.user_auth.slice()), │ │1746 .repo_files => |a_f| std.mem.eql(u8, a_f.name.slice(), b.repo_files.name.slice()) and │ │1747 a_f.ref_kind == b.repo_files.ref_kind and │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1803 a_e.kind == b.repo_events.kind and │ │1804 std.mem.eql(u8, a_e.selected.slice(), b.repo_events.selected.slice()), │ │1805 .repo_settings => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_settings.slice()), │ │1806 + .repo_new_repo => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_new_repo.slice()), │ │1807 .repo_auth => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_auth.slice()), │ │1808 .fork_patch => |a_f| std.mem.eql(u8, a_f.name.slice(), b.fork_patch.name.slice()) and std.mem.eql(u8, a_f.id.slice(), b.fork_patch.id.slice()),│ │1809 .fork_diff => |a_d| std.mem.eql(u8, a_d.fork.name.slice(), b.fork_diff.fork.name.slice()) and │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1826 .message => std.meta.activeTag(b.fork_commits.content) == .message, │ │1827 }, │ │1828 .fork_settings => |a_f| std.mem.eql(u8, a_f.name.slice(), b.fork_settings.name.slice()) and std.mem.eql(u8, a_f.id.slice(), b.fork_settings.id.slice()),│ │1829 + .fork_new_repo => |a_f| std.mem.eql(u8, a_f.name.slice(), b.fork_new_repo.name.slice()) and std.mem.eql(u8, a_f.id.slice(), b.fork_new_repo.id.slice()),│ │1830 .fork_auth => |a_f| std.mem.eql(u8, a_f.name.slice(), b.fork_auth.name.slice()) and std.mem.eql(u8, a_f.id.slice(), b.fork_auth.id.slice()), │ │1831 else => true, │ │1832 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │2158 error.InvalidSourceBranch => .invalid_source_branch, │ │2159 error.SameBranch => .same_branch, │ │2160 error.UnrelatedBranches => .unrelated_branches, │ │2161 + else => null, │ │2162 + }; │ │2163 + } │ │2164 + }; │ │2165 + │ │2166 + pub const RepoFailure = enum { │ │2167 + required_name, │ │2168 + invalid_name, │ │2169 + name_taken, │ │2170 + │ │2171 + pub fn fromError(err: anyerror) ?RepoFailure { │ │2172 + return switch (err) { │ │2173 + error.NameEmpty => .required_name, │ │2174 + error.NameTooLong, error.InvalidName => .invalid_name,│ │2175 + error.NameTaken => .name_taken, │ │2176 else => null, │ │2177 }; │ │2178 } │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │2181 login: struct { │ │2182 failure: LoginFailure, │ │2183 username: []const u8, │ │2184 + }, │ │2185 + repo: struct { │ │2186 + failure: RepoFailure, │ │2187 + fields: struct { │ │2188 + name: []const u8, │ │2189 + description: []const u8,│ │2190 + hash: hash.HashKind, │ │2191 + access: evt.Repo.Access,│ │2192 + }, │ │2193 }, │ │2194 issue: struct { │ │2195 failure: ThreadFailure, │ ╰──────────────────────────────────────────────╯