From 7cb8ad01d5634bf0bfcb2c1d964ec1acab47ef10 Mon Sep 17 00:00:00 2001 From: patak-dev Date: Sat, 23 Nov 2024 23:35:34 +0100 Subject: [PATCH] refactor: remove visibility --- .../publish/PublishVisibilityPicker.vue | 36 ------------------- components/publish/PublishWidget.vue | 16 --------- components/publish/PublishWidgetList.vue | 4 --- components/status/StatusCard.vue | 4 +-- components/status/StatusContent.vue | 11 ++---- components/status/StatusDetails.vue | 1 - components/status/StatusSpoiler.vue | 5 ++- .../status/StatusVisibilityIndicator.vue | 15 -------- composables/masto/status.ts | 5 +-- composables/masto/statusDrafts.ts | 21 +---------- composables/thread.ts | 1 - pages/[[server]]/@[account]/[status].vue | 2 +- pages/intent/post.vue | 3 -- service-worker/types.ts | 2 -- types/index.ts | 2 +- 15 files changed, 9 insertions(+), 119 deletions(-) delete mode 100644 components/publish/PublishVisibilityPicker.vue delete mode 100644 components/status/StatusVisibilityIndicator.vue diff --git a/components/publish/PublishVisibilityPicker.vue b/components/publish/PublishVisibilityPicker.vue deleted file mode 100644 index b86850cb7..000000000 --- a/components/publish/PublishVisibilityPicker.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index 8955815b6..f1dfeba6e 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -19,7 +19,6 @@ const { threadComposer?: ReturnType placeholder?: string inReplyToId?: string - inReplyToVisibility?: mastodon.v1.StatusVisibility expanded?: boolean dialogLabelledBy?: string }>() @@ -173,8 +172,6 @@ const isExceedingCharacterLimit = computed(() => { const postLanguageDisplay = computed(() => languagesNameList.find(i => i.code === (draft.value.params.language || preferredLanguage.value))?.nativeName) -const isDM = computed(() => draft.value.params.visibility === 'direct') - async function handlePaste(evt: ClipboardEvent) { const files = evt.clipboardData?.files if (!files || files.length === 0) @@ -301,7 +298,6 @@ function stopQuestionMarkPropagation(e: KeyboardEvent) { :editor="editor" flex max-w-full :class="{ 'md:max-h-[calc(100vh-200px)] sm:max-h-[calc(100vh-400px)] max-h-35 of-y-auto overscroll-contain': shouldExpanded, - 'py2 px3.5 bg-dm rounded-4 me--1 ms--1 mt--1': isDM, }" @keydown="stopQuestionMarkPropagation" @keydown.esc.prevent="editor?.commands.blur()" @@ -482,18 +478,6 @@ function stopQuestionMarkPropagation(e: KeyboardEvent) { - - - - -import type { mastodon } from 'masto' import type { DraftItem } from '~/types' const { @@ -9,13 +8,11 @@ const { placeholder, dialogLabelledBy, inReplyToId, - inReplyToVisibility, } = defineProps<{ draftKey: string initial?: () => DraftItem placeholder?: string inReplyToId?: string - inReplyToVisibility?: mastodon.v1.StatusVisibility expanded?: boolean dialogLabelledBy?: string }>() @@ -44,7 +41,6 @@ function isFirstItem(index: number) { :placeholder="placeholder" :dialog-labelled-by="dialogLabelledBy" :in-reply-to-id="isFirstItem(index) ? inReplyToId : undefined" - :in-reply-to-visibility="inReplyToVisibility" /> diff --git a/components/status/StatusCard.vue b/components/status/StatusCard.vue index 6d416b038..9c1c77716 100644 --- a/components/status/StatusCard.vue +++ b/components/status/StatusCard.vue @@ -61,7 +61,6 @@ const timeago = useTimeAgo(() => status.value.createdAt, timeAgoOptions) const isSelfReply = computed(() => status.value.inReplyToAccountId === status.value.account.id) const collapseRebloggedBy = computed(() => rebloggedBy.value?.id === status.value.account.id) -const isDM = computed(() => status.value.visibility === 'direct') const showUpperBorder = computed(() => props.newer && !directReply.value) const showReplyTo = computed(() => !replyToMain.value && !directReply.value) @@ -158,7 +157,6 @@ const forceShow = ref(false)
-
@@ -180,7 +178,7 @@ const forceShow = ref(false) :context="context" :is-preview="isPreview" :in-notification="inNotification" - mb2 :class="{ 'mt-2 mb1': isDM }" + mb2 />
diff --git a/components/status/StatusContent.vue b/components/status/StatusContent.vue index e347ef17f..f76fe30ee 100644 --- a/components/status/StatusContent.vue +++ b/components/status/StatusContent.vue @@ -9,7 +9,6 @@ const { status, context } = defineProps<{ inNotification?: boolean }>() -const isDM = computed(() => status.visibility === 'direct') const isDetails = computed(() => context === 'details') // Content Filter logic @@ -34,15 +33,9 @@ const allowEmbeddedMedia = computed(() => status.card?.html && embeddedMediaPref