Skip to content

Commit

Permalink
Merge remote-tracking branch 'cherry/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
caipira113 committed Oct 27, 2023
2 parents adf6299 + c640d2b commit 350f9e9
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 34 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE
- Fix: 외부 리소스 설치 페이지에서 페이지 캐시가 작동하는 문제 수정 (misskey-dev/misskey#12105)
- Fix: 채널 생성/업데이트 시 실패하면 아무 것도 표시되지 않는 문제 수정 misskey-dev/misskey#11983 (misskey-dev/misskey#12142)
- Fix: 유저 페이지의 미디어 타임라인에서 미디어가 없는 답글이 표시됨 #388
- Fix: 헤더의 액션 항목이 여러 개 일 때 왼쪽으로 타이틀이 치우치는 문제
- Fix: Friendly UI가 아닌 경우 헤더 디자인이 잘못 표시되는 문제
- 헤더의 액션 항목이 여러 개 일 때 왼쪽으로 타이틀이 치우칠 수 있음
- 특정 조건에서 헤더의 왼쪽에 여백이 발생할 수 있음
- 일부 페이지에서 잘못된 디자인이 표시됨
- 일부 페이지에서 액션 항목이 존재해도 버튼이 표시되지 않을 수 있음
- Fix: 네비게이션 메뉴의 하단 프로필 영역이 잘못된 디자인으로 표시됨

### Server
- Feat: 연합에서 노트 수정이 반영됨 (libnare/cp-castella#1)
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/core/activitypub/ApInboxService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,9 @@ export class ApInboxService {
const unlock = await this.appLockService.getApLock(uri);

try {
//const exist = await this.apNoteService.fetchNote(note);
//if (exist) return 'skip: note exists';
await this.apNoteService.updateNote(note, resolver, silent);
const target = await this.notesRepository.findOneBy({uri: uri});

Check failure on line 827 in packages/backend/src/core/activitypub/ApInboxService.ts

View workflow job for this annotation

GitHub Actions / lint (backend)

A space is required after '{'

Check failure on line 827 in packages/backend/src/core/activitypub/ApInboxService.ts

View workflow job for this annotation

GitHub Actions / lint (backend)

A space is required before '}'
if (!target) return `skip: target note not located: ${uri}`;
await this.apNoteService.updateNote(note, target, resolver, silent);
return 'ok';
} catch (err) {
if (err instanceof StatusError && err.isClientError) {
Expand Down
11 changes: 2 additions & 9 deletions packages/backend/src/core/activitypub/models/ApNoteService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export class ApNoteService {
}

@bindThis
public async updateNote(value: string | IObject, resolver?: Resolver, silent = false): Promise<MiNote | null> {
public async updateNote(value: string | IObject, target: MiNote, resolver?: Resolver, silent = false): Promise<MiNote | null> {
if (resolver == null) resolver = this.apResolverService.createResolver();

const object = await resolver.resolve(value);
Expand Down Expand Up @@ -365,13 +365,6 @@ export class ApNoteService {
throw new Error('actor has been suspended');
}

const b_note = await this.notesRepository.findOneBy({
uri: entryUri
}).then(x => {
if (x == null) throw new Error('note not found');
return x;
});

const limit = promiseLimit<MiDriveFile>(2);
const files = (await Promise.all(toArray(note.attachment).map(attach => (
limit(() => this.apImageService.resolveImage(actor, {
Expand Down Expand Up @@ -413,7 +406,7 @@ export class ApNoteService {
apHashtags,
apEmojis,
poll,
}, b_note, silent);
}, target, silent);
} catch (err: any) {
this.logger.warn(`note update failed: ${err}`);
return err;
Expand Down
9 changes: 8 additions & 1 deletion packages/frontend/src/components/MkTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ const connectChannel = () => {
connection = stream.useChannel('antenna', {
antennaId: props.antenna,
});
connection.on('note', prepend);
} else if (props.src === 'home') {
connection = stream.useChannel('homeTimeline', {
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
withCats: props.onlyCats,
});
connection.on('note', prepend);
connection2 = stream.useChannel('main');
tlIcon = 'ti ti-home';
tlHint = i18n.ts._tlTutorial.step1_1;
Expand All @@ -117,6 +119,7 @@ const connectChannel = () => {
withFiles: props.onlyFiles ? true : undefined,
withCats: props.onlyCats,
});
connection.on('note', prepend);
tlIcon = 'ti ti-planet';
tlHint = i18n.ts._tlTutorial.step1_2;
tlHintClosed = defaultStore.state.tlLocalHintClosed;
Expand All @@ -127,6 +130,7 @@ const connectChannel = () => {
withFiles: props.onlyFiles ? true : undefined,
withCats: props.onlyCats,
});
connection.on('note', prepend);
tlIcon = 'ti ti-universe';
tlHint = i18n.ts._tlTutorial.step1_3;
tlHintClosed = defaultStore.state.tlSocialHintClosed;
Expand All @@ -136,6 +140,7 @@ const connectChannel = () => {
withFiles: props.onlyFiles ? true : undefined,
withCats: props.onlyCats,
});
connection.on('note', prepend);
tlIcon = 'ti ti-world';
tlHint = i18n.ts._tlTutorial.step1_4;
tlHintClosed = defaultStore.state.tlGlobalHintClosed;
Expand All @@ -156,16 +161,18 @@ const connectChannel = () => {
withCats: props.onlyCats,
listId: props.list,
});
connection.on('note', prepend);
} else if (props.src === 'channel') {
connection = stream.useChannel('channel', {
channelId: props.channel,
});
connection.on('note', prepend);
} else if (props.src === 'role') {
connection = stream.useChannel('roleTimeline', {
roleId: props.role,
});
connection.on('note', prepend);
}
if (props.src !== 'directs' || props.src !== 'mentions') connection.on('note', prepend);
};

if (props.src === 'antenna') {
Expand Down
7 changes: 3 additions & 4 deletions packages/frontend/src/components/global/CPPageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</template>
<div v-if="!thin_ && !narrow && (actions && actions.length > 0) && hideTitle && ['index'].includes(<string>mainRouter.currentRoute.value.name)" :class="$style.buttonsRight"/>
<div v-else-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight">
<div v-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight">
<template v-for="action in actions">
<button v-vibrate="ColdDeviceStorage.get('vibrateSystem') ? 5 : ''" v-tooltip.noDelay="action.text" class="_button" :class="[$style.button, { [$style.highlighted]: action.highlighted }]" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
</template>
</div>
<div v-else-if="!thin_ && !canBack && !(actions && actions.length > 0)" :class="$style.buttonsRight"/>
<div v-if="metadata && metadata.avatar && showFollowButton" :class="$style.followButton">
<MkFollowButton v-if="narrow && mainRouter.currentRoute.value.name === 'user'" :user="metadata.avatar" :transparent="false" :full="false"/>
<MkFollowButton v-else-if="mainRouter.currentRoute.value.name === 'user'" :user="metadata.avatar" :transparent="false" :full="true"/>
<MkFollowButton v-if="mainRouter.currentRoute.value.name === 'user'" :user="metadata.avatar" :transparent="false" :full="!narrow"/>
</div>
</div>
</template>
Expand Down Expand Up @@ -104,7 +103,7 @@ const emit = defineEmits<{

const metadata = injectPageMetadata();

const hideTitle = inject('shouldOmitHeaderTitle', false);
const hideTitle = false;
const thin_ = props.thin || inject('shouldHeaderThin', false);

let el = $shallowRef<HTMLElement | undefined>(undefined);
Expand Down
14 changes: 6 additions & 8 deletions packages/frontend/src/components/global/MkPageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkAvatar v-vibrate="ColdDeviceStorage.get('vibrateSystem') ? 5 : ''" :class="$style.avatar" :user="$i"/>
</div>
<div v-else-if="!thin_ && narrow && !hideTitle && canBack" :class="$style.buttonsLeft"/>
<div v-else-if="!thin_ && canBack && (actions && actions.length > 0)" :class="$style.buttonsLeft"/>
<div v-if="!thin_ && canBack && (actions && actions.length === 2 && ['index', 'my-notifications', 'messaging'].includes(<string>mainRouter.currentRoute.value.name))" :class="$style.buttonsLeft"/>
<div v-if="!thin_ && !narrow && canBack && (actions && actions.length === 2 && mainRouter.currentRoute.value.name === 'index')" :class="$style.buttonsLeft"/>
<div v-if="!thin_ && !narrow && canBack && (actions && actions.length === 2 && mainRouter.currentRoute.value.name === 'index')" :class="$style.buttonsLeft" style="margin-right: auto;"/>

<template v-if="metadata">
<div v-if="!hideTitle" :class="[$style.titleContainer, { [$style.titleContainer_canBack]: !canBack }]" @click="top">
Expand All @@ -34,15 +34,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<XTabs v-if="(!narrow || hideTitle) && !isFriendly" :class="[$style.tabs, { [$style.tabs_canBack]: !canBack }]" :tab="tab" :tabs="tabs" :rootEl="el" @update:tab="key => emit('update:tab', key)" @tabClick="onTabClick"/>
</template>
<div v-if="!thin_ && !narrow && (actions && actions.length > 0) && hideTitle && ['index'].includes(<string>mainRouter.currentRoute.value.name)" :class="$style.buttonsRight"/>
<div v-else-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight">
<div v-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight">
<template v-for="action in actions">
<button v-vibrate="ColdDeviceStorage.get('vibrateSystem') ? 5 : ''" v-tooltip.noDelay="action.text" class="_button" :class="[$style.button, { [$style.highlighted]: action.highlighted }]" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
</template>
</div>
<div v-else-if="!thin_ && !canBack && !(actions && actions.length > 0)" :class="$style.buttonsRight"/>
<div v-if="metadata && metadata.avatar && showFollowButton" :class="$style.followButton">
<MkFollowButton v-if="narrow && mainRouter.currentRoute.value.name === 'user'" :user="metadata.avatar" :transparent="false" :full="false"/>
<MkFollowButton v-else-if="mainRouter.currentRoute.value.name === 'user'" :user="metadata.avatar" :transparent="false" :full="true"/>
<MkFollowButton v-if="mainRouter.currentRoute.value.name === 'user'" :user="metadata.avatar" :transparent="false" :full="!narrow"/>
</div>
</div>
<div v-if="((narrow && !hideTitle) || isFriendly) && hasTabs" :class="[$style.lower, { [$style.slim]: narrow && !isFriendly, [$style.thin]: thin_ }]">
Expand All @@ -52,7 +51,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>

<script lang="ts" setup>
import { onMounted, onUnmounted, ref, inject, defineAsyncComponent } from 'vue';
import { onMounted, onUnmounted, ref, inject } from 'vue';
import tinycolor from 'tinycolor2';
import XTabs, { Tab } from './MkPageHeader.tabs.vue';
import { getScrollPosition, scrollToTop } from '@/scripts/scroll.js';
Expand Down Expand Up @@ -206,7 +205,6 @@ onUnmounted(() => {
}

.tabs_canBack {
margin-left: auto;
padding: 0 12px;
}

Expand Down Expand Up @@ -325,7 +323,7 @@ onUnmounted(() => {
}

.titleContainer_canBack {
margin-left: -32px;
margin-left: -16px;
}

.titleAvatarContainer {
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/pages/settings/cherrypick.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const enableLongPressOpenAccountMenu = computed(defaultStore.makeGetterSetter('e

watch([
reactableRemoteReactionEnabled,
mobileHeaderChange,
renameTheButtonInPostFormToNya,
friendlyEnableNotifications,
friendlyEnableWidgets,
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/pages/timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ import { unisonReload } from '@/scripts/unison-reload.js';
let showEl = $ref(false);
const isFriendly = ref(miLocalStorage.getItem('ui') === 'friendly');

if (!isFriendly.value && !defaultStore.state.mobileHeaderChange) provide('shouldOmitHeaderTitle', true);

const MOBILE_THRESHOLD = 500;

const isMobile = ref(deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD);
window.addEventListener('resize', () => {
isMobile.value = deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD;
});

if (!isFriendly.value) provide('shouldOmitHeaderTitle', true);

const XTutorial = defineAsyncComponent(() => import('./timeline.tutorial.vue'));

const isLocalTimelineAvailable = ($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable);
Expand Down
19 changes: 13 additions & 6 deletions packages/frontend/src/ui/_common_/navbar-for-mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<button v-vibrate="ColdDeviceStorage.get('vibrateSystem') ? 5 : ''" class="_button" :class="$style.post" data-cy-open-post-form @click="os.post">
<i :class="[$style.postIcon, defaultStore.state.renameTheButtonInPostFormToNya ? 'ti-paw-filled' : 'ti-pencil']" class="ti ti-fw"></i><span style="position: relative;">{{ defaultStore.state.renameTheButtonInPostFormToNya ? i18n.ts.nya : i18n.ts.note }}</span>
</button>
<button v-vibrate="ColdDeviceStorage.get('vibrateSystem') ? 5 : ''" class="_button" :class="$style.account" @click="openAccountMenu">
<MkAvatar :user="$i" :class="$style.avatar"/><MkAcct :class="$style.acct" class="_nowrap" :user="$i"/>
</button>
<div :class="$style.profile">
<button v-vibrate="ColdDeviceStorage.get('vibrateSystem') ? 5 : ''" class="_button" :class="$style.account" @click="openAccountMenu">
<MkAvatar :user="$i" :class="$style.avatar"/><MkAcct :class="$style.acct" class="_nowrap" :user="$i"/>
</button>
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -108,6 +110,7 @@ function more() {
.root {
display: flex;
flex-direction: column;
height: 100%;
}

.top {
Expand Down Expand Up @@ -159,7 +162,7 @@ function more() {
.bottom {
position: sticky;
bottom: 0;
padding: 20px 0;
padding: 20px 0 calc(env(safe-area-inset-bottom) + 25px);
background: var(--X14);
-webkit-backdrop-filter: var(--blur, blur(8px));
backdrop-filter: var(--blur, blur(8px));
Expand Down Expand Up @@ -204,6 +207,11 @@ function more() {
width: 32px;
}

.profile {
display: flex;
margin-top: 16px;
}

.account {
position: relative;
display: flex;
Expand All @@ -213,7 +221,6 @@ function more() {
width: 100%;
text-align: left;
box-sizing: border-box;
margin-top: 16px;
}

.avatar {
Expand Down Expand Up @@ -293,7 +300,7 @@ function more() {
top: 0;
left: 20px;
color: var(--navIndicator);
font-size: 8px;
font-size: 6px;
animation: blink 1s infinite;

&:has(.itemIndicateValueIcon) {
Expand Down

0 comments on commit 350f9e9

Please sign in to comment.