╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1634 }, │ │1635 } │ │1636 │ │1637 - const id_hex = std.fmt.bytesToHex(id, .lower); │ │1638 - const route = ui.RoutablePage.repoEventsRoute(self.data.identity, .removed, event_kind, &id_hex, null) orelse return; │ │1637 + // back to the thread, or to its list when the thread itself was removed │ │1638 + const entry = self.entry orelse return; │ │1639 + const route = listRoute(self.data.identity, entryStatus(entry), if (event_kind == kind) "" else entry.id) orelse return;│ │1640 try self.session.navigate(route); │ │1641 } │ │1642 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │3322 }, │ │3323 } │ │3324 │ │3324 - const id_hex = std.fmt.bytesToHex(id, .lower); │ │3325 - const route = ui.RoutablePage.repoEventsRoute(self.data.identity, .removed, event_kind, &id_hex, null) orelse return; │ │3325 + // back to the thread, or to its list when the thread itself was removed │ │3326 + const selected = self.data.selectedThread() orelse return; │ │3327 + const route = listRoute(self.data.identity, entryStatus(selected.*), if (event_kind == kind) "" else self.data.selected_id) orelse return;│ │3328 try self.session.navigate(route); │ │3329 } │ │3330 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1114 else => unreachable, │ │1115 }; │ │1116 if (!valid) { │ │1117 - const list_name: []const u8 = switch (kind) { │ │1118 - .issue => "issues", │ │1119 - .patch => "patches", │ │1120 - .discuss => "discussions", │ │1121 - else => unreachable, │ │1122 - }; │ │1123 - const form_location = try allocator.print("{s}/{s}/new", .{ base, list_name }); │ │1117 + const form_location = try allocator.print("{s}/{s}/new", .{ base, threadListName(kind) }); │ │1118 defer allocator.free(form_location); │ │1119 if (!evt.titleValid(title)) { │ │1120 return respondThreadFormFailure(request, allocator, host, form_location, requiredTitleFeedback(kind, title, labels, description, target_branch, source_branch));│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1960 }, │ │1961 } │ │1962 │ │1969 - const id = std.fmt.bytesToHex(parts.id, .lower); │ │1970 - const location = try allocator.print("{s}/event:{s}/kind:{s}", .{ parts.repo_base, &id, @tagName(parts.kind) }); │ │1963 + // back to the thread a comment or attachment was on, or to the list a thread left │ │1964 + const location = if (parts.kind == parts.thread_kind) │ │1965 + try allocator.print("{s}/{s}", .{ parts.repo_base, threadListName(parts.thread_kind) }) │ │1966 + else │ │1967 + try allocator.print("{s}/{s}:{s}", .{ parts.repo_base, @tagName(parts.thread_kind), &std.fmt.bytesToHex(parts.thread_id, .lower) });│ │1968 defer allocator.free(location); │ │1969 try request.respond("", .{ │ │1970 .status = .see_other, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │1971 .keep_alive = false, │ │1972 .extra_headers = &.{.{ .name = "location", .value = location }},│ │1973 }); │ │1974 +} │ │1975 + │ │1976 +// the tab listing threads of `kind` │ │1977 +fn threadListName(kind: evt.EventKind) []const u8 { │ │1978 + return switch (kind) { │ │1979 + .issue => "issues", │ │1980 + .patch => "patches", │ │1981 + .discuss => "discussions", │ │1982 + else => unreachable, │ │1983 + }; │ │1984 } │ │1985 │ │1986 fn respondRemoveNotFound(request: *std.http.Server.Request) !void { │ ╰──────────────────────────────────────────────────────────────────────────────╯