╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │640 } │ │641 │ │642 const whole = entry.record.event.description; │ │643 - const cut_short = !description_page and whole.len > Data.max_description_size; │ │644 - const shown = if (cut_short) │ │645 - std.mem.trimEnd(u8, whole[0 .. std.mem.lastIndexOfScalar(u8, whole[0..Data.max_description_size], '\n') orelse 0], " \t\r\n")│ │643 + const preview_end = if (description_page) null else ui.detailPreviewEnd(whole); │ │644 + const shown = if (preview_end) |end| │ │645 + std.mem.trimEnd(u8, whole[0..end], " \t\r\n") │ │646 else if (whole.len == 0) │ │647 "(no description)" │ │648 else │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │652 .rounded_corners = true, │ │653 .wrap_kind = .word, │ │654 .label = " description ", │ │655 - .bottom_label = if (cut_short) " click or press enter to see more " else "", │ │655 + .bottom_label = if (preview_end != null) " click or press enter to see more " else "",│ │656 }); │ │657 errdefer description.deinit(allocator); │ │658 description.getFocus().focusable = true; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │659 - if (cut_short) { │ │659 + if (preview_end != null) { │ │660 const route = ui.RoutablePage.repoThreadDescriptionRoute(kind, self.data.identity, entry.id) orelse return error.RouteTooLong; │ │661 description.getFocus().kind = .{ .custom = try std.fmt.allocPrint(self.session.page_arena.allocator(), "a:{s}", .{try route.toUrl(self.session.page_arena)}) };│ │662 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │675 try Comment.appendCount(allocator, inner_box, entry.comments.count, "comment", "comments"); │ │676 for (entry.comments.comments) |comment| try Comment.appendComment(allocator, inner_box, self.session, self.data.identity, kind, comment);│ │677 try Comment.appendWindowNav(allocator, inner_box, self.session, self.data.identity, kind, entry.id, null, entry.comments); │ │678 - │ │679 - var spacer = try Spacer.init(allocator); │ │680 - errdefer spacer.deinit(allocator); │ │681 - try inner_box.children.put(allocator, spacer.getFocus().id, .{ .widget = .{ .spacer = spacer }, .rect = null, .min_size = null }); │ │678 } │ │679 + } │ │680 + │ │681 + if (!description_page) { │ │682 + var spacer = try Spacer.init(allocator); │ │683 + errdefer spacer.deinit(allocator); │ │684 + try inner_box.children.put(allocator, spacer.getFocus().id, .{ .widget = .{ .spacer = spacer }, .rect = null, .min_size = null }); │ │685 } │ │686 │ │687 _ = self.focusFirst(null); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯