Skip to content

Commit a218c88

Browse files
committed
feat(sanity): add "Copy error details" button to document list error UI
1 parent d11efce commit a218c88

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

packages/sanity/src/structure/i18n/resources.ts

-2
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ const structureLocaleStrings = defineLocalesResources('structure', {
327327
'panes.document-header-title.new.text': 'New {{schemaType}}',
328328
/** The text used in the document header title if no other title can be determined */
329329
'panes.document-header-title.untitled.text': 'Untitled',
330-
/** The text for the retry button on the document list pane */
331-
'panes.document-list-pane.error.retry-button.text': 'Retry',
332330
/** The error text on the document list pane */
333331
'panes.document-list-pane.error.text': 'Error: <Code>{{error}}</Code>',
334332
/** The error title on the document list pane */

packages/sanity/src/structure/panes/documentList/DocumentListPaneContent.tsx

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {SyncIcon} from '@sanity/icons'
21
import {type SanityDocument} from '@sanity/types'
32
import {Box, Container, Flex, Heading, Stack, Text} from '@sanity/ui'
43
import {useCallback, useEffect, useMemo, useState} from 'react'
54
import {
65
CommandList,
76
type CommandListRenderItemCallback,
7+
ErrorActions,
88
type GeneralPreviewLayoutKey,
99
getPublishedId,
1010
LoadingBlock,
@@ -15,7 +15,6 @@ import {
1515
} from 'sanity'
1616
import {styled} from 'styled-components'
1717

18-
import {Button} from '../../../ui-components'
1918
import {Delay, PaneContent, PaneItem, usePane, usePaneLayout} from '../../components'
2019
import {structureLocaleNamespace} from '../../i18n'
2120
import {FULL_LIST_LIMIT} from './constants'
@@ -198,17 +197,7 @@ export function DocumentListPaneContent(props: DocumentListPaneContentProps) {
198197
components={{Code: ({children}) => <code>{children}</code>}}
199198
/>
200199
</Text>
201-
202-
{onRetry && (
203-
<Box>
204-
<Button
205-
icon={SyncIcon}
206-
onClick={onRetry}
207-
text={t('panes.document-list-pane.error.retry-button.text')}
208-
tone="primary"
209-
/>
210-
</Box>
211-
)}
200+
<ErrorActions error={error} eventId={null} onRetry={onRetry} />
212201
</Stack>
213202
</Container>
214203
</Flex>

0 commit comments

Comments
 (0)