mirror of
				https://github.com/massbug/judge4c.git
				synced 2025-10-31 07:34:05 +00:00 
			
		
		
		
	refactor(ai-optimized-editor):优化 AI 代码编辑器布局- 调整了编辑器组件的 CSS 类,使其充满整个可用空间
- 优化了 DiffEditor 和 Editor 组件的布局,使其在显示和隐藏时能正确占用空间 - 移除了不必要的高度属性,使编辑器能根据内容自适应高度
This commit is contained in:
		
							parent
							
								
									a54598853e
								
							
						
					
					
						commit
						a559734c30
					
				| @ -98,8 +98,8 @@ export function AIProblemEditor({ | |||||||
|   }, [currentCode, problemId]); |   }, [currentCode, problemId]); | ||||||
| 
 | 
 | ||||||
|   return ( |   return ( | ||||||
|     <div className="space-y-4"> |     <div className="flex flex-col h-full w-full"> | ||||||
|       <div className="flex justify-between items-center"> |       <div className="flex justify-between items-center p-4"> | ||||||
|         <button |         <button | ||||||
|           onClick={handleOptimizeCode} |           onClick={handleOptimizeCode} | ||||||
|           disabled={isOptimizing || !currentCode} |           disabled={isOptimizing || !currentCode} | ||||||
| @ -124,6 +124,7 @@ export function AIProblemEditor({ | |||||||
|         </div> |         </div> | ||||||
|       )} |       )} | ||||||
| 
 | 
 | ||||||
|  |       <div className="flex-grow overflow-hidden"> | ||||||
|         {showDiff ? ( |         {showDiff ? ( | ||||||
|           <DiffEditor |           <DiffEditor | ||||||
|             original={currentCode} |             original={currentCode} | ||||||
| @ -138,7 +139,6 @@ export function AIProblemEditor({ | |||||||
|           /> |           /> | ||||||
|         ) : ( |         ) : ( | ||||||
|           <Editor |           <Editor | ||||||
|           height="500px" |  | ||||||
|             language="typescript" |             language="typescript" | ||||||
|             theme="vs-dark" |             theme="vs-dark" | ||||||
|             value={currentCode} |             value={currentCode} | ||||||
| @ -147,8 +147,10 @@ export function AIProblemEditor({ | |||||||
|               scrollBeyondLastLine: false, |               scrollBeyondLastLine: false, | ||||||
|               fontSize: 14 |               fontSize: 14 | ||||||
|             }} |             }} | ||||||
|  |             className="h-full w-full" | ||||||
|           /> |           /> | ||||||
|         )} |         )} | ||||||
|       </div> |       </div> | ||||||
|  |     </div> | ||||||
|   ); |   ); | ||||||
| } | } | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user