╭ changed ───────────╮ │src/ui/Repo/Refs.zig│ ╰────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │183 // window-navigation rows bracket the names: "← previous" off the │ │184 // first window, "next →" when more remain. each is a full reload. │ │185 if (after > 0) try addRow(allocator, &rows, "← previous", try windowLink(session.page_arena, identity, kind, after -| page_size));│ │186 - for (names) |name| try addRow(allocator, &rows, name, null); │ │186 + // each ref name links to the files tab at that ref's root. │ │187 + for (names) |name| try addRow(allocator, &rows, name, try refLink(session.page_arena, identity, kind, name)); │ │188 if (next_after) |na| try addRow(allocator, &rows, "next →", try windowLink(session.page_arena, identity, kind, na)); │ │189 │ │190 if (rows.children.count() > 0) rows.getFocus().child_id = rows.children.keys()[0]; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │364 const route = ui.RoutablePage.repoRefsRoute(identity, kind, after) orelse return error.RouteTooLong; │ │365 const url = try route.urlAlloc(page_arena); │ │366 return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{url}); │ │367 +} │ │368 + │ │369 +// the "a:" link to the files tab at ref `name` (a branch or tag) within │ │370 +// `identity` ("owner/name"), at its root directory. the name is percent-encoded │ │371 +// since it can contain a '/'. │ │372 +fn refLink(page_arena: *std.heap.ArenaAllocator, identity: []const u8, kind: ui.RoutablePage.RefKind, name: []const u8) ![]const u8 {│ │373 + const aa = page_arena.allocator(); │ │374 + const ref_or_oid: ui.RoutablePage.RefOrOid = switch (kind) { │ │375 + .branch => .branch, │ │376 + .tag => .tag, │ │377 + }; │ │378 + const value = try ui.ResolvedRefOrOid.urlEncode(aa, name); │ │379 + const route = ui.RoutablePage.repoFilesRoute(identity, ref_or_oid, value, "") orelse return error.RouteTooLong; │ │380 + const url = try route.urlAlloc(page_arena); │ │381 + return std.fmt.allocPrint(aa, "a:{s}", .{url}); │ │382 } │ │383 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯