╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │70 // the repo page can build without a moment in local mode; the home and │ │71 // user pages always read from the admin db. │ │72 return switch (route.parent()) { │ │73 - .home => .{ .home = try Home.init(arena, session.haxy_moment orelse return error.NoMoment, session.userId(), switch (route) {│ │73 + .home => .{ .home = try Home.init(arena, session, session.haxy_moment orelse return error.NoMoment, switch (route) { │ │74 .home_users => |start| start, │ │75 else => 0, │ │76 }, switch (route) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │110 // .user parent page, so switching between them stays on that page (and just│ │111 // updates the url) rather than navigating away. │ │112 pub const RoutablePage = union(enum) { │ │113 + home_about, │ │114 home_users: usize, // 0 = first page │ │115 home_repos: usize, // 0 = first page │ │116 home_settings, │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │181 fork_settings: ForkRoute, │ │182 fork_auth: ForkRoute, │ │183 │ │183 - pub const default: RoutablePage = .{ .home_repos = 0 };│ │184 + pub const default: RoutablePage = .home_about; │ │185 │ │186 pub const RefKind = enum { branch, tag }; │ │187 │ ╰────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1017 │ │1018 pub fn toUrl(self: RoutablePage, arena: *std.heap.ArenaAllocator) ![]const u8 { │ │1019 return switch (self) { │ │1020 + .home_about => "/", │ │1021 .home_users => |start| if (start == 0) @as([]const u8, "/users") else try std.fmt.allocPrint(arena.allocator(), "/users/" ++ start_seg ++ "{d}", .{start}),│ │1022 .home_repos => |start| if (start == 0) @as([]const u8, "/repos") else try std.fmt.allocPrint(arena.allocator(), "/repos/" ++ start_seg ++ "{d}", .{start}),│ │1023 .home_settings => "/settings", │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1403 │ │1404 pub fn parent(self: RoutablePage) PageKind { │ │1405 return switch (self) { │ │1404 - .home_users, .home_repos, .home_settings, .home_auth => .home, │ │1406 + .home_about, .home_users, .home_repos, .home_settings, .home_auth => .home, │ │1407 .user_repos, .user_forks, .user_settings, .user_auth => .user, │ │1408 .repo_files, .repo_commits, .repo_diff, .repo_refs, .repo_issues, .repo_patches, .repo_discussions, .repo_events, .repo_undo, .repo_settings, .repo_auth => .repo,│ │1409 .fork_patch, .fork_diff, .fork_files, .fork_commits, .fork_settings, .fork_auth => .fork, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯