fix(workspace): handleBack pasa ?org=orgId para scroll contextual en biblioteca

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 21:57:25 -03:00
parent 1813a9396a
commit c6c88501d1
2 changed files with 8 additions and 3 deletions

View File

@@ -192,8 +192,10 @@ export function WorkspacePage() {
: currentProcess.orgName ?? 'Biblioteca'
function handleBack() {
// Navega siempre a /library (sin ?org=) hasta que exista una vista filtrada por org
void navigate({ to: '/library' })
void navigate({
to: '/library',
search: { org: currentProcess?.orgId ?? undefined },
})
}
// Label del tab "elemento" según lo seleccionado

View File

@@ -107,6 +107,9 @@ const libraryRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/library',
component: LibraryPage,
validateSearch: (search: Record<string, unknown>) => ({
org: typeof search.org === 'string' ? search.org : undefined,
}),
})
const importRoute = createRoute({
@@ -134,7 +137,7 @@ const settingsRoute = createRoute({
beforeLoad: ({ context }) => {
const role = (context as { auth?: { user?: { platformRole?: string } } }).auth?.user?.platformRole
if (role === 'client_editor' || role === 'client_viewer') {
throw redirect({ to: '/library' })
throw redirect({ to: '/library', search: { org: undefined } })
}
},
})