fix: public and Knowledge no mask

This commit is contained in:
Joel 2026-06-23 14:37:41 +08:00
parent d764b16d06
commit 31ee7bb467
3 changed files with 19 additions and 2 deletions

View File

@ -306,6 +306,19 @@ describe('AgentConfigurePublishBar', () => {
expect(onPublish).not.toHaveBeenCalled()
})
it('should keep published state when the published detail updates before the active snapshot is refreshed', () => {
renderPublishBar({
activeConfigIsPublished: true,
activeConfigSnapshot: null,
})
expect(screen.getByText('agentV2.agentDetail.configure.publishBar.upToDate')).toBeInTheDocument()
expect(screen.getByRole('button', { name: 'agentV2.agentDetail.configure.publishBar.published' })).toBeDisabled()
expect(hotkeyRegistrations.get('Mod+Shift+P')?.options).toEqual(
expect.objectContaining({ enabled: false, ignoreInputs: false }),
)
})
it('should initialize unpublished state when active config is not published', async () => {
const { onPublish } = renderPublishBar({
activeConfigIsPublished: false,

View File

@ -227,7 +227,11 @@ export function AgentKnowledgeRetrievalDialog({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="flex h-[520px] max-h-[calc(100dvh-2rem)] w-[400px] flex-col overflow-hidden p-0">
<DialogContent
backdropProps={{ forceRender: true }}
backdropClassName="fixed"
className="flex h-[520px] max-h-[calc(100dvh-2rem)] w-[400px] flex-col overflow-hidden p-0"
>
<DialogTitle className="sr-only">
{t('agentDetail.configure.knowledgeRetrieval.dialog.title')}
</DialogTitle>

View File

@ -63,7 +63,7 @@ function getPublishState({
return 'publishing'
if (!activeConfigSnapshot)
return 'draft'
return activeConfigIsPublished ? 'published' : 'draft'
if (!activeConfigIsPublished || isDirty)
return 'unpublished'