From dc0e55bf160ae2329da56ffb6686f699fd4b6444 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 21 Dec 2021 00:20:30 +0900 Subject: [PATCH 01/33] wip (#8077) --- locales/ja-JP.yml | 1 + packages/client/src/components/ui/modal.vue | 3 ++- packages/client/src/pages/settings/general.vue | 2 ++ packages/client/src/store.ts | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 72c20819e3..c9ba485e3a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -448,6 +448,7 @@ uiLanguage: "UIの表示言語" groupInvited: "グループに招待されました" aboutX: "{x}について" useOsNativeEmojis: "OSネイティブの絵文字を使用" +disableDrawer: "メニューをドロワーで表示しない" youHaveNoGroups: "グループがありません" joinOrCreateGroup: "既存のグループに招待してもらうか、新しくグループを作成してください。" noHistory: "履歴はありません" diff --git a/packages/client/src/components/ui/modal.vue b/packages/client/src/components/ui/modal.vue index b09d04c450..3e2e59b27c 100644 --- a/packages/client/src/components/ui/modal.vue +++ b/packages/client/src/components/ui/modal.vue @@ -13,6 +13,7 @@ import { defineComponent, nextTick, onMounted, computed, PropType, ref, watch } from 'vue'; import * as os from '@/os'; import { isTouchUsing } from '@/scripts/touch'; +import { defaultStore } from '@/store'; function getFixedContainer(el: Element | null): Element | null { if (el == null || el.tagName === 'BODY') return null; @@ -77,7 +78,7 @@ export default defineComponent({ const zIndex = os.claimZIndex(props.zPriority); const type = computed(() => { if (props.preferType === 'auto') { - if (isTouchUsing && window.innerWidth < 500 && window.innerHeight < 1000) { + if (!defaultStore.state.disableDrawer && isTouchUsing && window.innerWidth < 500 && window.innerHeight < 1000) { return 'drawer'; } else { return props.src != null ? 'popup' : 'dialog'; diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 57a4b25574..83924382d8 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -43,6 +43,7 @@ {{ $ts.useOsNativeEmojis }}
+ {{ $ts.disableDrawer }} @@ -140,6 +141,7 @@ export default defineComponent({ showGapBetweenNotesInTimeline: defaultStore.makeGetterSetter('showGapBetweenNotesInTimeline'), disableAnimatedMfm: defaultStore.makeGetterSetter('animatedMfm', v => !v, v => !v), useOsNativeEmojis: defaultStore.makeGetterSetter('useOsNativeEmojis'), + disableDrawer: defaultStore.makeGetterSetter('disableDrawer'), disableShowingAnimatedImages: defaultStore.makeGetterSetter('disableShowingAnimatedImages'), loadRawImages: defaultStore.makeGetterSetter('loadRawImages'), imageNewTab: defaultStore.makeGetterSetter('imageNewTab'), diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 2290a21778..19d46bacea 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -138,6 +138,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: false }, + disableDrawer: { + where: 'device', + default: false + }, useBlurEffectForModal: { where: 'device', default: true From 35b7ce1a96c5889168e8fe1a538ee6b7de8181e0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 22 Dec 2021 22:38:42 +0900 Subject: [PATCH 02/33] =?UTF-8?q?enhance(client):=20=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=81=AE=E8=AA=8D?= =?UTF-8?q?=E8=A8=BC=E3=81=AB=E3=82=AF=E3=83=AA=E3=83=83=E3=82=AF=E5=BF=85?= =?UTF-8?q?=E9=A0=88=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 1 + packages/client/src/pages/signup-complete.vue | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 72c20819e3..5e112ea323 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -818,6 +818,7 @@ leaveGroup: "グループから抜ける" leaveGroupConfirm: "「{name}」から抜けますか?" useDrawerReactionPickerForMobile: "モバイルデバイスのときドロワーで表示" welcomeBackWithName: "おかえりなさい、{name}さん" +clickToFinishEmailVerification: "[{ok}]を押して、メールアドレスの確認を完了してください。" _emailUnavailable: used: "既に使用されています" diff --git a/packages/client/src/pages/signup-complete.vue b/packages/client/src/pages/signup-complete.vue index 3bbc9938dd..89375e05d2 100644 --- a/packages/client/src/pages/signup-complete.vue +++ b/packages/client/src/pages/signup-complete.vue @@ -31,12 +31,15 @@ export default defineComponent({ } }, - mounted() { - os.apiWithDialog('signup-pending', { - code: this.code, - }).then(res => { - login(res.i, '/'); + async mounted() { + await os.alert({ + type: 'info', + text: this.$t('clickToFinishEmailVerification', { ok: this.$ts.gotIt }), }); + const res = await os.apiWithDialog('signup-pending', { + code: this.code, + }); + login(res.i, '/'); }, methods: { From cc441258dbf8c60786c6eb6c70f9b8a45622037f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 23 Dec 2021 16:10:13 +0900 Subject: [PATCH 03/33] enhance(client): tweak channel pages --- .../client/src/components/ui/pagination.vue | 7 +- packages/client/src/pages/channel-editor.vue | 34 ++++----- packages/client/src/pages/channel.vue | 58 ++++++++------ packages/client/src/pages/channels.vue | 75 ++++++++++--------- 4 files changed, 97 insertions(+), 77 deletions(-) diff --git a/packages/client/src/components/ui/pagination.vue b/packages/client/src/components/ui/pagination.vue index 00200efd3c..64af4a54f7 100644 --- a/packages/client/src/components/ui/pagination.vue +++ b/packages/client/src/components/ui/pagination.vue @@ -5,7 +5,12 @@
- + +
+ +
{{ $ts.nothing }}
+
+
diff --git a/packages/client/src/pages/channel-editor.vue b/packages/client/src/pages/channel-editor.vue index 67b839bc3d..58c644be62 100644 --- a/packages/client/src/pages/channel-editor.vue +++ b/packages/client/src/pages/channel-editor.vue @@ -1,28 +1,26 @@ diff --git a/packages/client/src/pages/channels.vue b/packages/client/src/pages/channels.vue index a08c273279..3bc62b5b56 100644 --- a/packages/client/src/pages/channels.vue +++ b/packages/client/src/pages/channels.vue @@ -1,58 +1,63 @@ diff --git a/packages/client/src/pages/channels.vue b/packages/client/src/pages/channels.vue index 3bc62b5b56..48877ab3ec 100644 --- a/packages/client/src/pages/channels.vue +++ b/packages/client/src/pages/channels.vue @@ -39,7 +39,7 @@ export default defineComponent({ actions: [{ icon: 'fas fa-plus', text: this.$ts.create, - handler: this.create + handler: this.create, }], tabs: [{ active: this.tab === 'featured', diff --git a/packages/client/src/scripts/use-tooltip.ts b/packages/client/src/scripts/use-tooltip.ts index 0df4baca7b..d0c6756eb1 100644 --- a/packages/client/src/scripts/use-tooltip.ts +++ b/packages/client/src/scripts/use-tooltip.ts @@ -18,6 +18,9 @@ export function useTooltip( const open = () => { close(); if (!isHovering) return; + if (elRef.value == null) return; + const el = elRef.value instanceof Element ? elRef.value : elRef.value.$el; + if (!document.body.contains(el)) return; // openしようとしたときに既に元要素がDOMから消えている場合があるため const showing = ref(true); onShow(showing); From 2e80f9dfba1e82b8b649c127138c2553f5cdf760 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 23 Dec 2021 17:05:50 +0900 Subject: [PATCH 05/33] clean up --- locales/ja-JP.yml | 1 - packages/client/src/components/global/a.vue | 5 ----- packages/client/src/pages/settings/general.vue | 8 -------- packages/client/src/store.ts | 1 - 4 files changed, 15 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f85e8f3e00..62aade568d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -614,7 +614,6 @@ regenerateLoginToken: "ログイントークンを再生成" regenerateLoginTokenDescription: "ログインに使用される内部トークンを再生成します。通常この操作を行う必要はありません。再生成すると、全てのデバイスでログアウトされます。" setMultipleBySeparatingWithSpace: "スペースで区切って複数設定できます。" fileIdOrUrl: "ファイルIDまたはURL" -chatOpenBehavior: "チャットを開くときの動作" behavior: "動作" sample: "サンプル" abuseReports: "通報" diff --git a/packages/client/src/components/global/a.vue b/packages/client/src/components/global/a.vue index 5db61203c6..77ee7525a4 100644 --- a/packages/client/src/components/global/a.vue +++ b/packages/client/src/components/global/a.vue @@ -106,11 +106,6 @@ export default defineComponent({ return; } - if (this.to.startsWith('/my/messaging')) { - if (ColdDeviceStorage.get('chatOpenBehavior') === 'window') return this.window(); - if (ColdDeviceStorage.get('chatOpenBehavior') === 'popout') return this.popout(); - } - if (this.behavior) { if (this.behavior === 'window') { return this.window(); diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 83924382d8..734bc78442 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -77,13 +77,6 @@ {{ $ts.openInSideView }} - - - - - - - {{ $ts.deck }} {{ $ts.customCss }} @@ -149,7 +142,6 @@ export default defineComponent({ disablePagesScript: defaultStore.makeGetterSetter('disablePagesScript'), showFixedPostForm: defaultStore.makeGetterSetter('showFixedPostForm'), defaultSideView: defaultStore.makeGetterSetter('defaultSideView'), - chatOpenBehavior: ColdDeviceStorage.makeGetterSetter('chatOpenBehavior'), instanceTicker: defaultStore.makeGetterSetter('instanceTicker'), enableInfiniteScroll: defaultStore.makeGetterSetter('enableInfiniteScroll'), useReactionPickerForContextMenu: defaultStore.makeGetterSetter('useReactionPickerForContextMenu'), diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 19d46bacea..dc9c3b7b9e 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -245,7 +245,6 @@ export class ColdDeviceStorage { lightTheme: require('@/themes/l-light.json5') as Theme, darkTheme: require('@/themes/d-dark.json5') as Theme, syncDeviceDarkMode: true, - chatOpenBehavior: 'page' as 'page' | 'window' | 'popout', plugins: [] as Plugin[], mediaVolume: 0.5, sound_masterVolume: 0.3, From 99ced12ac5c7ef5d4f835cdf054abdd55f888b5a Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 Dec 2021 01:07:04 +0900 Subject: [PATCH 06/33] fix(client): fix zindex issue Fix #8086 --- CHANGELOG.md | 7 +++++++ packages/client/src/components/media-list.vue | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e15c6d6463..743479ae4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ --> +## 12.x.x (unreleased) + +### Improvements + +### Bugfixes +- クライアント: 一部のコンポーネントが裏に隠れるのを修正 + ## 12.100.2 (2021/12/18) ### Bugfixes diff --git a/packages/client/src/components/media-list.vue b/packages/client/src/components/media-list.vue index c987ff5ff1..2970d06c97 100644 --- a/packages/client/src/components/media-list.vue +++ b/packages/client/src/components/media-list.vue @@ -105,6 +105,7 @@ export default defineComponent({ return { previewable, gallery, + pswpZIndex: os.claimZIndex('middle'), }; }, }); @@ -188,3 +189,11 @@ export default defineComponent({ } } + + From 1122f7281ec9b95205f4ee8aa8462daae98ebbed Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 24 Dec 2021 01:16:58 +0900 Subject: [PATCH 07/33] =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=A7Renote=E3=81=A7=E3=81=82=E3=82=8B?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=ABnoindex=E3=82=92=E4=BB=98=E5=8A=A0?= =?UTF-8?q?=20(#8074)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/web/views/note.pug | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/web/views/note.pug b/packages/backend/src/server/web/views/note.pug index 7030936975..fce91bdabe 100644 --- a/packages/backend/src/server/web/views/note.pug +++ b/packages/backend/src/server/web/views/note.pug @@ -4,6 +4,7 @@ block vars - const user = note.user; - const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`; - const url = `${config.url}/notes/${note.id}`; + - const isRenote = note.renote && note.text == null && note.fileIds.length == 0 && note.poll == null; block title = `${title} | ${instanceName}` @@ -19,7 +20,7 @@ block og meta(property='og:image' content= user.avatarUrl) block meta - if user.host || profile.noCrawle + if user.host || isRenote || profile.noCrawle meta(name='robots' content='noindex') meta(name='misskey:user-username' content=user.username) From 2294e9ffdce9091a412cb3a4e1b04e5056c013e6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 Dec 2021 01:31:37 +0900 Subject: [PATCH 08/33] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe3df853b7..633995c947 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,7 @@ Configuration files are located in [`/.github/workflows`](/.github/workflows). ## Vue Misskey uses Vue(v3) as its front-end framework. -**When creating a new component, please use the Composition API instead of the Options API.** +**When creating a new component, please use the Composition API (and [setup sugar](https://v3.vuejs.org/api/sfc-script-setup.html)) instead of the Options API.** Some of the existing components are implemented in the Options API, but it is an old implementation. Refactors that migrate those components to the Composition API are also welcome. ## Adding MisskeyRoom items From b4636631751449da34e2bad7e7276546c6fd3967 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 Dec 2021 12:34:24 +0900 Subject: [PATCH 09/33] enhance(client): tweak ui --- .../client/src/components/page-window.vue | 26 ++++++++++++++++++- packages/client/src/components/ui/window.vue | 5 +++- packages/client/src/scripts/use-tooltip.ts | 7 ++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/page-window.vue b/packages/client/src/components/page-window.vue index 39c185b3e0..ec7451d5aa 100644 --- a/packages/client/src/components/page-window.vue +++ b/packages/client/src/components/page-window.vue @@ -16,7 +16,13 @@ -
+ + +
@@ -33,6 +39,7 @@ import copyToClipboard from '@/scripts/copy-to-clipboard'; import { resolve } from '@/router'; import { url } from '@/config'; import * as symbols from '@/symbols'; +import * as os from '@/os'; export default defineComponent({ components: { @@ -139,6 +146,23 @@ export default defineComponent({ this.props = props; }, + menu(ev) { + os.popupMenu([{ + icon: 'fas fa-external-link-alt', + text: this.$ts.openInNewTab, + action: () => { + window.open(this.url, '_blank'); + this.$refs.window.close(); + } + }, { + icon: 'fas fa-link', + text: this.$ts.copyLink, + action: () => { + copyToClipboard(this.url); + } + }], ev.currentTarget || ev.target); + }, + back() { this.navigate(this.history.pop(), false); }, diff --git a/packages/client/src/components/ui/window.vue b/packages/client/src/components/ui/window.vue index d01498d8df..bd33289ccc 100644 --- a/packages/client/src/components/ui/window.vue +++ b/packages/client/src/components/ui/window.vue @@ -414,6 +414,10 @@ export default defineComponent({ } } + > .left { + min-width: 16px; + } + > .title { flex: 1; position: relative; @@ -421,7 +425,6 @@ export default defineComponent({ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - text-align: center; cursor: move; } } diff --git a/packages/client/src/scripts/use-tooltip.ts b/packages/client/src/scripts/use-tooltip.ts index d0c6756eb1..bc8f27a038 100644 --- a/packages/client/src/scripts/use-tooltip.ts +++ b/packages/client/src/scripts/use-tooltip.ts @@ -1,4 +1,4 @@ -import { Ref, ref, watch } from 'vue'; +import { Ref, ref, watch, onUnmounted } from 'vue'; export function useTooltip( elRef: Ref, @@ -72,9 +72,14 @@ export function useTooltip( el.addEventListener('mouseleave', onMouseleave, { passive: true }); el.addEventListener('touchstart', onTouchstart, { passive: true }); el.addEventListener('touchend', onTouchend, { passive: true }); + el.addEventListener('click', close, { passive: true }); } }, { immediate: true, flush: 'post', }); + + onUnmounted(() => { + close(); + }); } From 8e7744a69582a05f43944d0db01ec4064988eca8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 Dec 2021 23:25:23 +0900 Subject: [PATCH 10/33] =?UTF-8?q?fix(client):=20=E3=83=89=E3=83=AD?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=A7?= =?UTF-8?q?=E3=82=BB=E3=83=BC=E3=83=95=E3=82=A8=E3=83=AA=E3=82=A2=E3=82=92?= =?UTF-8?q?=E8=80=83=E6=85=AE=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/components/ui/menu.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/ui/menu.vue b/packages/client/src/components/ui/menu.vue index 869709cf21..6f3f277b11 100644 --- a/packages/client/src/components/ui/menu.vue +++ b/packages/client/src/components/ui/menu.vue @@ -284,7 +284,7 @@ export default defineComponent({ } &.asDrawer { - padding: 12px 0; + padding: 12px 0 calc(env(safe-area-inset-bottom, 0px) + 12px) 0; width: 100%; > .item { From c77fe1f2cf5da7c111e9008d869c702644075d44 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 25 Dec 2021 02:01:35 +0900 Subject: [PATCH 11/33] Truncate push notification message (#8089) * Truncate push notification message * fix --- .../backend/src/services/push-notification.ts | 27 ++++++++++++++++++- .../client/src/sw/compose-notification.ts | 13 +++++---- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/services/push-notification.ts b/packages/backend/src/services/push-notification.ts index 616bc74411..2133768a96 100644 --- a/packages/backend/src/services/push-notification.ts +++ b/packages/backend/src/services/push-notification.ts @@ -3,10 +3,33 @@ import config from '@/config/index'; import { SwSubscriptions } from '@/models/index'; import { fetchMeta } from '@/misc/fetch-meta'; import { Packed } from '@/misc/schema'; +import { getNoteSummary } from '@/misc/get-note-summary'; type notificationType = 'notification' | 'unreadMessagingMessage'; type notificationBody = Packed<'Notification'> | Packed<'MessagingMessage'>; +// プッシュメッセージサーバーには文字数制限があるため、内容を削減します +function truncateNotification(notification: Packed<'Notification'>): any { + if (notification.note) { + return { + ...notification, + note: { + ...notification.note, + // textをgetNoteSummaryしたものに置き換える + text: getNoteSummary(notification.type === 'renote' ? notification.note.renote as Packed<'Note'> : notification.note), + ...{ + cw: undefined, + reply: undefined, + renote: undefined, + user: undefined as any, // 通知を受け取ったユーザーである場合が多いのでこれも捨てる + } + } + }; + } + + return notification; +} + export default async function(userId: string, type: notificationType, body: notificationBody) { const meta = await fetchMeta(); @@ -32,7 +55,9 @@ export default async function(userId: string, type: notificationType, body: noti }; push.sendNotification(pushSubscription, JSON.stringify({ - type, body, + type, + body: type === 'notification' ? truncateNotification(body as Packed<'Notification'>) : body, + userId, }), { proxy: config.proxy, }).catch((err: any) => { diff --git a/packages/client/src/sw/compose-notification.ts b/packages/client/src/sw/compose-notification.ts index 0aed9610ea..10bd27c9ec 100644 --- a/packages/client/src/sw/compose-notification.ts +++ b/packages/client/src/sw/compose-notification.ts @@ -3,7 +3,6 @@ */ declare var self: ServiceWorkerGlobalScope; -import { getNoteSummary } from '@/scripts/get-note-summary'; import * as misskey from 'misskey-js'; function getUserName(user: misskey.entities.User): string { @@ -26,37 +25,37 @@ export default async function(type, data, i18n): Promise<[string, NotificationOp switch (data.type) { case 'mention': return [i18n.t('_notification.youGotMention', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), + body: data.note.text, icon: data.user.avatarUrl }]; case 'reply': return [i18n.t('_notification.youGotReply', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), + body: data.note.text, icon: data.user.avatarUrl }]; case 'renote': return [i18n.t('_notification.youRenoted', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), + body: data.note.text, icon: data.user.avatarUrl }]; case 'quote': return [i18n.t('_notification.youGotQuote', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), + body: data.note.text, icon: data.user.avatarUrl }]; case 'reaction': return [`${data.reaction} ${getUserName(data.user)}`, { - body: getNoteSummary(data.note, i18n.locale), + body: data.note.text, icon: data.user.avatarUrl }]; case 'pollVote': return [i18n.t('_notification.youGotPoll', { name: getUserName(data.user) }), { - body: getNoteSummary(data.note, i18n.locale), + body: data.note.text, icon: data.user.avatarUrl }]; From 601bc3e3ccf2ba692b1354decd2096b501b0dd92 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 25 Dec 2021 13:38:53 +0900 Subject: [PATCH 12/33] clean up --- packages/client/src/pages/admin/file-dialog.vue | 3 --- packages/client/src/pages/antenna-timeline.vue | 11 ----------- packages/client/src/pages/favorites.vue | 13 +------------ packages/client/src/pages/featured.vue | 13 +------------ packages/client/src/pages/mentions.vue | 13 +------------ packages/client/src/pages/messages.vue | 13 +------------ packages/client/src/pages/my-groups/group.vue | 3 --- packages/client/src/pages/my-lists/list.vue | 3 --- packages/client/src/pages/notifications.vue | 11 +---------- packages/client/src/pages/search.vue | 13 +------------ packages/client/src/pages/tag.vue | 13 +------------ packages/client/src/pages/timeline.vue | 11 ----------- packages/client/src/pages/user-list-timeline.vue | 11 ----------- packages/client/src/pages/user/index.vue | 4 ---- packages/client/src/scripts/loading.ts | 11 ----------- packages/client/src/ui/deck/direct-column.vue | 11 ----------- packages/client/src/ui/deck/mentions-column.vue | 11 ----------- 17 files changed, 7 insertions(+), 161 deletions(-) delete mode 100644 packages/client/src/scripts/loading.ts diff --git a/packages/client/src/pages/admin/file-dialog.vue b/packages/client/src/pages/admin/file-dialog.vue index f0774b2946..4c33f62399 100644 --- a/packages/client/src/pages/admin/file-dialog.vue +++ b/packages/client/src/pages/admin/file-dialog.vue @@ -40,7 +40,6 @@ import MkButton from '@/components/ui/button.vue'; import MkSwitch from '@/components/form/switch.vue'; import XModalWindow from '@/components/ui/modal-window.vue'; import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue'; -import Progress from '@/scripts/loading'; import bytes from '@/filters/bytes'; import * as os from '@/os'; @@ -74,11 +73,9 @@ export default defineComponent({ methods: { async fetch() { - Progress.start(); this.file = await os.api('drive/files/show', { fileId: this.fileId }); this.info = await os.api('admin/drive/show-file', { fileId: this.fileId }); this.isSensitive = this.file.isSensitive; - Progress.done(); }, showUser() { diff --git a/packages/client/src/pages/antenna-timeline.vue b/packages/client/src/pages/antenna-timeline.vue index 2738208c9d..c38f285725 100644 --- a/packages/client/src/pages/antenna-timeline.vue +++ b/packages/client/src/pages/antenna-timeline.vue @@ -7,8 +7,6 @@ src="antenna" :antenna="antennaId" :sound="true" - @before="before()" - @after="after()" @queue="queueUpdated" />
@@ -17,7 +15,6 @@ diff --git a/packages/client/src/pages/featured.vue b/packages/client/src/pages/featured.vue index f5edf25594..0844c0952f 100644 --- a/packages/client/src/pages/featured.vue +++ b/packages/client/src/pages/featured.vue @@ -1,12 +1,11 @@ diff --git a/packages/client/src/pages/mentions.vue b/packages/client/src/pages/mentions.vue index cd9c6a8fdf..691d3bd9aa 100644 --- a/packages/client/src/pages/mentions.vue +++ b/packages/client/src/pages/mentions.vue @@ -1,12 +1,11 @@ diff --git a/packages/client/src/pages/messages.vue b/packages/client/src/pages/messages.vue index 9fde0bc7d5..9085af9489 100644 --- a/packages/client/src/pages/messages.vue +++ b/packages/client/src/pages/messages.vue @@ -1,12 +1,11 @@ diff --git a/packages/client/src/pages/my-groups/group.vue b/packages/client/src/pages/my-groups/group.vue index 89c8659b4f..c307f037a6 100644 --- a/packages/client/src/pages/my-groups/group.vue +++ b/packages/client/src/pages/my-groups/group.vue @@ -35,7 +35,6 @@ diff --git a/packages/client/src/pages/tag.vue b/packages/client/src/pages/tag.vue index f4709659e3..a0c8367849 100644 --- a/packages/client/src/pages/tag.vue +++ b/packages/client/src/pages/tag.vue @@ -1,12 +1,11 @@ diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 494932c602..216b3c34ea 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -10,8 +10,6 @@ class="tl" :src="src" :sound="true" - @before="before()" - @after="after()" @queue="queueUpdated" />
@@ -21,7 +19,6 @@ diff --git a/packages/client/src/ui/deck/mentions-column.vue b/packages/client/src/ui/deck/mentions-column.vue index 7dd06989cb..4b8dc0c4ee 100644 --- a/packages/client/src/ui/deck/mentions-column.vue +++ b/packages/client/src/ui/deck/mentions-column.vue @@ -8,7 +8,6 @@ From b05cfe4a840f2a98ad81d1705ce7e9682c4d3b5e Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 25 Dec 2021 15:49:37 +0900 Subject: [PATCH 13/33] enhance(client): improve note preview Fix #8029 --- CHANGELOG.md | 1 + packages/client/src/components/note-preview.vue | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 743479ae4b..d5fa7adfd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ## 12.x.x (unreleased) ### Improvements +- クライアント: ノートプレビューの精度を改善 ### Bugfixes - クライアント: 一部のコンポーネントが裏に隠れるのを修正 diff --git a/packages/client/src/components/note-preview.vue b/packages/client/src/components/note-preview.vue index 6e3eba9306..bdcb8d5eed 100644 --- a/packages/client/src/components/note-preview.vue +++ b/packages/client/src/components/note-preview.vue @@ -7,7 +7,7 @@
- +
@@ -61,6 +61,7 @@ export default defineComponent({ width: 40px; height: 40px; border-radius: 8px; + pointer-events: none; } > .main { @@ -69,6 +70,7 @@ export default defineComponent({ > .header { margin-bottom: 2px; + font-weight: bold; } > .body { From 85740dd09f477b357b59dc2e15e351dc6a55be8a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 25 Dec 2021 16:03:57 +0900 Subject: [PATCH 14/33] fix(client): fix sidebar style Fix #8049 --- packages/client/src/ui/_common_/sidebar.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/client/src/ui/_common_/sidebar.vue b/packages/client/src/ui/_common_/sidebar.vue index e363c3abd9..bf560e8dd6 100644 --- a/packages/client/src/ui/_common_/sidebar.vue +++ b/packages/client/src/ui/_common_/sidebar.vue @@ -170,6 +170,8 @@ export default defineComponent({ } &:hover, &.active { + color: var(--accent); + &:before { content: ""; display: block; @@ -283,8 +285,10 @@ export default defineComponent({ } &:before { - width: 100%; - border-radius: 0; + width: auto; + height: 100%; + aspect-ratio: 1/1; + border-radius: 8px; } &.post { @@ -296,8 +300,9 @@ export default defineComponent({ } &.post:before { - width: calc(100% - 32px); - height: calc(100% - 32px); + width: calc(100% - 28px); + height: auto; + aspect-ratio: 1/1; border-radius: 100%; } } From 89a532eeac36a99887b30703bbe7994f3d4bd5b3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 25 Dec 2021 16:53:15 +0900 Subject: [PATCH 15/33] chore(client): tweak style --- packages/client/src/components/global/header.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/global/header.vue b/packages/client/src/components/global/header.vue index 2e03d783af..a241ece407 100644 --- a/packages/client/src/components/global/header.vue +++ b/packages/client/src/components/global/header.vue @@ -6,7 +6,7 @@
- +
{{ info.title }}
{{ info.subtitle }} @@ -268,6 +268,7 @@ export default defineComponent({ > .titleContainer { display: flex; align-items: center; + max-width: 400px; overflow: auto; white-space: nowrap; text-align: left; From 3692c9eb646d83a78308e559ee2a70761e40fc7f Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Dec 2021 01:42:06 +0900 Subject: [PATCH 16/33] refactor --- packages/backend/src/misc/get-file-info.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/misc/get-file-info.ts b/packages/backend/src/misc/get-file-info.ts index f36aa8f966..361cdd2951 100644 --- a/packages/backend/src/misc/get-file-info.ts +++ b/packages/backend/src/misc/get-file-info.ts @@ -99,7 +99,10 @@ export async function getFileInfo(path: string): Promise { /** * Detect MIME Type and extension */ -export async function detectType(path: string) { +export async function detectType(path: string): Promise<{ + mime: string; + ext: string | null; +}> { // Check 0 byte const fileSize = await getFileSize(path); if (fileSize === 0) { From fe3609451ea6d257a9143b0ac7c60257cdb8541a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Dec 2021 01:42:50 +0900 Subject: [PATCH 17/33] enhance(client): :art: --- packages/client/src/components/form/input.vue | 9 +-- .../client/src/components/form/select.vue | 9 ++- .../client/src/components/form/switch.vue | 72 ++++++++----------- .../client/src/components/form/textarea.vue | 9 +-- packages/client/src/components/signup.vue | 11 +-- .../client/src/directives/adaptive-border.ts | 24 +++++++ packages/client/src/directives/index.ts | 2 + packages/client/src/directives/panel.ts | 2 +- packages/client/src/pages/settings/theme.vue | 2 +- 9 files changed, 74 insertions(+), 66 deletions(-) create mode 100644 packages/client/src/directives/adaptive-border.ts diff --git a/packages/client/src/components/form/input.vue b/packages/client/src/components/form/input.vue index c990b693f1..3533f4f27b 100644 --- a/packages/client/src/components/form/input.vue +++ b/packages/client/src/components/form/input.vue @@ -5,7 +5,7 @@
input { - border-color: var(--accent); + border-color: var(--accent) !important; //box-shadow: 0 0 0 4px var(--focus); } } diff --git a/packages/client/src/components/form/select.vue b/packages/client/src/components/form/select.vue index 9ecff1aa6f..afc53ca9c8 100644 --- a/packages/client/src/components/form/select.vue +++ b/packages/client/src/components/form/select.vue @@ -3,7 +3,9 @@
- - - + + - +

@@ -55,16 +51,7 @@ export default defineComponent({ .ziffeoms { position: relative; display: flex; - cursor: pointer; - transition: all 0.3s; - - &:first-child { - margin-top: 0; - } - - &:last-child { - margin-bottom: 0; - } + transition: all 0.2s; > * { user-select: none; @@ -80,27 +67,30 @@ export default defineComponent({ > .button { position: relative; - display: inline-block; + display: inline-flex; flex-shrink: 0; margin: 0; - width: 36px; - height: 26px; - background: var(--switchBg); + box-sizing: border-box; + width: 23px; + height: 23px; outline: none; - border-radius: 999px; + background: var(--panel); + border: solid 1px var(--panel); + border-radius: 4px; + cursor: pointer; transition: inherit; - > .handle { - position: absolute; - top: 0; - bottom: 0; - left: 5px; - margin: auto 0; - border-radius: 100%; - transition: background-color 0.3s, transform 0.3s; - width: 16px; - height: 16px; - background-color: #fff; + > .check { + margin: auto; + opacity: 0; + color: var(--fgOnAccent); + font-size: 13px; + } + } + + &:hover { + > .button { + border-color: var(--inputBorderHover) !important; } } @@ -108,13 +98,13 @@ export default defineComponent({ margin-left: 16px; margin-top: 2px; display: block; - cursor: pointer; transition: inherit; color: var(--fg); > span { display: block; line-height: 20px; + cursor: pointer; transition: inherit; } @@ -129,12 +119,6 @@ export default defineComponent({ } } - &:hover { - > .button { - background-color: var(--accentedBg); - } - } - &.disabled { opacity: 0.6; cursor: not-allowed; @@ -142,11 +126,11 @@ export default defineComponent({ &.checked { > .button { - background-color: var(--accent); - border-color: var(--accent); + background-color: var(--accent) !important; + border-color: var(--accent) !important; - > .handle { - transform: translateX(10px); + > .check { + opacity: 1; } } } diff --git a/packages/client/src/components/form/textarea.vue b/packages/client/src/components/form/textarea.vue index 98fd0da94b..c9ba9b97a2 100644 --- a/packages/client/src/components/form/textarea.vue +++ b/packages/client/src/components/form/textarea.vue @@ -4,7 +4,7 @@