╭ changed ──────────────╮ │src/ui/Repo/Comment.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │334 } │ │335 row.getFocus().child_id = row.children.keys()[0]; │ │336 try box.children.put(allocator, row.getFocus().id, .{ .widget = .{ .box = row }, .rect = null, .min_size = null }); │ │337 +} │ │338 + │ │339 +fn commentsRoute(kind: evt.EventKind, identity: []const u8, thread_id: []const u8, selected_id: ?[]const u8, start: usize) ?ui.RoutablePage { │ │340 + return switch (kind) { │ │341 + .issue => if (selected_id) |id| ui.RoutablePage.repoCommentsRoute(identity, thread_id, id, start) else ui.RoutablePage.repoIssueCommentsRoute(identity, thread_id, start), │ │342 + .discussion => if (selected_id) |id| ui.RoutablePage.repoDiscussionCommentRoute(identity, thread_id, id, start) else ui.RoutablePage.repoDiscussionCommentsRoute(identity, thread_id, start),│ │343 + else => null, │ │344 + }; │ │345 +} │ │346 + │ │347 +fn commentNewRoute(kind: evt.EventKind, identity: []const u8, thread_id: []const u8, parent_id: []const u8) ?ui.RoutablePage { │ │348 + return switch (kind) { │ │349 + .issue => ui.RoutablePage.repoCommentNewRoute(identity, thread_id, parent_id), │ │350 + .discussion => ui.RoutablePage.repoDiscussionCommentNewRoute(identity, thread_id, parent_id), │ │351 + else => null, │ │352 + }; │ │353 } │ │354 │ │355 +fn commentEditRoute(kind: evt.EventKind, identity: []const u8, thread_id: []const u8, comment_id: []const u8) ?ui.RoutablePage { │ │356 + return switch (kind) { │ │357 + .issue => ui.RoutablePage.repoCommentEditRoute(identity, thread_id, comment_id), │ │358 + .discussion => ui.RoutablePage.repoDiscussionCommentEditRoute(identity, thread_id, comment_id), │ │359 + else => null, │ │360 + }; │ │361 +} │ │362 + │ │363 pub fn linkBox(allocator: std.mem.Allocator, session: *ui.Session, text: []const u8, route: ui.RoutablePage) !wgt.TextBox(ui.Widget) { │ │364 var box = try wgt.TextBox(ui.Widget).init(allocator, text, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │365 errdefer box.deinit(allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯