upd: add boost settings

This commit is contained in:
Marie 2024-01-01 20:34:18 +01:00
parent b928446ddd
commit c9ca1dd3f1
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
8 changed files with 233 additions and 180 deletions

View file

@ -399,39 +399,43 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
} }
function boostVisibility() { function boostVisibility() {
os.popupMenu([ if (!defaultStore.state.showVisibilitySelectorOnBoost) {
{ renote(defaultStore.state.visibilityOnBoost);
type: 'button', } else {
icon: 'ph-globe-hemisphere-west ph-bold ph-lg', os.popupMenu([
text: i18n.ts._visibility['public'], {
action: () => { type: 'button',
renote('public'); icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
text: i18n.ts._visibility['public'],
action: () => {
renote('public');
},
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-house ph-bold ph-lg',
icon: 'ph-house ph-bold ph-lg', text: i18n.ts._visibility['home'],
text: i18n.ts._visibility['home'], action: () => {
action: () => { renote('home');
renote('home'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-lock ph-bold ph-lg',
icon: 'ph-lock ph-bold ph-lg', text: i18n.ts._visibility['followers'],
text: i18n.ts._visibility['followers'], action: () => {
action: () => { renote('followers');
renote('followers'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-planet ph-bold ph-lg',
icon: 'ph-planet ph-bold ph-lg', text: i18n.ts._timelines.local,
text: i18n.ts._timelines.local, action: () => {
action: () => { renote('local');
renote('local'); },
}, }], renoteButton.value);
}], renoteButton.value); }
} }
function renote(visibility: Visibility | 'local') { function renote(visibility: Visibility | 'local') {

View file

@ -441,39 +441,43 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
} }
function boostVisibility() { function boostVisibility() {
os.popupMenu([ if (!defaultStore.state.showVisibilitySelectorOnBoost) {
{ renote(defaultStore.state.visibilityOnBoost);
type: 'button', } else {
icon: 'ph-globe-hemisphere-west ph-bold ph-lg', os.popupMenu([
text: i18n.ts._visibility['public'], {
action: () => { type: 'button',
renote('public'); icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
text: i18n.ts._visibility['public'],
action: () => {
renote('public');
},
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-house ph-bold ph-lg',
icon: 'ph-house ph-bold ph-lg', text: i18n.ts._visibility['home'],
text: i18n.ts._visibility['home'], action: () => {
action: () => { renote('home');
renote('home'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-lock ph-bold ph-lg',
icon: 'ph-lock ph-bold ph-lg', text: i18n.ts._visibility['followers'],
text: i18n.ts._visibility['followers'], action: () => {
action: () => { renote('followers');
renote('followers'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-planet ph-bold ph-lg',
icon: 'ph-planet ph-bold ph-lg', text: i18n.ts._timelines.local,
text: i18n.ts._timelines.local, action: () => {
action: () => { renote('local');
renote('local'); },
}, }], renoteButton.value);
}], renoteButton.value); }
} }
function renote(visibility: Visibility | 'local') { function renote(visibility: Visibility | 'local') {

View file

@ -269,39 +269,43 @@ watch(() => props.expandAllCws, (expandAllCws) => {
}); });
function boostVisibility() { function boostVisibility() {
os.popupMenu([ if (!defaultStore.state.showVisibilitySelectorOnBoost) {
{ renote(defaultStore.state.visibilityOnBoost);
type: 'button', } else {
icon: 'ph-globe-hemisphere-west ph-bold ph-lg', os.popupMenu([
text: i18n.ts._visibility['public'], {
action: () => { type: 'button',
renote('public'); icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
text: i18n.ts._visibility['public'],
action: () => {
renote('public');
},
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-house ph-bold ph-lg',
icon: 'ph-house ph-bold ph-lg', text: i18n.ts._visibility['home'],
text: i18n.ts._visibility['home'], action: () => {
action: () => { renote('home');
renote('home'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-lock ph-bold ph-lg',
icon: 'ph-lock ph-bold ph-lg', text: i18n.ts._visibility['followers'],
text: i18n.ts._visibility['followers'], action: () => {
action: () => { renote('followers');
renote('followers'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-planet ph-bold ph-lg',
icon: 'ph-planet ph-bold ph-lg', text: i18n.ts._timelines.local,
text: i18n.ts._timelines.local, action: () => {
action: () => { renote('local');
renote('local'); },
}, }], renoteButton.value);
}], renoteButton.value); }
} }
function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') { function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') {

View file

@ -400,39 +400,43 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
} }
function boostVisibility() { function boostVisibility() {
os.popupMenu([ if (!defaultStore.state.showVisibilitySelectorOnBoost) {
{ renote(defaultStore.state.visibilityOnBoost);
type: 'button', } else {
icon: 'ph-globe-hemisphere-west ph-bold ph-lg', os.popupMenu([
text: i18n.ts._visibility['public'], {
action: () => { type: 'button',
renote('public'); icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
text: i18n.ts._visibility['public'],
action: () => {
renote('public');
},
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-house ph-bold ph-lg',
icon: 'ph-house ph-bold ph-lg', text: i18n.ts._visibility['home'],
text: i18n.ts._visibility['home'], action: () => {
action: () => { renote('home');
renote('home'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-lock ph-bold ph-lg',
icon: 'ph-lock ph-bold ph-lg', text: i18n.ts._visibility['followers'],
text: i18n.ts._visibility['followers'], action: () => {
action: () => { renote('followers');
renote('followers'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-planet ph-bold ph-lg',
icon: 'ph-planet ph-bold ph-lg', text: i18n.ts._timelines.local,
text: i18n.ts._timelines.local, action: () => {
action: () => { renote('local');
renote('local'); },
}, }], renoteButton.value);
}], renoteButton.value); }
} }
function renote(visibility: Visibility | 'local') { function renote(visibility: Visibility | 'local') {

View file

@ -449,39 +449,43 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
} }
function boostVisibility() { function boostVisibility() {
os.popupMenu([ if (!defaultStore.state.showVisibilitySelectorOnBoost) {
{ renote(defaultStore.state.visibilityOnBoost);
type: 'button', } else {
icon: 'ph-globe-hemisphere-west ph-bold ph-lg', os.popupMenu([
text: i18n.ts._visibility['public'], {
action: () => { type: 'button',
renote('public'); icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
text: i18n.ts._visibility['public'],
action: () => {
renote('public');
},
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-house ph-bold ph-lg',
icon: 'ph-house ph-bold ph-lg', text: i18n.ts._visibility['home'],
text: i18n.ts._visibility['home'], action: () => {
action: () => { renote('home');
renote('home'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-lock ph-bold ph-lg',
icon: 'ph-lock ph-bold ph-lg', text: i18n.ts._visibility['followers'],
text: i18n.ts._visibility['followers'], action: () => {
action: () => { renote('followers');
renote('followers'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-planet ph-bold ph-lg',
icon: 'ph-planet ph-bold ph-lg', text: i18n.ts._timelines.local,
text: i18n.ts._timelines.local, action: () => {
action: () => { renote('local');
renote('local'); },
}, }], renoteButton.value);
}], renoteButton.value); }
} }
function renote(visibility: Visibility | 'local') { function renote(visibility: Visibility | 'local') {

View file

@ -278,39 +278,43 @@ watch(() => props.expandAllCws, (expandAllCws) => {
}); });
function boostVisibility() { function boostVisibility() {
os.popupMenu([ if (!defaultStore.state.showVisibilitySelectorOnBoost) {
{ renote(defaultStore.state.visibilityOnBoost);
type: 'button', } else {
icon: 'ph-globe-hemisphere-west ph-bold ph-lg', os.popupMenu([
text: i18n.ts._visibility['public'], {
action: () => { type: 'button',
renote('public'); icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
text: i18n.ts._visibility['public'],
action: () => {
renote('public');
},
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-house ph-bold ph-lg',
icon: 'ph-house ph-bold ph-lg', text: i18n.ts._visibility['home'],
text: i18n.ts._visibility['home'], action: () => {
action: () => { renote('home');
renote('home'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-lock ph-bold ph-lg',
icon: 'ph-lock ph-bold ph-lg', text: i18n.ts._visibility['followers'],
text: i18n.ts._visibility['followers'], action: () => {
action: () => { renote('followers');
renote('followers'); },
}, },
}, {
{ type: 'button',
type: 'button', icon: 'ph-planet ph-bold ph-lg',
icon: 'ph-planet ph-bold ph-lg', text: i18n.ts._timelines.local,
text: i18n.ts._timelines.local, action: () => {
action: () => { renote('local');
renote('local'); },
}, }], renoteButton.value);
}], renoteButton.value); }
} }
function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') { function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') {

View file

@ -190,6 +190,23 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #caption>{{ i18n.ts.numberOfPageCacheDescription }}</template> <template #caption>{{ i18n.ts.numberOfPageCacheDescription }}</template>
</MkRange> </MkRange>
<MkFolder>
<template #label>Boost Settings</template>
<div class="_gaps_m">
<MkSwitch v-model="showVisibilitySelectorOnBoost">
Disable Visibility Selector
<template #caption>Disables the visiblity selector when clicking boost and uses the default visiblity defined</template>
</MkSwitch>
<MkSelect v-model="visibilityOnBoost">
<template #label>Default boost visibility</template>
<option value="public">{{ i18n.ts._visibility['public'] }}</option>
<option value="home">{{ i18n.ts._visibility['home'] }}</option>
<option value="followers">{{ i18n.ts._visibility['followers'] }}</option>
<option value="local">{{ i18n.ts._timelines.local }}</option>
</MkSelect>
</div>
</MkFolder>
<MkFolder> <MkFolder>
<template #label>{{ i18n.ts.dataSaver }}</template> <template #label>{{ i18n.ts.dataSaver }}</template>
@ -326,6 +343,8 @@ const noteDesign = computed(defaultStore.makeGetterSetter('noteDesign'));
const uncollapseCW = computed(defaultStore.makeGetterSetter('uncollapseCW')); const uncollapseCW = computed(defaultStore.makeGetterSetter('uncollapseCW'));
const expandLongNote = computed(defaultStore.makeGetterSetter('expandLongNote')); const expandLongNote = computed(defaultStore.makeGetterSetter('expandLongNote'));
const enableSeasonalScreenEffect = computed(defaultStore.makeGetterSetter('enableSeasonalScreenEffect')); const enableSeasonalScreenEffect = computed(defaultStore.makeGetterSetter('enableSeasonalScreenEffect'));
const showVisibilitySelectorOnBoost = computed(defaultStore.makeGetterSetter('showVisibilitySelectorOnBoost'));
const visibilityOnBoost = computed(defaultStore.makeGetterSetter('visibilityOnBoost'));
watch(lang, () => { watch(lang, () => {
miLocalStorage.setItem('lang', lang.value as string); miLocalStorage.setItem('lang', lang.value as string);
@ -381,6 +400,8 @@ watch([
keepScreenOn, keepScreenOn,
disableStreamingTimeline, disableStreamingTimeline,
enableSeasonalScreenEffect, enableSeasonalScreenEffect,
showVisibilitySelectorOnBoost,
visibilityOnBoost,
], async () => { ], async () => {
await reloadAsk(); await reloadAsk();
}); });

View file

@ -151,6 +151,14 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account', where: 'account',
default: true, default: true,
}, },
showVisibilitySelectorOnBoost: {
where: 'account',
default: true,
},
visibilityOnBoost: {
where: 'account',
default: 'public' as 'public' | 'home' | 'followers' | 'local',
},
menu: { menu: {
where: 'deviceAccount', where: 'deviceAccount',