Skip to content

Commit

Permalink
Merge branch 'enh-14784' of https://github.com/kakkokari-gtyih/misskey
Browse files Browse the repository at this point in the history
…into enh-14784
  • Loading branch information
kakkokari-gtyih committed Oct 20, 2024
2 parents 6544a86 + e2f382a commit ff0f0b0
Show file tree
Hide file tree
Showing 20 changed files with 218 additions and 153 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
-

### Client
- Enhance: Bull DashboardでRelationship Queueの状態も確認できるように
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751)
- Enhance: ドライブでソートができるように
- Enhance: ノートの公開範囲に応じて色分けできるように
- Fix: 通知の範囲指定の設定項目が必要ない通知設定でも範囲指定の設定がでている問題を修正

### Server
-
Expand Down
6 changes: 3 additions & 3 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9279,7 +9279,7 @@ export interface Locale extends ILocale {
*/
"youGotQuote": ParameterizedString<"name">;
/**
* {name}がRenoteしました
* {name}がリノートしました
*/
"youRenoted": ParameterizedString<"name">;
/**
Expand Down Expand Up @@ -9384,7 +9384,7 @@ export interface Locale extends ILocale {
*/
"reply": string;
/**
* Renote
* リノート
*/
"renote": string;
/**
Expand Down Expand Up @@ -9442,7 +9442,7 @@ export interface Locale extends ILocale {
*/
"reply": string;
/**
* Renote
* リノート
*/
"renote": string;
};
Expand Down
6 changes: 3 additions & 3 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@ _notification:
youGotMention: "{name}からのメンション"
youGotReply: "{name}からのリプライ"
youGotQuote: "{name}による引用"
youRenoted: "{name}がRenoteしました"
youRenoted: "{name}がリノートしました"
youWereFollowed: "フォローされました"
youReceivedFollowRequest: "フォローリクエストが来ました"
yourFollowRequestAccepted: "フォローリクエストが承認されました"
Expand Down Expand Up @@ -2478,7 +2478,7 @@ _notification:
follow: "フォロー"
mention: "メンション"
reply: "リプライ"
renote: "Renote"
renote: "リノート"
quote: "引用"
reaction: "リアクション"
pollEnded: "アンケートが終了"
Expand All @@ -2494,7 +2494,7 @@ _notification:
_actions:
followBack: "フォローバック"
reply: "返信"
renote: "Renote"
renote: "リノート"

_deck:
alwaysShowMainColumn: "常にメインカラムを表示"
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/server/web/ClientServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type {
EndedPollNotificationQueue,
InboxQueue,
ObjectStorageQueue,
RelationshipQueue,
SystemQueue,
UserWebhookDeliverQueue,
SystemWebhookDeliverQueue,
Expand Down Expand Up @@ -121,6 +122,7 @@ export class ClientServerService {
@Inject('queue:deliver') public deliverQueue: DeliverQueue,
@Inject('queue:inbox') public inboxQueue: InboxQueue,
@Inject('queue:db') public dbQueue: DbQueue,
@Inject('queue:relationship') public relationshipQueue: RelationshipQueue,
@Inject('queue:objectStorage') public objectStorageQueue: ObjectStorageQueue,
@Inject('queue:userWebhookDeliver') public userWebhookDeliverQueue: UserWebhookDeliverQueue,
@Inject('queue:systemWebhookDeliver') public systemWebhookDeliverQueue: SystemWebhookDeliverQueue,
Expand Down Expand Up @@ -248,6 +250,7 @@ export class ClientServerService {
this.deliverQueue,
this.inboxQueue,
this.dbQueue,
this.relationshipQueue,
this.objectStorageQueue,
this.userWebhookDeliverQueue,
this.systemWebhookDeliverQueue,
Expand Down
24 changes: 14 additions & 10 deletions packages/frontend/src/components/MkContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,30 @@ const showBody = ref(props.expanded);
const ignoreOmit = ref(false);
const omitted = ref(false);

function enter(el) {
function enter(el: Element) {
if (!(el instanceof HTMLElement)) return;
const elementHeight = el.getBoundingClientRect().height;
el.style.height = 0;
el.style.height = '0';
el.offsetHeight; // reflow
el.style.height = Math.min(elementHeight, props.maxHeight ?? Infinity) + 'px';
el.style.height = `${Math.min(elementHeight, props.maxHeight ?? Infinity)}px`;
}

function afterEnter(el) {
el.style.height = null;
function afterEnter(el: Element) {
if (!(el instanceof HTMLElement)) return;
el.style.height = '';
}

function leave(el) {
function leave(el: Element) {
if (!(el instanceof HTMLElement)) return;
const elementHeight = el.getBoundingClientRect().height;
el.style.height = elementHeight + 'px';
el.style.height = `${elementHeight}px`;
el.offsetHeight; // reflow
el.style.height = 0;
el.style.height = '0';
}

function afterLeave(el) {
el.style.height = null;
function afterLeave(el: Element) {
if (!(el instanceof HTMLElement)) return;
el.style.height = '';
}

const calcOmit = () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/src/components/MkDateSeparatedList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ export default defineComponent({
return children;
};

function onBeforeLeave(element: Element) {
const el = element as HTMLElement;
function onBeforeLeave(el: Element) {
if (!(el instanceof HTMLElement)) return;
el.style.top = `${el.offsetTop}px`;
el.style.left = `${el.offsetLeft}px`;
}

function onLeaveCancelled(element: Element) {
const el = element as HTMLElement;
function onLeaveCancelled(el: Element) {
if (!(el instanceof HTMLElement)) return;
el.style.top = '';
el.style.left = '';
}
Expand Down
44 changes: 44 additions & 0 deletions packages/frontend/src/components/MkDrive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ const ilFilesObserver = new IntersectionObserver(
(entries) => entries.some((entry) => entry.isIntersecting) && !fetching.value && moreFiles.value && fetchMoreFiles(),
);

const sortModeSelect = ref('+createdAt');

watch(folder, () => emit('cd', folder.value));
watch(sortModeSelect, () => {
fetch();
});

function onStreamDriveFileCreated(file: Misskey.entities.DriveFile) {
addFile(file, true);
Expand Down Expand Up @@ -558,6 +563,7 @@ async function fetch() {
folderId: folder.value ? folder.value.id : null,
type: props.type,
limit: filesMax + 1,
sort: sortModeSelect.value,
}).then(fetchedFiles => {
if (fetchedFiles.length === filesMax + 1) {
moreFiles.value = true;
Expand Down Expand Up @@ -607,6 +613,7 @@ function fetchMoreFiles() {
type: props.type,
untilId: files.value.at(-1)?.id,
limit: max + 1,
sort: sortModeSelect.value,
}).then(files => {
if (files.length === max + 1) {
moreFiles.value = true;
Expand Down Expand Up @@ -642,6 +649,43 @@ function getMenu() {
type: 'label',
});

menu.push({
type: 'parent',
text: i18n.ts.sort,
icon: 'ti ti-arrows-sort',
children: [{
text: `${i18n.ts.registeredDate} (${i18n.ts.descendingOrder})`,
icon: 'ti ti-sort-descending-letters',
action: () => { sortModeSelect.value = '+createdAt'; },
active: sortModeSelect.value === '+createdAt',
}, {
text: `${i18n.ts.registeredDate} (${i18n.ts.ascendingOrder})`,
icon: 'ti ti-sort-ascending-letters',
action: () => { sortModeSelect.value = '-createdAt'; },
active: sortModeSelect.value === '-createdAt',
}, {
text: `${i18n.ts.size} (${i18n.ts.descendingOrder})`,
icon: 'ti ti-sort-descending-letters',
action: () => { sortModeSelect.value = '+size'; },
active: sortModeSelect.value === '+size',
}, {
text: `${i18n.ts.size} (${i18n.ts.ascendingOrder})`,
icon: 'ti ti-sort-ascending-letters',
action: () => { sortModeSelect.value = '-size'; },
active: sortModeSelect.value === '-size',
}, {
text: `${i18n.ts.name} (${i18n.ts.descendingOrder})`,
icon: 'ti ti-sort-descending-letters',
action: () => { sortModeSelect.value = '+name'; },
active: sortModeSelect.value === '+name',
}, {
text: `${i18n.ts.name} (${i18n.ts.ascendingOrder})`,
icon: 'ti ti-sort-ascending-letters',
action: () => { sortModeSelect.value = '-name'; },
active: sortModeSelect.value === '-name',
}],
});

if (folder.value) {
menu.push({
text: i18n.ts.renameFolder,
Expand Down
52 changes: 21 additions & 31 deletions packages/frontend/src/components/MkFoldableSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<template>
<div ref="rootEl" :class="$style.root">
<header :class="$style.header" class="_button" :style="{ background: bg }" @click="showBody = !showBody">
<header :class="$style.header" class="_button" @click="showBody = !showBody">
<div :class="$style.title"><div><slot name="header"></slot></div></div>
<div :class="$style.divider"></div>
<button class="_button" :class="$style.button">
Expand All @@ -32,21 +32,23 @@ SPDX-License-Identifier: AGPL-3.0-only

<script lang="ts" setup>
import { onMounted, ref, shallowRef, watch } from 'vue';
import tinycolor from 'tinycolor2';
import { miLocalStorage } from '@/local-storage.js';
import { defaultStore } from '@/store.js';
import { getBgColor } from '@/scripts/get-bg-color.js';

const miLocalStoragePrefix = 'ui:folder:' as const;

const props = withDefaults(defineProps<{
expanded?: boolean;
persistKey?: string;
persistKey?: string | null;
}>(), {
expanded: true,
persistKey: null,
});

const rootEl = shallowRef<HTMLDivElement>();
const bg = ref<string>();
const rootEl = shallowRef<HTMLElement>();
const parentBg = ref<string | null>(null);
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
const showBody = ref((props.persistKey && miLocalStorage.getItem(`${miLocalStoragePrefix}${props.persistKey}`)) ? (miLocalStorage.getItem(`${miLocalStoragePrefix}${props.persistKey}`) === 't') : props.expanded);

watch(showBody, () => {
Expand All @@ -55,47 +57,34 @@ watch(showBody, () => {
}
});

function enter(element: Element) {
const el = element as HTMLElement;
function enter(el: Element) {
if (!(el instanceof HTMLElement)) return;
const elementHeight = el.getBoundingClientRect().height;
el.style.height = '0';
el.offsetHeight; // reflow
el.style.height = elementHeight + 'px';
el.style.height = `${elementHeight}px`;
}

function afterEnter(element: Element) {
const el = element as HTMLElement;
el.style.height = 'unset';
function afterEnter(el: Element) {
if (!(el instanceof HTMLElement)) return;
el.style.height = '';
}

function leave(element: Element) {
const el = element as HTMLElement;
function leave(el: Element) {
if (!(el instanceof HTMLElement)) return;
const elementHeight = el.getBoundingClientRect().height;
el.style.height = elementHeight + 'px';
el.style.height = `${elementHeight}px`;
el.offsetHeight; // reflow
el.style.height = '0';
}

function afterLeave(element: Element) {
const el = element as HTMLElement;
el.style.height = 'unset';
function afterLeave(el: Element) {
if (!(el instanceof HTMLElement)) return;
el.style.height = '';
}

onMounted(() => {
function getParentBg(el?: HTMLElement | null): string {
if (el == null || el.tagName === 'BODY') return 'var(--MI_THEME-bg)';
const background = el.style.background || el.style.backgroundColor;
if (background) {
return background;
} else {
return getParentBg(el.parentElement);
}
}

const rawBg = getParentBg(rootEl.value);
const _bg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
_bg.setAlpha(0.85);
bg.value = _bg.toRgbString();
parentBg.value = getBgColor(rootEl.value?.parentElement);
});
</script>

Expand All @@ -121,6 +110,7 @@ onMounted(() => {
top: var(--MI-stickyTop, 0px);
-webkit-backdrop-filter: var(--MI-blur, blur(8px));
backdrop-filter: var(--MI-blur, blur(20px));
background-color: color(from v-bind("parentBg ?? 'var(--bg)'") srgb r g b / 0.85);
}

.title {
Expand Down
Loading

0 comments on commit ff0f0b0

Please sign in to comment.