╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │59 const tag = std.meta.activeTag(route); │ │60 │ │61 // page state lives in the route only for the tab it targets; the other tabs │ │62 - // open at their root/first page. │ │62 + // open at their root/first page. a null ref kind means the files tab opens at │ │63 + // the default branch (Files.init resolves it). │ │64 + const files_ref_kind = if (tag == .repo) rf.ref_kind else null; │ │65 + const files_ref_value = if (tag == .repo) rf.ref_value else ""; │ │66 const files_dir = if (tag == .repo) rf.dir else ""; │ │67 const commits_start = if (tag == .repo_commits) ui.RoutablePage.repoCommitsStart(name_str) else "";│ │68 // how many diff hunks the commits view's selected commit shows ("load more"). │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │90 │ │91 // each tab mirror carries this page's route for that tab; tabs not targeted │ │92 // by the incoming route fall back to their root/first-page route. │ │90 - const route_name = (ui.RoutablePage.repoFilesRoute(rf.identity, files_dir) orelse return error.NotFound).repo; │ │93 + const route_name = (ui.RoutablePage.repoFilesRoute(rf.identity, files_ref_kind, files_ref_value, files_dir) orelse return error.NotFound).repo; │ │94 const commits_route_name = if (tag == .repo_commits) route.repo_commits.name else (ui.RoutablePage.repoCommitsRoute(rf.identity, "", 0) orelse return error.NotFound).repo_commits.name;│ │95 │ │96 return .{ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 97 .header = try Header.init(arena, repo.name, owner.name), │ │ 98 .repo = repo, │ │ 99 // the repo's event id is the on-disk repo directory name │ │ 97 - .files = try Files.init(arena, session, &found.event_id, rf.identity, files_dir), │ │100 + .files = try Files.init(arena, session, &found.event_id, rf.identity, files_ref_kind, files_ref_value, files_dir),│ │101 .commits = try Commits.init(arena, session, &found.event_id, rf.identity, commits_start, commits_after), │ │102 .refs = try Refs.init(arena, session, &found.event_id, rf.identity, refs_kind, refs_after), │ │103 .settings = Settings.init(), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯