From 52b60fa38b5bb6bccdd6d0ec005edf6332aaaaa7 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 28 Feb 2024 15:04:01 +0800 Subject: [PATCH] Respect filters for reply hints --- src/components/status.css | 18 ++++++++++++++++++ src/components/status.jsx | 19 +++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/components/status.css b/src/components/status.css index 6b965c8..96b0d5b 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -404,6 +404,24 @@ font-size: 90%; line-height: var(--avatar-size); } + + .status-filtered-badge.badge-meta { + margin-top: 6px; + flex-direction: row; + gap: 0.5em; + color: var(--text-color); + border-color: var(--text-color); + background-color: var(--bg-blur-color); + max-width: 100%; + + > span + span { + position: static; + + &:empty { + display: none; + } + } + } } .status .container { diff --git a/src/components/status.jsx b/src/components/status.jsx index 1d953b2..c196cee 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -2405,13 +2405,21 @@ function StatusCompact({ sKey }) { visibility, content, language, + filtered, } = status; if (sensitive || spoilerText) return null; if (!content) return null; const srKey = statusKey(id, instance); - const statusPeekText = statusPeek(status); + + const filterContext = useContext(FilterContext); + const filterInfo = isFiltered(filtered, filterContext); + + if (filterInfo?.action === 'hide') return null; + + const filterTitleStr = filterInfo?.titlesStr || ''; + return (
- {statusPeekText} + {filterInfo ? ( + + Filtered + {filterTitleStr} + + ) : ( + statusPeekText + )}
);