╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2554 }, │ │2555 .mouse => |mouse| { │ │2556 if (mouse.action == .press and mouse.action.press == .left) { │ │2557 + if (cellPageLink(root, mouse.x, mouse.y, session.data)) |route| return session.navigate(route);│ │2558 if (root_focus.hitTest(mouse.x, mouse.y)) |hit| { │ │2559 const focus_id = hit.id; │ │2560 if (hit.kind == .background) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2659 // links stay in-page. │ │2660 if (route.parent() != current.parent() or RoutablePage.repoPageChanged(route, current) or RoutablePage.forkPageChanged(route, current) or RoutablePage.homePageChanged(route, current) or RoutablePage.userPageChanged(route, current)) return route;│ │2661 return null; │ │2662 +} │ │2663 + │ │2664 +// the page the clicked cell links to, from a link inside a text box's content │ │2665 +fn cellPageLink(root: *Widget, x: usize, y: usize, data: Session.Data) ?RoutablePage { │ │2666 + const grid = root.getGrid() orelse return null; │ │2667 + const cell = grid.cell(x, y) catch return null; │ │2668 + const link = cell.link orelse return null; │ │2669 + if (link.len == 0 or link[0] != '/') return null; │ │2670 + return if (data.host_kind == .local) RoutablePage.fromUrlLocal(link) else RoutablePage.fromUrl(link); │ │2671 } │ │2672 │ │2673 // whether the `a:` focus target links to the page already shown, which a click │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯