From 3132f4fdea7b0eeef7c5a7f9419c1d9a6edc371e Mon Sep 17 00:00:00 2001 From: patak Date: Wed, 18 Jan 2023 16:59:37 +0100 Subject: [PATCH] feat: hide redudant mentions (#1293) --- components/status/StatusBody.vue | 6 +- components/status/StatusCard.vue | 3 +- components/status/StatusContent.vue | 5 +- components/status/StatusDetails.vue | 3 +- composables/content-parse.ts | 74 +++++++++++++++++---- pages/[[server]]/@[account]/[status].vue | 9 +-- tests/__snapshots__/html-parse.test.ts.snap | 66 ++++++++++++++++++ tests/content-rich.test.ts | 32 +++++++++ tests/html-parse.test.ts | 18 ++--- 9 files changed, 186 insertions(+), 30 deletions(-) diff --git a/components/status/StatusBody.vue b/components/status/StatusBody.vue index ef51dead..733f9974 100644 --- a/components/status/StatusBody.vue +++ b/components/status/StatusBody.vue @@ -3,9 +3,11 @@ import type { mastodon } from 'masto' const { status, + newer, withAction = true, } = defineProps<{ status: mastodon.v1.Status | mastodon.v1.StatusEdit + newer?: mastodon.v1.Status withAction?: boolean }>() @@ -20,13 +22,15 @@ const vnode = $computed(() => { mentions: 'mentions' in status ? status.mentions : undefined, markdown: true, collapseMentionLink: !!('inReplyToId' in status && status.inReplyToId), + status: 'id' in status ? status : undefined, + inReplyToStatus: newer, }) return vnode })