forked from BRETT/BRETT
Keep thread navigation within the originating upload list
Record where an upload was opened from in a new useUploadNavContext state. When a tile is clicked on a user profile, the thread page passes that context to the upload detail API, which scopes the newer/older neighbors to that user's uploads. Arrow clicks reseed the context for the next thread, so the chain stays within the source list without a URL parameter. Threads opened directly (notification, reload) fall back to the global order. The breadcrumb reads the same context and shows the profile path for profile-originated threads, now including the thread id in the final crumb. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -15,3 +15,17 @@ export interface PendingUploadMedia {
|
||||
export function usePendingUploadMedia() {
|
||||
return useState<PendingUploadMedia | null>('pending-upload-media', () => null)
|
||||
}
|
||||
|
||||
export interface UploadNavContext {
|
||||
uploadId: string
|
||||
fromPath: string | null
|
||||
fromLabel: string | null
|
||||
}
|
||||
|
||||
// Herkunft der Thread-Navigation (z. B. /user/<id>): beim Tile-Klick gesetzt
|
||||
// und von den Thread-Pfeilen für die Folgeseite weitergereicht. Gilt immer
|
||||
// nur für die in uploadId hinterlegte Seite — ein direkt geöffneter Thread
|
||||
// (Notification, Kommentar-Link, Reload) fällt auf die globale Reihenfolge
|
||||
export function useUploadNavContext() {
|
||||
return useState<UploadNavContext | null>('upload-nav-context', () => null)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user