Skip to content

Commit

Permalink
fix: regression crashing the document list pane in presentation (#6684)
Browse files Browse the repository at this point in the history
* chore: test if removing the default alias fixes it

* Revert "chore: test if removing the default alias fixes it"

This reverts commit 0917e5c.

* fix: re-export PaneContainer as DocumentListPane like the lazy import

* chore: remove old `@sanity/presentation` repro that isn't needed anymore

* chore: update CODEOWNERS with internals used by presentation
  • Loading branch information
stipsan authored May 15, 2024
1 parent ba0ec2d commit 7ae3afd
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 52 deletions.
29 changes: 28 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# -- Scheduled Publishing --
/packages/sanity/src/core/scheduledPublishing/ @sanity-io/studio-ex

# -- Upsell UI --
# -- Upsell UI --
packages/sanity/src/core/studio/upsell/ @sanity-io/studio-ex


Expand All @@ -68,3 +68,30 @@ packages/sanity/src/core/studio/upsell/ @sanity-io/studio-ex
/packages/@sanity/cli/src/actions/typegen @sanity-io/content-lake-dx
/packages/@sanity/cli/src/commands/typegen @sanity-io/content-lake-dx
/packages/@sanity/cli/src/workers/typegenGenerate.ts @sanity-io/content-lake-dx

# Internals used by @sanity/presentation
/packages/sanity/src/_singletons/structure/components/paneRouter/PaneRouterContext.tsx @sanity-io/ecosystem
/packages/sanity/src/core/comments/context/intent/CommentsIntentProvider.tsx @sanity-io/ecosystem
/packages/sanity/src/core/comments/types.ts @sanity-io/ecosystem
/packages/sanity/src/core/config/document/fieldActions/define.ts @sanity-io/ecosystem
/packages/sanity/src/core/config/document/fieldActions/types.ts @sanity-io/ecosystem
/packages/sanity/src/core/field/paths/helpers.ts @sanity-io/ecosystem
/packages/sanity/src/core/hooks/useEditState.ts @sanity-io/ecosystem
/packages/sanity/src/core/preview/components/Preview.tsx @sanity-io/ecosystem
/packages/sanity/src/core/store/_legacy/datastores.ts @sanity-io/ecosystem
/packages/sanity/src/core/store/_legacy/document/document-store.ts @sanity-io/ecosystem
/packages/sanity/src/core/studio/activeWorkspaceMatcher/useActiveWorkspace.ts @sanity-io/ecosystem
/packages/sanity/src/core/studio/workspace.tsx @sanity-io/ecosystem
/packages/sanity/src/core/util/draftUtils.ts @sanity-io/ecosystem
/packages/sanity/src/core/util/isRecord.ts @sanity-io/ecosystem
/packages/sanity/src/core/util/useUnique.ts @sanity-io/ecosystem
/packages/sanity/src/router/utils/jsonParamsEncoding.ts @sanity-io/ecosystem
/packages/sanity/src/structure/components/pane/PaneLayout.tsx @sanity-io/ecosystem
/packages/sanity/src/structure/components/paneRouter/types.ts @sanity-io/ecosystem
/packages/sanity/src/structure/panes/document/DocumentPane.tsx @sanity-io/ecosystem
/packages/sanity/src/structure/panes/document/useDocumentPane.tsx @sanity-io/ecosystem
/packages/sanity/src/structure/panes/documentList/index.ts @sanity-io/ecosystem
/packages/sanity/src/structure/panes/documentList/pane.ts @sanity-io/ecosystem
/packages/sanity/src/structure/panes/documentList/PaneContainer.tsx @sanity-io/ecosystem
/packages/sanity/src/structure/StructureToolProvider.tsx @sanity-io/ecosystem
/packages/sanity/src/structure/types.ts @sanity-io/ecosystem
6 changes: 0 additions & 6 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@
"rollback"
]
},
{
"description": "Pin Presentation in Test Studio to the version that has the agressive focus path behavior that makes race conditions easier to debug",
"matchFileNames": ["dev/test-studio/package.json"],
"matchDepNames": ["@sanity/presentation"],
"allowedVersions": "<=1.11.4"
},
{
"matchDepTypes": ["dependencies"],
"matchPackageNames": [
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@sanity/logos": "^2.1.2",
"@sanity/migrate": "workspace:*",
"@sanity/portable-text-editor": "workspace:*",
"@sanity/presentation": "1.11.4",
"@sanity/preview-url-secret": "^1.6.1",
"@sanity/react-loader": "^1.8.3",
"@sanity/tsdoc": "1.0.55",
Expand Down
12 changes: 4 additions & 8 deletions dev/test-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {nnNOLocale} from '@sanity/locale-nn-no'
import {ptPTLocale} from '@sanity/locale-pt-pt'
import {svSELocale} from '@sanity/locale-sv-se'
import {SanityMonogram} from '@sanity/logos'
import {presentationTool as pinnedPresentationTool} from '@sanity/presentation'
import {debugSecrets} from '@sanity/preview-url-secret/sanity-plugin-debug-secrets'
import {tsdoc} from '@sanity/tsdoc/studio'
import {visionTool} from '@sanity/vision'
Expand Down Expand Up @@ -308,13 +307,10 @@ export default defineConfig([
debugSecrets(),
presentationTool({
name: 'presentation',
title: 'Presentation (stable)',
previewUrl: '/preview/index.html',
}),
pinnedPresentationTool({
name: 'reproduction-presentation',
title: 'Presentation (reproduction)',
previewUrl: '/preview/index.html',
title: 'Presentation',
previewUrl: {
preview: '/preview/index.html',
},
}),
assist(),
sharedSettings(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export function useShallowUnique<ValueType>(value: ValueType): ValueType {
return valueRef.current
}

/**
* @internal
*/
export const PaneContainer = memo(function PaneContainer(
props: BaseStructureToolPaneProps<'documentList'>,
) {
Expand Down
10 changes: 9 additions & 1 deletion packages/sanity/src/structure/panes/documentList/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
export * from './DocumentListPane'
import {type ComponentProps} from 'react'

import {PaneContainer} from './PaneContainer'

export {PaneContainer as DocumentListPane}
/**
* @internal
*/
export type DocumentListPaneProps = ComponentProps<typeof PaneContainer>
35 changes: 0 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7ae3afd

Please sign in to comment.