╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │69 .shrink = true, │ │70 }); │ │71 } │ │72 + │ │73 + const identity = try std.fmt.allocPrint(aa, "{s}/{s}", .{ data.owner_name, data.name }); │ │74 │ │73 - // title sits to the left of the tabs │ │75 + // title sits to the left of the tabs; it links to the repo's files root │ │76 + // (the bare route, so it resolves to the default branch). │ │77 { │ │78 + const files_root_route = ui.RoutablePage.repoFilesRoute(identity, null, "", "", 0) orelse return error.RouteTooLong;│ │79 + const title_link = try std.fmt.allocPrint(aa, "a:{s}", .{try files_root_route.urlAlloc(session.page_arena)}); │ │80 var title_view = try ui.Title.View.init(allocator, &data.title); │ │81 errdefer title_view.deinit(allocator); │ │82 title_view.getFocus().focusable = true; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │78 - title_view.getFocus().kind = .{ .custom = "a:/" }; │ │83 + title_view.getFocus().kind = .{ .custom = title_link }; │ │84 // shrink the title when there is not enough space │ │85 try box.children.put(allocator, title_view.getFocus().id, .{│ │86 .widget = .{ .title = title_view }, │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │108 // tabs (the page already holds every tab's content), while the href is │ │109 // still followed with js off. the files tab routes through the shared │ │110 // helper so the /repo/.../files url format lives in one place. │ │106 - const identity = try std.fmt.allocPrint(aa, "{s}/{s}", .{ data.owner_name, data.name }); │ │111 // both tabs link to the ref/oid this page is viewing, so switching tabs │ │112 // keeps the same ref (the files tab opens at its root directory). │ │113 const files_route = ui.RoutablePage.repoFilesRoute(identity, data.ref_or_oid, data.ref_or_oid_value, "", 0) orelse return error.RouteTooLong;│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯