From 02fafd51145a695df4603d46f66e34d190caab3f Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 17:20:34 +0900 Subject: [PATCH 01/18] fix(client): user search of explore not working --- packages/client/src/pages/explore.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/src/pages/explore.vue b/packages/client/src/pages/explore.vue index 981660cbf..7a662c9ca 100644 --- a/packages/client/src/pages/explore.vue +++ b/packages/client/src/pages/explore.vue @@ -42,6 +42,7 @@ import * as os from '@/os'; import { definePageMetadata } from '@/scripts/page-metadata'; import { i18n } from '@/i18n'; import { instance } from '@/instance'; +import XUserList from '@/components/user-list.vue'; const props = defineProps<{ tag?: string; From ef9fdb93d2999e98ea0ecb750ba0f0409793f166 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Tue, 5 Jul 2022 10:42:54 +0200 Subject: [PATCH 02/18] fix: pagination uses API correctly (#8925) --- packages/client/src/components/ui/pagination.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/ui/pagination.vue b/packages/client/src/components/ui/pagination.vue index c081e06ac..a03c2b3a1 100644 --- a/packages/client/src/components/ui/pagination.vue +++ b/packages/client/src/components/ui/pagination.vue @@ -133,8 +133,10 @@ const fetchMore = async (): Promise => { limit: SECOND_FETCH_LIMIT + 1, ...(props.pagination.offsetMode ? { offset: offset.value, + } : props.pagination.reversed ? { + sinceId: items.value[0].id, } : { - untilId: props.pagination.reversed ? items.value[0].id : items.value[items.value.length - 1].id, + untilId: items.value[items.value.length - 1].id, }), }).then(res => { for (let i = 0; i < res.length; i++) { @@ -169,8 +171,10 @@ const fetchMoreAhead = async (): Promise => { limit: SECOND_FETCH_LIMIT + 1, ...(props.pagination.offsetMode ? { offset: offset.value, + } : props.pagination.reversed ? { + untilId: items.value[0].id, } : { - sinceId: props.pagination.reversed ? items.value[0].id : items.value[items.value.length - 1].id, + sinceId: items.value[items.value.length - 1].id, }), }).then(res => { if (res.length > SECOND_FETCH_LIMIT) { From 40656e3ee2ece0df754bad612f92449f40c43e1d Mon Sep 17 00:00:00 2001 From: Kainoa Kanter <44733677+ThatOneCalculator@users.noreply.github.com> Date: Tue, 5 Jul 2022 01:44:05 -0700 Subject: [PATCH 03/18] feat: styled error screen (#8930) * Styled error screen * Make details margin auto * Update boot.css * Replace fontawesome with tabler svg * Remove hr * Add new style to flush screen * Rename to `error.css` --- packages/backend/src/server/web/boot.js | 43 ++++++-- packages/backend/src/server/web/error.css | 98 +++++++++++++++++++ .../backend/src/server/web/views/base.pug | 2 +- .../backend/src/server/web/views/flush.pug | 6 ++ 4 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 packages/backend/src/server/web/error.css diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index 9fc536555..124f25f5e 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -106,15 +106,39 @@ function renderError(code, details) { let errorsElement = document.getElementById('errors'); if (!errorsElement) { + document.getElementsByTagName("head")[0].insertAdjacentHTML( + "beforeend", + ``); document.documentElement.innerHTML = ` -

⚠ An error has occurred. ⚠

-

If the problem persists, please contact the administrator. You may also try the following options:

- -
+ + + + + +

An error has occurred!

+ +

Don't worry, it's (probably) not your fault.

+

If the problem persists after refreshing, please contact your instance's administrator.
You may also try the following options:

+ + + +
+ + + +
+ + + +
`; @@ -122,8 +146,7 @@ } const detailsElement = document.createElement('details'); - detailsElement.innerHTML = `ERROR CODE: ${code}${JSON.stringify(details)}`; - + detailsElement.innerHTML = `
ERROR CODE: ${code}${JSON.stringify(details)}`; errorsElement.appendChild(detailsElement); } diff --git a/packages/backend/src/server/web/error.css b/packages/backend/src/server/web/error.css new file mode 100644 index 000000000..9f8f90501 --- /dev/null +++ b/packages/backend/src/server/web/error.css @@ -0,0 +1,98 @@ +* { + font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; +} + +body, +html { + background-color: #222; + color: #dfddcc; + justify-content: center; + margin: auto; + width: 80%; + padding: 10px; + text-align: center; +} + +button { + border-radius: 999px; + padding: 0px 12px 0px 12px; + border: none; + cursor: pointer; + margin-bottom: 12px; +} + +.button-big { + background: linear-gradient(90deg, rgb(134, 179, 0), rgb(74, 179, 0)); + line-height: 50px; +} + +.button-big:hover { + background: rgb(153, 204, 0); +} + +.button-small { + background: #444; + line-height: 40px; +} + +.button-small:hover { + background: #555; +} + +.button-label-big { + color: #222; + font-weight: bold; + font-size: 20px; + padding: 12px; +} + +.button-label-small { + color: rgb(153, 204, 0); + font-size: 16px; + padding: 12px; +} + +a { + color: rgb(134, 179, 0); + text-decoration: none; +} + +p, +li { + font-size: 16px; +} + +.dont-worry, +#msg { + font-size: 18px; +} + +.icon-warning { + color: #dec340; + height: 4rem; +} + +h1 { + font-size: 32px; +} + +code { + font-family: Fira, FiraCode, monospace; +} + +details { + background: #333; + margin-bottom: 2rem; + padding: 0.5rem 1rem; + border-radius: 5px; + justify-content: center; + margin: auto; +} + +summary { + cursor: pointer; +} + +summary > * { + display: inline; +} diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 5bb156f0f..32499aa45 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -53,7 +53,7 @@ html block meta block og - meta(property='og:title' content= title || 'Misskey') + meta(property='og:title' content= title || 'Misskey') meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨') meta(property='og:image' content= img) diff --git a/packages/backend/src/server/web/views/flush.pug b/packages/backend/src/server/web/views/flush.pug index ec585a34d..b08f61c73 100644 --- a/packages/backend/src/server/web/views/flush.pug +++ b/packages/backend/src/server/web/views/flush.pug @@ -1,6 +1,12 @@ doctype html html + head + meta(charset='utf-8') + meta(name='application-name' content='Misskey') + title Flushing Misskey + style + include ../error.css #msg script. const msg = document.getElementById('msg'); From cb246d3459508bcd25cd29e9c6d38ab637425b42 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 17:46:17 +0900 Subject: [PATCH 04/18] rename: BIOS -> Repair Tool --- packages/backend/src/server/web/boot.js | 2 +- packages/backend/src/server/web/views/bios.pug | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index 124f25f5e..e82de8e14 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -135,7 +135,7 @@

diff --git a/packages/backend/src/server/web/views/bios.pug b/packages/backend/src/server/web/views/bios.pug index d81a3ee67..39a151a29 100644 --- a/packages/backend/src/server/web/views/bios.pug +++ b/packages/backend/src/server/web/views/bios.pug @@ -5,7 +5,7 @@ html head meta(charset='utf-8') meta(name='application-name' content='Misskey') - title Misskey BIOS + title Misskey Repair Tool style include ../bios.css script @@ -13,7 +13,7 @@ html body header - h1 Misskey BIOS #{version} + h1 Misskey Repair Tool #{version} main div.tabs button#ls edit local storage From 38c1867a8b2e97d6e3b13459ff0c619c0ab9389a Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 17:46:55 +0900 Subject: [PATCH 05/18] 12.112.0-beta.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 700cd07c3..8692eb659 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.112.0-beta.16", + "version": "12.112.0-beta.17", "codename": "indigo", "repository": { "type": "git", From a1cbffd14f807b3cb36c33edd0994023695b5897 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 17:55:47 +0900 Subject: [PATCH 06/18] chore(client): tweak ui --- packages/client/src/components/instance-stats.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/instance-stats.vue b/packages/client/src/components/instance-stats.vue index a03993752..a2a635392 100644 --- a/packages/client/src/components/instance-stats.vue +++ b/packages/client/src/components/instance-stats.vue @@ -154,7 +154,7 @@ function createDoughnut(chartEl, tooltip, data) { } onMounted(() => { - os.apiGet('federation/stats', { limit: 15 }).then(fedStats => { + os.apiGet('federation/stats', { limit: 20 }).then(fedStats => { createDoughnut(subDoughnutEl, externalTooltipHandler1, fedStats.topSubInstances.map(x => ({ name: x.host, color: x.themeColor, From 972b03f8428937632c65389f960cb0d5836b9e71 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 19:16:21 +0900 Subject: [PATCH 07/18] perf: allow get for notes/reactions --- packages/backend/src/server/api/endpoints/notes/reactions.ts | 3 +++ packages/client/src/components/reactions-viewer.reaction.vue | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/reactions.ts b/packages/backend/src/server/api/endpoints/notes/reactions.ts index fbb065329..15a62d394 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -9,6 +9,9 @@ export const meta = { requireCredential: false, + allowGet: true, + cacheSec: 60, + res: { type: 'array', optional: false, nullable: false, diff --git a/packages/client/src/components/reactions-viewer.reaction.vue b/packages/client/src/components/reactions-viewer.reaction.vue index ee40615f1..c29bd4640 100644 --- a/packages/client/src/components/reactions-viewer.reaction.vue +++ b/packages/client/src/components/reactions-viewer.reaction.vue @@ -70,10 +70,11 @@ onMounted(() => { }); useTooltip(buttonRef, async (showing) => { - const reactions = await os.api('notes/reactions', { + const reactions = await os.apiGet('notes/reactions', { noteId: props.note.id, type: props.reaction, limit: 11, + _cacheKey_: props.count, }); const users = reactions.map(x => x.user); From 7dd9f93efb2c8786ce66d17eacf7088d0499337f Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 19:29:44 +0900 Subject: [PATCH 08/18] =?UTF-8?q?feat(client):=20=E3=83=A1=E3=83=8B?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=81=8B=E3=82=89=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E3=83=AA=E3=83=AD=E3=83=BC=E3=83=89=E3=81=A7=E3=81=8D?= =?UTF-8?q?=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 --- CHANGELOG.md | 1 + packages/client/src/menu.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3444a761..039a0ec08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ You should also include the user name that made the change. - Client: Poll highlights in explore page @syuilo - Client: Improve deck UI @syuilo - Client: Word mute also checks content warnings @Johann150 +- Client: メニューからページをリロードできるように @syuilo - ユーザーにモデレーションメモを残せる機能 @syuilo - Make possible to delete an account by admin @syuilo - Improve player detection in URL preview @mei23 diff --git a/packages/client/src/menu.ts b/packages/client/src/menu.ts index 677296a6f..503924e64 100644 --- a/packages/client/src/menu.ts +++ b/packages/client/src/menu.ts @@ -164,4 +164,11 @@ export const menuDef = reactive({ }], ev.currentTarget ?? ev.target); }, }, + reload: { + title: 'reload', + icon: 'fas fa-refresh', + action: (ev) => { + location.reload(); + }, + }, }); From 62f8af489150784c6803d4faf2e24b65bc3f86ea Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 22:25:27 +0900 Subject: [PATCH 09/18] enhance(client): improve usability --- packages/client/src/nirax.ts | 7 ++++++- packages/client/src/router.ts | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index 19c4464ea..cd29ae87a 100644 --- a/packages/client/src/nirax.ts +++ b/packages/client/src/nirax.ts @@ -61,6 +61,7 @@ export class Router extends EventEmitter<{ props: Map | null; key: string; }) => void; + same: () => void; }> { private routes: RouteDef[]; private currentPath: string; @@ -210,11 +211,15 @@ export class Router extends EventEmitter<{ } public push(path: string) { + const beforePath = this.currentPath; + if (path === beforePath) { + this.emit('same'); + return; + } if (this.navHook) { const cancel = this.navHook(path); if (cancel) return; } - const beforePath = this.currentPath; this.navigate(path, null); this.emit('push', { beforePath, diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index b3baad188..2ff41e972 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -258,6 +258,10 @@ mainRouter.addListener('push', ctx => { } }); +mainRouter.addListener('same', () => { + window.scroll({ top: 0, behavior: 'smooth' }); +}); + window.addEventListener('popstate', (event) => { mainRouter.change(location.pathname + location.search + location.hash, event.state?.key); const scrollPos = scrollPosStore.get(event.state?.key) ?? 0; From 60710805d506b1fff1c53336675a3cdc14f7df10 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 22:25:34 +0900 Subject: [PATCH 10/18] chore(client): fix type --- packages/client/src/components/img-with-blurhash.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/img-with-blurhash.vue b/packages/client/src/components/img-with-blurhash.vue index 06ad76440..80d7c201a 100644 --- a/packages/client/src/components/img-with-blurhash.vue +++ b/packages/client/src/components/img-with-blurhash.vue @@ -11,7 +11,7 @@ import { decode } from 'blurhash'; const props = withDefaults(defineProps<{ src?: string | null; - hash: string; + hash?: string; alt?: string; title?: string | null; size?: number; From f66235f0669bf77c5b76a159cb9c5856cebe3ef5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jul 2022 22:35:57 +0900 Subject: [PATCH 11/18] chore(client): rendering performance tweak a bit --- .../src/components/global/page-header.vue | 2 ++ .../client/src/components/ui/container.vue | 1 + packages/client/src/components/widgets.vue | 1 + .../src/ui/_common_/sidebar-for-mobile.vue | 24 ++++++------- packages/client/src/ui/_common_/sidebar.vue | 35 ++++++++++--------- 5 files changed, 34 insertions(+), 29 deletions(-) diff --git a/packages/client/src/components/global/page-header.vue b/packages/client/src/components/global/page-header.vue index e6917611f..766f9b6b6 100644 --- a/packages/client/src/components/global/page-header.vue +++ b/packages/client/src/components/global/page-header.vue @@ -178,6 +178,8 @@ onUnmounted(() => { -webkit-backdrop-filter: var(--blur, blur(15px)); backdrop-filter: var(--blur, blur(15px)); border-bottom: solid 0.5px var(--divider); + contain: strict; + height: var(--height); &.thin { --height: 45px; diff --git a/packages/client/src/components/ui/container.vue b/packages/client/src/components/ui/container.vue index e14242827..784414e79 100644 --- a/packages/client/src/components/ui/container.vue +++ b/packages/client/src/components/ui/container.vue @@ -144,6 +144,7 @@ export default defineComponent({ .ukygtjoj { position: relative; overflow: hidden; overflow: clip; + contain: content; &.naked { background: transparent !important; diff --git a/packages/client/src/components/widgets.vue b/packages/client/src/components/widgets.vue index be84cdbf7..85b8ae0ed 100644 --- a/packages/client/src/components/widgets.vue +++ b/packages/client/src/components/widgets.vue @@ -113,6 +113,7 @@ export default defineComponent({ } > .widget, .customize-container { + contain: content; margin: var(--margin) 0; &:first-of-type { diff --git a/packages/client/src/ui/_common_/sidebar-for-mobile.vue b/packages/client/src/ui/_common_/sidebar-for-mobile.vue index 41d083723..e789ae5e0 100644 --- a/packages/client/src/ui/_common_/sidebar-for-mobile.vue +++ b/packages/client/src/ui/_common_/sidebar-for-mobile.vue @@ -1,32 +1,32 @@