feat: ノートでアイコンを隠すオプションを追加

This commit is contained in:
NoriDev 2023-06-12 00:11:59 +09:00
parent ed948bf91a
commit 3ca938c188
13 changed files with 25 additions and 9 deletions

View file

@ -36,6 +36,7 @@
- 노트/유저 검색 페이지에서 Enter 키를 누르면 검색하도록
- 프로필 번역 기능 추가
- 네비게이션 메뉴에 배너 표시 옵션 추가
- 노트에서 프로필 아이콘을 숨기는 옵션 추가
### Client
- 모바일에서 UI 흐림 효과를 껐을 때 가독성 향상

View file

@ -1,5 +1,6 @@
---
_lang_: "English"
hideAvatarsInNote: "Hide avatars in notes"
displayBanner: "Display Banner Image"
requireRefresh: "When the page needs to refresh"
performanceWarning: "High resource usage can result in higher device temperatures and faster battery consumption"

1
locales/index.d.ts vendored
View file

@ -3,6 +3,7 @@
// Do not edit this file directly.
export interface Locale {
"_lang_": string;
"hideAvatarsInNote": string;
"displayBanner": string;
"requireRefresh": string;
"performanceWarning": string;

View file

@ -1,5 +1,6 @@
_lang_: "日本語"
hideAvatarsInNote: "ノートでアイコンを隠す"
displayBanner: "バナー画像の表示"
requireRefresh: "ページの更新が必要なとき"
performanceWarning: "リソースを多く使用するため、デバイスの温度が高くなり、バッテリーの消耗が速くなる可能性があります"

View file

@ -1,5 +1,6 @@
---
_lang_: "한국어"
hideAvatarsInNote: "노트에서 프로필 아이콘 숨김"
displayBanner: "배너 이미지 표시"
requireRefresh: "페이지 새로 고침이 필요할 때"
performanceWarning: "리소스를 많이 사용하므로, 디바이스의 온도가 높아지고 배터리의 소모가 빨라질 수 있어요"

View file

@ -12,7 +12,7 @@
<!--<div v-if="appearNote._featuredId_" class="tip"><i class="ti ti-bolt"></i> {{ i18n.ts.featured }}</div>-->
<div v-if="isRenote" :class="$style.renote">
<div v-if="note.channel" :class="$style.colorBar" :style="{ background: note.channel.color }"></div>
<MkAvatar :class="$style.renoteAvatar" :user="note.user" link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.renoteAvatar" :user="note.user" link preview/>
<i class="ti ti-repeat" style="margin-right: 4px;"></i>
<I18n :src="i18n.ts.renotedBy" tag="span" :class="$style.renoteText">
<template #user>
@ -37,13 +37,13 @@
</div>
<MkNoteSub v-if="appearNote.reply && !renoteCollapsed" :note="appearNote.reply" :class="$style.replyTo"/>
<div v-if="renoteCollapsed" :class="$style.collapsedRenoteTarget">
<MkAvatar :class="$style.collapsedRenoteTargetAvatar" :user="appearNote.user" link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.collapsedRenoteTargetAvatar" :user="appearNote.user" link preview/>
<Mfm :text="getNoteSummary(appearNote)" :plain="true" :nowrap="true" :author="appearNote.user" :class="$style.collapsedRenoteTargetText" @click="renoteCollapsed = false"/>
</div>
<article v-else :class="$style.article" @contextmenu.stop="onContextmenu">
<div style="display: flex; padding-bottom: 10px;">
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
<MkAvatar :class="[$style.avatar, { [$style.avatarReplyTo]: appearNote.reply, [$style.showEl]: !appearNote.reply && showEl && mainRouter.currentRoute.value.name === 'index', [$style.showElTab]: !appearNote.reply && showEl && mainRouter.currentRoute.value.name !== 'index' }]" :user="appearNote.user" link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="[$style.avatar, { [$style.avatarReplyTo]: appearNote.reply, [$style.showEl]: !appearNote.reply && showEl && mainRouter.currentRoute.value.name === 'index', [$style.showElTab]: !appearNote.reply && showEl && mainRouter.currentRoute.value.name !== 'index' }]" :user="appearNote.user" link preview/>
<div :class="$style.main">
<MkNoteHeader :note="appearNote" :mini="true"/>
<div style="container-type: inline-size; padding-top: 10px;">

View file

@ -7,7 +7,7 @@
:class="$style.root"
>
<div v-if="isRenote" :class="$style.renote">
<MkAvatar :class="$style.renoteAvatar" :user="note.user" link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.renoteAvatar" :user="note.user" link preview/>
<MkA v-user-preview="note.userId" :class="$style.renoteName" :to="userPage(note.user)"/>
<i class="ti ti-repeat" style="margin-right: 4px;"></i>
<span :class="$style.renoteText">
@ -34,7 +34,7 @@
<MkNoteSub v-if="appearNote.reply" :note="appearNote.reply" :class="$style.replyTo"/>
<article :class="$style.note" @contextmenu.stop="onContextmenu">
<header :class="$style.noteHeader">
<MkAvatar :class="$style.noteHeaderAvatar" :user="appearNote.user" indicator link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.noteHeaderAvatar" :user="appearNote.user" indicator link preview/>
<div :class="$style.noteHeaderBody">
<div>
<MkA v-user-preview="appearNote.user.id" :class="$style.noteHeaderName" :to="userPage(appearNote.user)">

View file

@ -1,6 +1,6 @@
<template>
<div :class="$style.root">
<MkAvatar :class="$style.avatar" :user="$i" link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.avatar" :user="$i" link preview/>
<div :class="$style.main">
<div :class="$style.header">
<MkUserName :user="$i" :nowrap="true"/>
@ -21,6 +21,7 @@ import { $i } from '@/account';
import MkUrlPreview from '@/components/MkUrlPreview.vue';
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm';
import * as mfm from 'cherrypick-mfm-js';
import { defaultStore } from '@/store';
const props = defineProps<{
text: string;

View file

@ -1,6 +1,6 @@
<template>
<div :class="$style.root">
<MkAvatar :class="[$style.avatar, { [$style.showEl]: showEl && mainRouter.currentRoute.value.name === 'index', [$style.showElTab]: showEl && mainRouter.currentRoute.value.name !== 'index' }]" :user="note.user" link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="[$style.avatar, { [$style.showEl]: showEl && mainRouter.currentRoute.value.name === 'index', [$style.showElTab]: showEl && mainRouter.currentRoute.value.name !== 'index' }]" :user="note.user" link preview/>
<div :class="$style.main">
<MkNoteHeader :class="$style.header" :note="note" :mini="true"/>
<div style="padding-top: 10px;">
@ -25,6 +25,7 @@ import MkCwButton from '@/components/MkCwButton.vue';
import { $i } from '@/account';
import { eventBus } from '@/scripts/cherrypick/eventBus';
import { mainRouter } from '@/router';
import { defaultStore } from '@/store';
let showEl = $ref(false);

View file

@ -1,9 +1,9 @@
<template>
<div :class="[$style.root, { [$style.children]: depth > 1 }]">
<div :class="$style.line"></div>
<div v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.line"></div>
<div :class="$style.main">
<div v-if="note.channel" :class="$style.colorBar" :style="{ background: note.channel.color }"></div>
<MkAvatar :class="$style.avatar" :user="note.user" link preview/>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.avatar" :user="note.user" link preview/>
<div :class="$style.body">
<MkNoteHeader :class="$style.header" :note="note" :mini="true"/>
<div>
@ -36,6 +36,7 @@ import { notePage } from '@/filters/note';
import * as os from '@/os';
import { i18n } from '@/i18n';
import { $i } from '@/account';
import { defaultStore } from '@/store';
const props = withDefaults(defineProps<{
note: misskey.entities.Note;

View file

@ -115,6 +115,7 @@
<MkSwitch v-model="useBlurEffectForModal">{{ i18n.ts.useBlurEffectForModal }}</MkSwitch>
<MkSwitch v-model="disableShowingAnimatedImages">{{ i18n.ts.disableShowingAnimatedImages }}<template #caption>{{ i18n.ts.disableShowingAnimatedImagesDescription }}</template></MkSwitch>
<MkSwitch v-model="squareAvatars">{{ i18n.ts.squareAvatars }}</MkSwitch>
<MkSwitch v-model="hideAvatarsInNote">{{ i18n.ts.hideAvatarsInNote }}</MkSwitch>
<MkSwitch v-model="useSystemFont">{{ i18n.ts.useSystemFont }}</MkSwitch>
<MkSwitch v-model="disableDrawer">{{ i18n.ts.disableDrawer }}</MkSwitch>
<MkSwitch v-model="forceShowAds">{{ i18n.ts.forceShowAds }}</MkSwitch>
@ -318,6 +319,7 @@ const instanceTicker = computed(defaultStore.makeGetterSetter('instanceTicker'))
const enableInfiniteScroll = computed(defaultStore.makeGetterSetter('enableInfiniteScroll'));
const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu'));
const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars'));
const hideAvatarsInNote = computed(defaultStore.makeGetterSetter('hideAvatarsInNote'));
const mediaListWithOneImageAppearance = computed(defaultStore.makeGetterSetter('mediaListWithOneImageAppearance'));
const notificationPosition = computed(defaultStore.makeGetterSetter('notificationPosition'));
const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis'));
@ -366,6 +368,7 @@ watch([
useSystemFont,
enableInfiniteScroll,
squareAvatars,
hideAvatarsInNote,
showNoteActionsOnlyHover,
showGapBetweenNotesInTimeline,
instanceTicker,

View file

@ -85,6 +85,7 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
'bannerDisplay',
'reportError',
'squareAvatars',
'hideAvatarsInNote',
'numberOfPageCache',
'aiChanMode',
'mediaListWithOneImageAppearance',

View file

@ -370,6 +370,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: 'all' as 'all' | 'top' | 'bottom' | 'hide',
},
hideAvatarsInNote: {
where: 'device',
default: false,
},
}));
// TODO: 他のタブと永続化されたstateを同期