mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 19:03:09 +00:00 
			
		
		
		
	fix: adjust layout and visibility conditions in CreateFormPipeline and ChunkPreview components
This commit is contained in:
		
							parent
							
								
									c891eb28fc
								
							
						
					
					
						commit
						80f656f79a
					
				| @ -223,7 +223,7 @@ const CreateFormPipeline = () => { | |||||||
| 
 | 
 | ||||||
|   return ( |   return ( | ||||||
|     <div |     <div | ||||||
|       className='relative flex h-[calc(100vh-56px)] min-w-[1024px] overflow-x-auto rounded-t-2xl border-t border-effects-highlight bg-background-default-subtle' |       className='relative flex h-[calc(100vh-56px)] w-full min-w-[1024px] overflow-x-auto rounded-t-2xl border-t border-effects-highlight bg-background-default-subtle' | ||||||
|     > |     > | ||||||
|       <div className='flex h-full flex-1 flex-col px-14'> |       <div className='flex h-full flex-1 flex-col px-14'> | ||||||
|         <LeftHeader |         <LeftHeader | ||||||
| @ -309,7 +309,7 @@ const CreateFormPipeline = () => { | |||||||
|       {/* Preview */} |       {/* Preview */} | ||||||
|       { |       { | ||||||
|         currentStep === 1 && ( |         currentStep === 1 && ( | ||||||
|           <div className='flex h-full flex-1 shrink-0 pl-2 pt-2'> |           <div className='flex h-full flex-1 pl-2 pt-2'> | ||||||
|             {currentFile && <FilePreview file={currentFile} hidePreview={hideFilePreview} />} |             {currentFile && <FilePreview file={currentFile} hidePreview={hideFilePreview} />} | ||||||
|             {currentDocuments && <OnlineDocumentPreview currentPage={currentDocuments} hidePreview={hideOnlineDocumentPreview} />} |             {currentDocuments && <OnlineDocumentPreview currentPage={currentDocuments} hidePreview={hideOnlineDocumentPreview} />} | ||||||
|             {currentWebsite && <WebsitePreview payload={currentWebsite} hidePreview={hideWebsitePreview} />} |             {currentWebsite && <WebsitePreview payload={currentWebsite} hidePreview={hideWebsitePreview} />} | ||||||
| @ -318,7 +318,7 @@ const CreateFormPipeline = () => { | |||||||
|       } |       } | ||||||
|       { |       { | ||||||
|         currentStep === 2 && ( |         currentStep === 2 && ( | ||||||
|           <div className='flex h-full flex-1 shrink-0 pl-2 pt-2'> |           <div className='flex h-full flex-1 pl-2 pt-2'> | ||||||
|             <ChunkPreview |             <ChunkPreview | ||||||
|               dataSourceType={datasource!.type} |               dataSourceType={datasource!.type} | ||||||
|               files={fileList.map(file => file.file)} |               files={fileList.map(file => file.file)} | ||||||
|  | |||||||
| @ -122,7 +122,7 @@ const ChunkPreview = ({ | |||||||
|       className='relative flex h-full w-full shrink-0' |       className='relative flex h-full w-full shrink-0' | ||||||
|       mainClassName='space-y-6' |       mainClassName='space-y-6' | ||||||
|     > |     > | ||||||
|       {currentDocForm === ChunkingMode.qa && estimateData?.qa_preview && ( |       {!isPending && currentDocForm === ChunkingMode.qa && estimateData?.qa_preview && ( | ||||||
|         estimateData?.qa_preview.map((item, index) => ( |         estimateData?.qa_preview.map((item, index) => ( | ||||||
|           <ChunkContainer |           <ChunkContainer | ||||||
|             key={item.question} |             key={item.question} | ||||||
| @ -133,7 +133,7 @@ const ChunkPreview = ({ | |||||||
|           </ChunkContainer> |           </ChunkContainer> | ||||||
|         )) |         )) | ||||||
|       )} |       )} | ||||||
|       {currentDocForm === ChunkingMode.text && estimateData?.preview && ( |       {!isPending && currentDocForm === ChunkingMode.text && estimateData?.preview && ( | ||||||
|         estimateData?.preview.map((item, index) => ( |         estimateData?.preview.map((item, index) => ( | ||||||
|           <ChunkContainer |           <ChunkContainer | ||||||
|             key={item.content} |             key={item.content} | ||||||
| @ -144,7 +144,7 @@ const ChunkPreview = ({ | |||||||
|           </ChunkContainer> |           </ChunkContainer> | ||||||
|         )) |         )) | ||||||
|       )} |       )} | ||||||
|       {currentDocForm === ChunkingMode.parentChild && estimateData?.preview && ( |       {!isPending && currentDocForm === ChunkingMode.parentChild && estimateData?.preview && ( | ||||||
|         estimateData?.preview?.map((item, index) => { |         estimateData?.preview?.map((item, index) => { | ||||||
|           const indexForLabel = index + 1 |           const indexForLabel = index + 1 | ||||||
|           // const childChunks = parentChildConfig.chunkForContext === 'full-doc'
 |           // const childChunks = parentChildConfig.chunkForContext === 'full-doc'
 | ||||||
|  | |||||||
| @ -93,7 +93,7 @@ const PipelineSettings = ({ | |||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|       {/* Preview */} |       {/* Preview */} | ||||||
|       <div className='flex h-full flex-1 shrink-0 pl-2 pt-2'> |       <div className='flex h-full flex-1 pl-2 pt-2'> | ||||||
|         <ChunkPreview |         <ChunkPreview | ||||||
|           dataSourceType={documentDetail!.data_source_type as DatasourceType} |           dataSourceType={documentDetail!.data_source_type as DatasourceType} | ||||||
|           // @ts-expect-error mock data // todo: remove mock data
 |           // @ts-expect-error mock data // todo: remove mock data
 | ||||||
|  | |||||||
| @ -14,13 +14,13 @@ const PreviewContainer: FC<PreviewContainerProps> = (props) => { | |||||||
|       {...rest} |       {...rest} | ||||||
|       ref={ref} |       ref={ref} | ||||||
|       className={classNames( |       className={classNames( | ||||||
|         'flex flex-col w-full h-full overflow-y-auto rounded-tl-xl border-t-[0.5px] border-l-[0.5px] border-components-panel-border bg-background-default-lighter shadow-md shadow-shadow-shadow-5', |         'flex flex-col w-full h-full rounded-tl-xl border-t-[0.5px] border-l-[0.5px] border-components-panel-border bg-background-default-lighter shadow-md shadow-shadow-shadow-5', | ||||||
|       )} |       )} | ||||||
|     > |     > | ||||||
|       <header className='border-b border-divider-subtle pb-3 pl-5 pr-4 pt-4'> |       <header className='border-b border-divider-subtle pb-3 pl-5 pr-4 pt-4'> | ||||||
|         {header} |         {header} | ||||||
|       </header> |       </header> | ||||||
|       <main className={classNames('py-5 px-6 w-full h-full', mainClassName)}> |       <main className={classNames('py-5 px-6 w-full grow overflow-y-auto', mainClassName)}> | ||||||
|         {children} |         {children} | ||||||
|       </main> |       </main> | ||||||
|     </div> |     </div> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 twwu
						twwu