╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │926 } │ │927 if (clicked) |focus_id| { │ │928 // follow a cross-page link │ │887 - if (crossPageLink(root_focus, focus_id, session.data.current_page)) |route| {│ │929 + if (crossPageLink(root_focus, focus_id, session.data)) |route| { │ │930 return session.navigate(route); │ │931 } │ │932 root_focus.setFocus(focus_id); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │947 // different parent page, or a different files directory within the repo page), │ │948 // return its route; otherwise null. lets a host turn a click / enter on such a │ │949 // link into a navigation rather than a focus change. │ │908 -pub fn crossPageLink(root_focus: *Focus, focus_id: usize, current: RoutablePage) ?RoutablePage {│ │950 +pub fn crossPageLink(root_focus: *Focus, focus_id: usize, data: Session.Data) ?RoutablePage { │ │951 + const current = data.current_page; │ │952 const child = root_focus.children.get(focus_id) orelse return null; │ │953 const custom = switch (child.focus.kind) { │ │954 .custom => |c| c, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │958 if (!std.mem.startsWith(u8, custom, a_prefix)) return null; │ │959 const url = custom[a_prefix.len..]; │ │960 const q = std.mem.indexOfScalar(u8, url, '?'); │ │918 - const route = RoutablePage.fromUrl(if (q) |i| url[0..i] else url, if (q) |i| url[i + 1 ..] else null) orelse return null; │ │961 + const path = if (q) |i| url[0..i] else url; │ │962 + const query = if (q) |i| url[i + 1 ..] else null; │ │963 + // local sessions build (and parse) links with the repo identity elided │ │964 + const route = (if (data.is_local) RoutablePage.fromUrlLocal(path, query) else RoutablePage.fromUrl(path, query)) orelse return null;│ │965 // a link to a different parent page always navigates; within a page, a │ │966 // files-directory / commits-page / list-window change navigates while tab │ │967 // links stay in-page (header-handled). │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1775 │ │1776 _ = self.arena.reset(.retain_capacity); │ │1777 const aa = self.arena.allocator(); │ │1732 - const page = self.session.data.current_page; │ │1733 - const path = (if (self.session.local != null) page.urlAllocLocal(&self.arena) else page.urlAlloc(&self.arena)) catch return;│ │1778 + const path = self.session.data.current_page.urlAlloc(&self.arena) catch return; │ │1779 const text = if (self.session.web_port) |port| │ │1780 std.fmt.allocPrint(aa, "http://localhost:{d}{s}", .{ port, path }) catch return │ │1781 else │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯