From 456776ea68f033a21e4a7a77bf14340f87983324 Mon Sep 17 00:00:00 2001 From: FliesentischKing Date: Sun, 4 Oct 2026 15:24:32 +0200 Subject: [PATCH] Shorten thread route from /thread to /t All internal links (tiles, prev/next nav, comments, notifications, breadcrumb, dropzone route check) point to /t/. A global route middleware permanently redirects old /thread/ URLs including query string and comment anchor. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- app/components/CommentsSidebar.vue | 2 +- app/components/GlobalDropZone.vue | 2 +- app/components/NotificationBell.vue | 2 +- app/components/SiteBreadcrumb.vue | 2 +- app/components/UploadTile.vue | 4 ++-- app/middleware/thread-redirect.global.ts | 6 ++++++ app/pages/{thread => t}/[id].vue | 4 ++-- app/pages/user/[id].vue | 2 +- app/plugins/notifications.client.ts | 2 +- 9 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 app/middleware/thread-redirect.global.ts rename app/pages/{thread => t}/[id].vue (99%) diff --git a/app/components/CommentsSidebar.vue b/app/components/CommentsSidebar.vue index 38959f1..8f9e5f9 100644 --- a/app/components/CommentsSidebar.vue +++ b/app/components/CommentsSidebar.vue @@ -47,7 +47,7 @@ const mergedComments = computed(() => {
diff --git a/app/components/GlobalDropZone.vue b/app/components/GlobalDropZone.vue index fdefeac..f5a5fc6 100644 --- a/app/components/GlobalDropZone.vue +++ b/app/components/GlobalDropZone.vue @@ -11,7 +11,7 @@ const uploading = ref(false) // In Threads gilt die Zone nur für die obere Bildschirmhälfte — // die untere Hälfte gehört den Kommentaren (dort Anhänge, sonst nichts) -const topHalfOnly = computed(() => route.path.startsWith('/thread/')) +const topHalfOnly = computed(() => route.path.startsWith('/t/')) const pointerY = ref(0) const inTopHalf = computed(() => !topHalfOnly.value || pointerY.value < (import.meta.client ? window.innerHeight : 0) / 2) diff --git a/app/components/NotificationBell.vue b/app/components/NotificationBell.vue index cf91eff..6c10595 100644 --- a/app/components/NotificationBell.vue +++ b/app/components/NotificationBell.vue @@ -14,7 +14,7 @@ const timeAgo = useTimeAgo() async function goTo(n: AppNotification) { open.value = false await markRead(n.id) - await navigateTo(`/thread/${n.uploadId}#comment-${n.commentId}`) + await navigateTo(`/t/${n.uploadId}#comment-${n.commentId}`) } diff --git a/app/components/SiteBreadcrumb.vue b/app/components/SiteBreadcrumb.vue index c05a259..d03f3a7 100644 --- a/app/components/SiteBreadcrumb.vue +++ b/app/components/SiteBreadcrumb.vue @@ -20,7 +20,7 @@ const crumbs = computed(() => { const list: Crumb[] = [{ label: t('palette.home'), to: '/' }] const p = route.path if (p === '/') return [] - if (p.startsWith('/thread/')) list.push({ label: t('nav.thread') }) + if (p.startsWith('/t/')) list.push({ label: t('nav.thread') }) else if (p === '/users') list.push({ label: t('nav.users') }) else if (p.startsWith('/user/')) { list.push({ label: t('nav.users'), to: '/users' }, { label: t('nav.profile') }) diff --git a/app/components/UploadTile.vue b/app/components/UploadTile.vue index 27c01e1..6e383d1 100644 --- a/app/components/UploadTile.vue +++ b/app/components/UploadTile.vue @@ -120,14 +120,14 @@ async function openUpload(e: MouseEvent) { // Die eigentliche Navigation macht der NuxtLink bereits beim Klick — // dieser Push ist nur noch Fallback und bei gleicher Route ein No-Op - await router.push(`/thread/${props.upload.id}`) + await router.push(`/t/${props.upload.id}`) navigating.value = false }