diff --git a/CHANGELOG.md b/CHANGELOG.md index d8fa82ad2f..84e3321518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,17 @@ --> +## 13.x.x (unreleased) + +### General +- + +### Client +- 検索ページでURLを入力した際に照会したときと同等の挙動をするように + +### Server +- + ## 13.10.3 ### Changes diff --git a/packages/frontend/src/pages/search.vue b/packages/frontend/src/pages/search.vue index cc6f8cc0cc..5523d5cf4d 100644 --- a/packages/frontend/src/pages/search.vue +++ b/packages/frontend/src/pages/search.vue @@ -56,6 +56,9 @@ import MkFoldableSection from '@/components/MkFoldableSection.vue'; import { $i } from '@/account'; import { instance } from '@/instance'; import MkInfo from '@/components/MkInfo.vue'; +import { useRouter } from '@/router'; + +const router = useRouter(); const props = defineProps<{ query: string; @@ -84,6 +87,24 @@ async function search() { if (query == null || query === '') return; + if (query.startsWith('https://')) { + const promise = os.api('ap/show', { + uri: query, + }); + + os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject); + + const res = await promise; + + if (res.type === 'User') { + router.push(`/@${res.object.username}@${res.object.host}`); + } else if (res.type === 'Note') { + router.push(`/notes/${res.object.id}`); + } + + return; + } + if (tab === 'note') { notePagination = { endpoint: 'notes/search',