╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │52 │ │53 // every repo route stores its identity as "owner/name" (or elides it in │ │54 // local mode); files and commits carry their remaining fields directly. │ │55 - const name_str: []const u8 = switch (route) { │ │56 - .repo_files => |f| f.name.slice(), │ │57 - .repo_commits => |c| c.name.slice(), │ │58 - .repo_settings, .repo_auth => |n| n.slice(), │ │59 - .repo_refs => |r| r.name.slice(), │ │60 - .repo_issues => |i| i.name.slice(), │ │61 - else => return error.UnexpectedRoute, │ │62 - }; │ │55 + const name_str = route.repoIdentity() orelse return error.UnexpectedRoute; │ │56 const repo_identity = ui.RoutablePage.RepoIdentity.parse(name_str) orelse return error.NotFound;│ │57 // the files and commits tabs share one ref/oid: whichever the incoming route │ │58 // names (it rides on the route's target tab), or the default branch when │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │236 │ │237 // build the header first so we can grab the files-tab id for the auth │ │238 // view (it focuses there after login). │ │246 - var files_tab_id: usize = undefined; │ │239 { │ │240 var header_view = try Header.View.init(allocator, &data.header, session);│ │241 errdefer header_view.deinit(allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │250 - files_tab_id = header_view.tab_ids.keys()[0]; │ │242 try box.children.put(allocator, header_view.getFocus().id, .{ .widget = .{ .repo_header = header_view }, .rect = null, .min_size = null });│ │243 } │ │244 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │283 // the header has no auth tab in local mode, so keep the stack's │ │284 // children 1:1 with the tabs by skipping the auth view too. │ │285 if (!session.data.is_local) { │ │295 - var auth_view = try Auth.View.init(allocator, &data.auth, session, files_tab_id); │ │286 + var auth_view = try Auth.View.init(allocator, &data.auth, session); │ │287 errdefer auth_view.deinit(allocator); │ │288 try stack.children.put(allocator, auth_view.getFocus().id, .{ .home_auth = auth_view });│ │289 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯