╭ changed ──────────────╮ │src/ui/Repo/Threads.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │28 const has_conflicts = Event.merge_policy == .field_conflicts; │ │29 const FieldConflict = if (has_conflicts) Data.FieldConflict else void;│ │30 const ViewKind = Data.ViewKind; │ │31 + const thread_name = switch (kind) { │ │32 + .issue => "issue", │ │33 + .discuss => "discussion", │ │34 + else => @compileError("unsupported thread event kind"), │ │35 + }; │ │36 │ │37 return struct { │ │38 const This = @This(); │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │104 fn listRoute(identity: []const u8, status: Status, tag: []const u8, selected: []const u8) ?ui.RoutablePage {│ │105 return switch (kind) { │ │106 .issue => ui.RoutablePage.repoIssuesRoute(identity, status, tag, selected), │ │102 - .discussion => ui.RoutablePage.repoDiscussionsRoute(identity, tag, selected), │ │107 + .discuss => ui.RoutablePage.repoDiscussionsRoute(identity, tag, selected), │ │108 else => @compileError("unsupported thread event kind"), │ │109 }; │ │110 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │197 errdefer hdr.deinit(allocator); │ │198 switch (kind) { │ │199 .issue => try outer.children.put(allocator, hdr.getFocus().id, .{ .widget = .{ .repo_issues_header = hdr }, .rect = null, .min_size = null }), │ │195 - .discussion => try outer.children.put(allocator, hdr.getFocus().id, .{ .widget = .{ .repo_discussions_header = hdr }, .rect = null, .min_size = null }),│ │200 + .discuss => try outer.children.put(allocator, hdr.getFocus().id, .{ .widget = .{ .repo_discussions_header = hdr }, .rect = null, .min_size = null }), │ │201 else => @compileError("unsupported thread event kind"), │ │202 } │ │203 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │241 const aa = session.page_arena.allocator(); │ │242 const route = removeRoute(data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong;│ │243 const action = try std.fmt.allocPrint(aa, "form:{s}", .{try route.toUrl(session.page_arena)}); │ │239 - const event_name = if (data.comment_id.len == 0) @tagName(kind) else "comment"; │ │244 + const event_name = if (data.comment_id.len == 0) thread_name else "comment"; │ │245 const label = try std.fmt.allocPrint(aa, "remove {s}", .{event_name}); │ │246 var center = try initRemoveForm(allocator, action, label); │ │247 errdefer center.deinit(allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │734 fn header(self: *This) *Header { │ │735 return switch (kind) { │ │736 .issue => &self.box.children.values()[header_index].widget.repo_issues_header, │ │732 - .discussion => &self.box.children.values()[header_index].widget.repo_discussions_header,│ │737 + .discuss => &self.box.children.values()[header_index].widget.repo_discussions_header, │ │738 else => @compileError("unsupported thread event kind"), │ │739 }; │ │740 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1117 } │ │1118 │ │1119 if (comment_page) |page| { │ │1115 - const back_label = try std.fmt.allocPrint(self.session.page_arena.allocator(), "← back to {s}", .{@tagName(kind)}); │ │1120 + const back_label = try std.fmt.allocPrint(self.session.page_arena.allocator(), "← back to {s}", .{thread_name}); │ │1121 var back = try Comment.linkBox(allocator, self.session, back_label, commentsRoute(self.data.identity, entry.id, 0) orelse return error.RouteTooLong);│ │1122 errdefer back.deinit(allocator); │ │1123 try inner.children.put(allocator, back.getFocus().id, .{ .widget = .{ .text_box = back }, .rect = null, .min_size = null }); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1142 if (description_page) { │ │1143 // the back link, in the title slot so the pane's input handling │ │1144 // applies to it unchanged. │ │1140 - const back_label = try std.fmt.allocPrint(self.session.page_arena.allocator(), "← back to {s}", .{@tagName(kind)}); │ │1145 + const back_label = try std.fmt.allocPrint(self.session.page_arena.allocator(), "← back to {s}", .{thread_name}); │ │1146 var tb = try wgt.TextBox(ui.Widget).init(allocator, back_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │1147 errdefer tb.deinit(allocator); │ │1148 tb.getFocus().focusable = true; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯