Skip to content

Commit

Permalink
Merge branch 'n-master' of https://github.com/n1lsqn/misskey into n-m…
Browse files Browse the repository at this point in the history
…aster
  • Loading branch information
n1lsqn committed Mar 28, 2024
2 parents e1cafb2 + ec511c6 commit 7e2aa9e
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 14 deletions.
28 changes: 24 additions & 4 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10124,13 +10124,33 @@ export interface Locale extends ILocale {
*/
"remoteLocalTimeline": string;
/**
* プロフィール上からアクティビティやファイルの非表示
* プロフィールを非表示にする機能
*/
"hiddenActivityAndFiles": string;
"hiddenProfile": string;
/**
* プロフィール上からアクティビティやファイルを非表示にします。ノートをいち早く見たい方にお勧めです。
* プロフィール上からピン留めしたノートを非表示にします
*/
"hiddenActivityAndFilesDescription": string;
"hiddenPinnedNotes": string;
/**
* ピン留めしたノートを非表示にすることで、プロフィールページをスッキリさせることができます。
*/
"hiddenPinnedNotesDescription": string;
/**
* プロフィール上からアクティビティを非表示にします
*/
"hiddenActivity": string;
/**
* プロフィール上からアクティビティを非表示にすることで、プロフィールページをスッキリさせることができます。
*/
"hiddenActivityDescription": string;
/**
* プロフィール上からファイルを非表示にします。
*/
"hiddenFiles": string;
/**
* ファイルを非表示にすることで、プロフィールページをスッキリさせることができます。
*/
"hiddenFilesDescription": string;
};
}
declare const locales: {
Expand Down
9 changes: 7 additions & 2 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2702,5 +2702,10 @@ _urlPreviewSetting:
_uniqueFeatures:
uniqueFeature: "独自機能"
remoteLocalTimeline: "リモート上のサーバーのローカルタイムラインを覗く機能"
hiddenActivityAndFiles: "プロフィール上からアクティビティやファイルの非表示"
hiddenActivityAndFilesDescription: "プロフィール上からアクティビティやファイルを非表示にします。ノートをいち早く見たい方にお勧めです。"
hiddenProfile: "プロフィールを非表示にする機能"
hiddenPinnedNotes: "プロフィール上からピン留めしたノートを非表示にします"
hiddenPinnedNotesDescription: "ピン留めしたノートを非表示にすることで、プロフィールページをスッキリさせることができます。"
hiddenActivity: "プロフィール上からアクティビティを非表示にします"
hiddenActivityDescription: "プロフィール上からアクティビティを非表示にすることで、プロフィールページをスッキリさせることができます。"
hiddenFiles: "プロフィール上からファイルを非表示にします。"
hiddenFilesDescription: "ファイルを非表示にすることで、プロフィールページをスッキリさせることができます。"
46 changes: 42 additions & 4 deletions packages/frontend/src/pages/settings/general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,27 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts._uniqueFeatures.uniqueFeature }}</template>

<div class="_gaps_m">
<MkSwitch v-model="hiddenActivityAndFiles">
<template #caption>{{ i18n.ts._uniqueFeatures.hiddenActivityAndFilesDescription }}</template>
{{ i18n.ts._uniqueFeatures.hiddenActivityAndFiles }}
</MkSwitch>
<MkFolder>
<template #label>{{ i18n.ts._uniqueFeatures.hiddenProfile }}</template>
<div class="_gaps_m">
<div class="_buttons">
<MkButton inline @click="enableAllHidden">{{ i18n.ts.enableAll }}</MkButton>
<MkButton inline @click="disableAllHidden">{{ i18n.ts.disableAll }}</MkButton>
</div>
<MkSwitch v-model="hiddenPinnedNotes">
<template #caption>{{ i18n.ts._uniqueFeatures.hiddenPinnedNotesDescription }}</template>
{{ i18n.ts._uniqueFeatures.hiddenPinnedNotes }}
</MkSwitch>
<MkSwitch v-model="hiddenActivity">
<template #caption>{{ i18n.ts._uniqueFeatures.hiddenActivityDescription }}</template>
{{ i18n.ts._uniqueFeatures.hiddenActivity }}
</MkSwitch>
<MkSwitch v-model="hiddenFiles">
<template #caption>{{ i18n.ts._uniqueFeatures.hiddenFilesDescription }}</template>
{{ i18n.ts._uniqueFeatures.hiddenFiles }}
</MkSwitch>
</div>
</MkFolder>

<MkFolder>
<template #label>{{ i18n.ts._uniqueFeatuers.remoteLocalTimeline }}</template>
Expand Down Expand Up @@ -456,7 +473,13 @@ const disableDrawer = computed(defaultStore.makeGetterSetter('disableDrawer'));
const disableShowingAnimatedImages = computed(defaultStore.makeGetterSetter('disableShowingAnimatedImages'));
const autoDataSaver = computed(defaultStore.makeGetterSetter('autoDataSaver'));
const enableDataSaverMode = computed(defaultStore.makeGetterSetter('enableDataSaverMode'));
<<<<<<< HEAD
const hiddenPinnedNotes = computed(defaultStore.makeGetterSetter('hiddenPinnedNotes'));
const hiddenActivity = computed(defaultStore.makeGetterSetter('hiddenActivity'));
const hiddenFiles = computed(defaultStore.makeGetterSetter('hiddenFiles'));
=======
const hiddenActivityAndFiles = computed(defaultStore.makeGetterSetter('hiddenActivityAndFiles'));
>>>>>>> b088ae5bbb273835c6fa2af7c089ce3ce790d046
const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds'));
const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages'));
const highlightSensitiveMedia = computed(defaultStore.makeGetterSetter('highlightSensitiveMedia'));
Expand Down Expand Up @@ -553,6 +576,9 @@ watch([
showReactionsCount,
showRenotesCount,
showRepliesCount,
hiddenPinnedNotes,
hiddenActivity,
hiddenFiles,
], async () => {
await reloadAsk();
});
Expand Down Expand Up @@ -682,6 +708,18 @@ function enableAllDataSaver() {
dataSaver.value = g;
}
function enableAllHidden() {
defaultStore.set('hiddenPinnedNotes', true);
defaultStore.set('hiddenActivity', true);
defaultStore.set('hiddenFiles', true);
}
function disableAllHidden() {
defaultStore.set('hiddenPinnedNotes', false);
defaultStore.set('hiddenActivity', false);
defaultStore.set('hiddenFiles', false);
}
function disableAllDataSaver() {
const g = { ...defaultStore.state.dataSaver };
Expand Down
12 changes: 9 additions & 3 deletions packages/frontend/src/pages/user/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,21 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>

<div class="contents _gaps">
<div v-if="!hiddenActivityAndFiles">
<div v-if="!hiddenPinnedNotes">
<div v-if="user.pinnedNotes.length > 0" class="_gaps">
<MkNote v-for="note in user.pinnedNotes" :key="note.id" class="note _panel" :note="note" :pinned="true"/>
</div>
</div>
<MkInfo v-else-if="$i && $i.id === user.id">{{ i18n.ts.userPagePinTip }}</MkInfo>
<div v-if="!hiddenActivityAndFiles">
<div v-if="!hiddenActivity">
<template v-if="narrow">
<MkLazy>
<XFiles :key="user.id" :user="user"/>
</MkLazy>
</template>
</div>
<div v-if="!hiddenFiles">
<template v-if="narrow">
<MkLazy>
<XActivity :key="user.id" :user="user"/>
</MkLazy>
Expand Down Expand Up @@ -218,7 +222,9 @@ const memoDraft = ref(props.user.memo);
const isEditingMemo = ref(false);
const moderationNote = ref(props.user.moderationNote);
const editModerationNote = ref(false);
const hiddenActivityAndFiles = defaultStore.state.hiddenActivityAndFiles;
const hiddenPinnedNotes = defaultStore.state.hiddenPinnedNotes;
const hiddenActivity = defaultStore.state.hiddenActivity;
const hiddenFiles = defaultStore.state.hiddenFiles;
watch(moderationNote, async () => {
await misskeyApi('admin/update-user-note', { userId: props.user.id, text: moderationNote.value });
Expand Down
10 changes: 9 additions & 1 deletion packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,15 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: false,
},
hiddenActivityAndFiles: {
hiddenPinnedNotes: {
where: 'device',
default: false,
},
hiddenActivity: {
where: 'device',
default: false,
},
hiddenFiles: {
where: 'device',
default: false,
},
Expand Down

0 comments on commit 7e2aa9e

Please sign in to comment.