Skip to content

Commit

Permalink
Merge branch 'feature/emoji-grid' of https://github.com/samunohito/mi…
Browse files Browse the repository at this point in the history
…sskey into pr/13473
  • Loading branch information
syuilo committed Mar 20, 2024
2 parents 250266a + 4915f6c commit 5c1bf06
Show file tree
Hide file tree
Showing 14 changed files with 354 additions and 163 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
- Enhance: リアクション受け入れが「いいねのみ」の場合はリアクション絵文字一覧を表示しないように
- Enhance: 設定>プラグインのページからプラグインの簡易的なログやエラーを見られるように
- 実装の都合により、プラグインは1つエラーを起こした時に即時停止するようになりました
- Enhance: ページのデザインを変更
- Fix: 一部のページ内リンクが正しく動作しない問題を修正
- Fix: 周年の実績が閏年を考慮しない問題を修正
- Fix: ローカルURLのプレビューポップアップが左上に表示される
- Fix: WebGL2をサポートしないブラウザで「季節に応じた画面の演出」が有効になっているとき、Misskeyが起動できなくなる問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/459)
- Fix: ページタイトルでローカルユーザーとリモートユーザーの区別がつかない問題を修正
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/528)

### Server
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに
- Fix: フォローリクエストを作成する際に既存のものは削除するように
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440)

## 2024.3.1

Expand Down
6 changes: 6 additions & 0 deletions packages/backend/src/core/UserFollowingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ export class UserFollowingService implements OnModuleInit {
if (blocking) throw new Error('blocking');
if (blocked) throw new Error('blocked');

// Remove old follow requests before creating a new one.
await this.followRequestsRepository.delete({
followeeId: followee.id,
followerId: follower.id,
});

const followRequest = await this.followRequestsRepository.insert({
id: this.idService.gen(),
followerId: follower.id,
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/web/views/note.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends ./base

block vars
- const user = note.user;
- const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`;
- const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`;
- const url = `${config.url}/notes/${note.id}`;
- const isRenote = note.renote && note.text == null && note.fileIds.length == 0 && note.poll == null;
- const images = (note.files || []).filter(file => file.type.startsWith('image/') && !file.isSensitive)
Expand All @@ -28,7 +28,7 @@ block og
// FIXME: add embed player for Twitter
if images.length
meta(property='twitter:card' content='summary_large_image')
each image in images
each image in images
meta(property='og:image' content= image.url)
else
meta(property='twitter:card' content='summary')
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/web/views/user.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends ./base

block vars
- const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`;
- const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`;
- const url = `${config.url}/@${(user.host ? `${user.username}@${user.host}` : user.username)}`;

block title
Expand Down
5 changes: 4 additions & 1 deletion packages/frontend/.storybook/fake-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import crypto from "node:crypto";
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

/**
* AIで生成した無作為なファーストネーム
Expand Down
44 changes: 24 additions & 20 deletions packages/frontend/src/boot/main-boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,31 @@ export async function mainBoot() {
mainRouter.push('/search');
},
};

if (defaultStore.state.enableSeasonalScreenEffect) {
const month = new Date().getMonth() + 1;
if (defaultStore.state.hemisphere === 'S') {
// ▼南半球
if (month === 7 || month === 8) {
const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect;
new SnowfallEffect({}).render();
}
} else {
// ▼北半球
if (month === 12 || month === 1) {
const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect;
new SnowfallEffect({}).render();
} else if (month === 3 || month === 4) {
const SakuraEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect;
new SakuraEffect({
sakura: true,
}).render();
try {
if (defaultStore.state.enableSeasonalScreenEffect) {
const month = new Date().getMonth() + 1;
if (defaultStore.state.hemisphere === 'S') {
// ▼南半球
if (month === 7 || month === 8) {
const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect;
new SnowfallEffect({}).render();
}
} else {
// ▼北半球
if (month === 12 || month === 1) {
const SnowfallEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect;
new SnowfallEffect({}).render();
} else if (month === 3 || month === 4) {
const SakuraEffect = (await import('@/scripts/snowfall-effect.js')).SnowfallEffect;
new SakuraEffect({
sakura: true,
}).render();
}
}
}
}
} catch (error) {
// console.error(error);
console.error('Failed to initialise the seasonal screen effect canvas context:', error);
}

if ($i) {
Expand Down
24 changes: 16 additions & 8 deletions packages/frontend/src/components/page/page.image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<div>
<MediaImage
v-if="image"
:image="image"
:disableImageLink="true"
/>
<div :class="$style.root">
<MkMediaList v-if="image" :mediaList="[image]" :class="$style.mediaList"/>
</div>
</template>

<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as Misskey from 'misskey-js';
import MediaImage from '@/components/MkMediaImage.vue';
import MkMediaList from '@/components/MkMediaList.vue';
const props = defineProps<{
block: Misskey.entities.PageBlock,
Expand All @@ -28,5 +24,17 @@ const image = ref<Misskey.entities.DriveFile | null>(null);
onMounted(() => {
image.value = props.page.attachedFiles.find(x => x.id === props.block.fileId) ?? null;
});
</script>

<style lang="scss" module>
.root {
border: 1px solid var(--divider);
border-radius: var(--radius);
overflow: hidden;
}
.mediaList {
// MkMediaList 内の上部マージン 4px
margin-top: -4px;
height: calc(100% + 4px);
}
</style>
13 changes: 10 additions & 3 deletions packages/frontend/src/components/page/page.note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<div style="margin: 1em 0;">
<MkNote v-if="note && !block.detailed" :key="note.id + ':normal'" v-model:note="note"/>
<MkNoteDetailed v-if="note && block.detailed" :key="note.id + ':detail'" v-model:note="note"/>
<div :class="$style.root">
<MkNote v-if="note && !block.detailed" :key="note.id + ':normal'" :note="note"/>
<MkNoteDetailed v-if="note && block.detailed" :key="note.id + ':detail'" :note="note"/>
</div>
</template>

Expand All @@ -32,3 +32,10 @@ onMounted(() => {
});
});
</script>

<style lang="scss" module>
.root {
border: 1px solid var(--divider);
border-radius: var(--radius);
}
</style>
8 changes: 7 additions & 1 deletion packages/frontend/src/components/page/page.text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<div class="_gaps">
<div class="_gaps" :class="$style.textRoot">
<Mfm :text="block.text ?? ''" :isNote="false"/>
<MkUrlPreview v-for="url in urls" :key="url" :url="url"/>
</div>
Expand All @@ -25,3 +25,9 @@ const props = defineProps<{
const urls = props.block.text ? extractUrlFromMfm(mfm.parse(props.block.text)) : [];
</script>
<style lang="scss" module>
.textRoot {
font-size: 1.1rem;
}
</style>
2 changes: 1 addition & 1 deletion packages/frontend/src/components/page/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<div :class="{ [$style.center]: page.alignCenter, [$style.serif]: page.font === 'serif' }" class="_gaps_s">
<div :class="{ [$style.center]: page.alignCenter, [$style.serif]: page.font === 'serif' }" class="_gaps">
<XBlock v-for="child in page.content" :key="child.id" :page="page" :block="child" :h="2"/>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<XContainer :draggable="true" @remove="() => $emit('remove')">
<template #header><i class="ti ti-note"></i> {{ i18n.ts._pages.blocks.note }}</template>

<section style="padding: 0 16px 0 16px;">
<section style="padding: 16px;" class="_gaps_s">
<MkInput v-model="id">
<template #label>{{ i18n.ts._pages.blocks._note.id }}</template>
<template #caption>{{ i18n.ts._pages.blocks._note.idDescription }}</template>
Expand Down
Loading

0 comments on commit 5c1bf06

Please sign in to comment.