1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-20 22:15:28 +02:00

enhance(frontend): improve tips

This commit is contained in:
syuilo
2025-05-23 10:46:42 +09:00
parent 9d36d36fc4
commit 2bfbbbf16a
13 changed files with 143 additions and 42 deletions

View File

@@ -11,9 +11,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkButton link to="/admin/abuse-report-notification-recipient" primary>{{ i18n.ts.notificationSetting }}</MkButton>
</div>
<MkInfo v-if="!store.r.abusesTutorial.value" closable @close="closeTutorial()">
<MkTip k="abuses">
{{ i18n.ts._abuseUserReport.resolveTutorial }}
</MkInfo>
</MkTip>
<div :class="$style.inputs" class="_gaps">
<MkSelect v-model="state" style="margin: 0; flex: 1;">
@@ -65,7 +65,6 @@ import XAbuseReport from '@/components/MkAbuseReport.vue';
import { i18n } from '@/i18n.js';
import { definePage } from '@/page.js';
import MkButton from '@/components/MkButton.vue';
import MkInfo from '@/components/MkInfo.vue';
import { store } from '@/store.js';
const reports = useTemplateRef('reports');
@@ -90,10 +89,6 @@ function resolved(reportId) {
reports.value?.paginator.removeItem(reportId);
}
function closeTutorial() {
store.set('abusesTutorial', false);
}
const headerActions = computed(() => []);
const headerTabs = computed(() => []);

View File

@@ -5,7 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<PageWithHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs" :swipable="true">
<div class="_spacer" style="--MI_SPACER-w: 700px;">
<div class="_spacer _gaps" style="--MI_SPACER-w: 700px;">
<MkTip k="clips">
{{ i18n.ts._clip.tip }}
</MkTip>
<div v-if="tab === 'my'" class="_gaps">
<MkButton primary rounded class="add" @click="create"><i class="ti ti-plus"></i> {{ i18n.ts.add }}</MkButton>

View File

@@ -7,6 +7,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<PageWithHeader :actions="headerActions" :tabs="headerTabs">
<div class="_spacer" style="--MI_SPACER-w: 700px;">
<div class="_gaps">
<MkTip k="userLists">
{{ i18n.ts._userLists.tip }}
</MkTip>
<MkResult v-if="items.length === 0" type="empty"/>
<MkButton primary rounded style="margin: 0 auto;" @click="create"><i class="ti ti-plus"></i> {{ i18n.ts.createList }}</MkButton>

View File

@@ -123,6 +123,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<hr>
<MkButton @click="resetAllTips"><i class="ti ti-bulb"></i> {{ i18n.ts.redisplayAllTips }}</MkButton>
<MkButton @click="hideAllTips"><i class="ti ti-bulb-off"></i> {{ i18n.ts.hideAllTips }}</MkButton>
<hr>
<FormSlot>
<MkButton danger @click="migrate"><i class="ti ti-refresh"></i> {{ i18n.ts.migrateOldSettings }}</MkButton>
<template #caption>{{ i18n.ts.migrateOldSettings_description }}</template>
@@ -152,6 +157,7 @@ import { prefer } from '@/preferences.js';
import MkRolePreview from '@/components/MkRolePreview.vue';
import { signout } from '@/signout.js';
import { migrateOldSettings } from '@/pref-migrate.js';
import { store, TIPS } from '@/store.js';
const $i = ensureSignin();
@@ -194,6 +200,20 @@ function migrate() {
migrateOldSettings();
}
function resetAllTips() {
store.set('tips', {});
os.success();
}
function hideAllTips() {
const v = {};
for (const k of TIPS) {
v[k] = true;
}
store.set('tips', v);
os.success();
}
const headerActions = computed(() => []);
const headerTabs = computed(() => []);

View File

@@ -6,9 +6,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<PageWithHeader v-model:tab="src" :actions="headerActions" :tabs="$i ? headerTabs : headerTabsWhenNotLogin" :swipable="true" :displayMyAvatar="true">
<div class="_spacer" style="--MI_SPACER-w: 800px;">
<MkInfo v-if="isBasicTimeline(src) && !store.r.timelineTutorials.value[src]" style="margin-bottom: var(--MI-margin);" closable @close="closeTutorial()">
<MkTip v-if="isBasicTimeline(src)" :k="`tl.${src}`" style="margin-bottom: var(--MI-margin);">
{{ i18n.ts._timelineDescription[src] }}
</MkInfo>
</MkTip>
<MkPostForm v-if="prefer.r.showFixedPostForm.value" :class="$style.postForm" class="_panel" fixed style="margin-bottom: var(--MI-margin);"/>
<MkStreamingNotesTimeline
ref="tlComponent"
@@ -32,7 +32,6 @@ import type { Tab } from '@/components/global/MkPageHeader.tabs.vue';
import type { MenuItem } from '@/types/menu.js';
import type { BasicTimelineType } from '@/timelines.js';
import MkStreamingNotesTimeline from '@/components/MkStreamingNotesTimeline.vue';
import MkInfo from '@/components/MkInfo.vue';
import MkPostForm from '@/components/MkPostForm.vue';
import * as os from '@/os.js';
import { store } from '@/store.js';
@@ -204,13 +203,6 @@ function focus(): void {
tlComponent.value.focus();
}
function closeTutorial(): void {
if (!isBasicTimeline(src.value)) return;
const before = store.s.timelineTutorials;
before[src.value] = true;
store.set('timelineTutorials', before);
}
function switchTlIfNeeded() {
if (isBasicTimeline(src.value) && !isAvailableBasicTimeline(src.value)) {
src.value = availableBasicTimelines()[0];