fix(webui): support version switching on public share (no login redirect)

Switching a version in the public share breadcrumb navigated to the
authenticated /projects/:id/files/:id route, which triggered the
authenticated /api/projects/:id/team call (via resolveTeamIdFromPath) ->
401 -> redirect to login.

- breadcrumb handleVersionClick now routes to /share/:shareId/files/:id
  with a version search param when public.
- public share route gains a version param; PublicShareManager fetches the
  stack asset (for the version list) and the active version child asset
  (for display/comments/fields), mirroring the authenticated page.
- compare exit sets version to the active side for parity.
This commit is contained in:
yiling
2026-07-04 15:22:38 +08:00
parent c793e0dd78
commit 0bbb846beb
3 changed files with 54 additions and 9 deletions
+10 -1
View File
@@ -94,7 +94,16 @@ export function BreadcrumbNav({
const { canEdit } = usePermissions(projectId)
const handleVersionClick = (versionId: string) => {
if (!projectId || !fileId) return
if (!fileId) return
if (isPublic && shareId) {
navigate({
to: '/share/$shareId/files/$fileId',
params: { shareId, fileId },
search: (prev: Record<string, unknown>) => ({ ...prev, version: versionId }),
})
return
}
if (!projectId) return
navigate({
to: '/projects/$projectId/files/$fileId',
params: { projectId, fileId },