1
0
This commit is contained in:
2026-03-08 16:23:07 +09:00
parent b64785350b
commit 595766c617
26 changed files with 665 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
export interface Route {
type: 'home' | 'user' | 'post' | 'postpage' | 'atbrowser' | 'service' | 'collection' | 'record' | 'chat' | 'chat-thread' | 'chat-edit' | 'card' | 'card-old' | 'rse' | 'link'
type: 'home' | 'user' | 'post' | 'postpage' | 'atbrowser' | 'service' | 'collection' | 'record' | 'chat' | 'chat-thread' | 'chat-edit' | 'card' | 'card-old' | 'rse' | 'link' | 'vrm'
handle?: string
rkey?: string
service?: string
@@ -75,6 +75,12 @@ export function parseRoute(): Route {
return { type: 'link', handle: linkMatch[1] }
}
// VRM page: /@handle/at/vrm
const vrmMatch = path.match(/^\/@([^/]+)\/at\/vrm\/?$/)
if (vrmMatch) {
return { type: 'vrm', handle: vrmMatch[1] }
}
// Chat edit: /@handle/at/chat/{rkey}/edit
const chatEditMatch = path.match(/^\/@([^/]+)\/at\/chat\/([^/]+)\/edit$/)
if (chatEditMatch) {
@@ -133,6 +139,8 @@ export function navigate(route: Route): void {
path = `/@${route.handle}/at/chat/${route.rkey}/edit`
} else if (route.type === 'link' && route.handle) {
path = `/@${route.handle}/at/link`
} else if (route.type === 'vrm' && route.handle) {
path = `/@${route.handle}/at/vrm`
}
window.history.pushState({}, '', path)