Skip to content

OpenReel Video - Professional browser-based video editor. Open source CapCut alternative. 100% browser-based, no installation, no cloud uploads, no watermarks.

TypeScript

fix: add max-width constraints to AI Gen tab panels to prevent overflow

Augustus Otu9c6722ec9b44
diff --git a/apps/web/src/components/editor/AIGenTab.tsx b/apps/web/src/components/editor/AIGenTab.tsx
index 6659a7bb..18122f88 100644
--- a/apps/web/src/components/editor/AIGenTab.tsx
+++ b/apps/web/src/components/editor/AIGenTab.tsx
@@ -132,7 +132,7 @@ export const AIGenTab: React.FC = () => {
<span className="text-[11px] font-medium">Back to AI Tools</span>
</button>
<ScrollArea className="flex-1 w-full">
- <div className="p-4">{renderActivePanel()}</div>
+ <div className="p-4 w-full min-w-0 overflow-hidden">{renderActivePanel()}</div>
</ScrollArea>
</div>
);
diff --git a/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx b/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx
index dd492974..c7780dff 100644
--- a/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx
+++ b/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx
@@ -139,7 +139,7 @@ export const AutoCaptionPanel: React.FC = () => {
}
return (
- <div className="space-y-4">
+ <div className="space-y-4 w-full min-w-0 max-w-full">
<div className="flex items-center gap-2 p-2 bg-primary/10 rounded-lg border border-primary/30">
<Sparkles size={16} className="text-primary" />
<div>
diff --git a/apps/web/src/components/editor/inspector/TemplatesBrowserPanel.tsx b/apps/web/src/components/editor/inspector/TemplatesBrowserPanel.tsx
index 2654cc81..7c0d7181 100644
--- a/apps/web/src/components/editor/inspector/TemplatesBrowserPanel.tsx
+++ b/apps/web/src/components/editor/inspector/TemplatesBrowserPanel.tsx
@@ -61,32 +61,32 @@ const TemplateCard: React.FC<TemplateCardProps> = ({
return (
<div
onClick={onSelect}
- className={`relative p-3 rounded-lg border cursor-pointer transition-all ${
+ className={`relative p-3 rounded-lg border cursor-pointer transition-all w-full max-w-full box-border ${
isSelected
? "border-primary bg-primary/10 ring-1 ring-primary"
: "border-border bg-background-tertiary hover:border-primary/50"
}`}
>
- <div className="flex items-start gap-3">
+ <div className="flex items-start gap-3 w-full">
<div
- className={`w-10 h-10 rounded-lg flex items-center justify-center ${
+ className={`w-10 h-10 shrink-0 rounded-lg flex items-center justify-center ${
isSelected ? "bg-primary text-black" : "bg-background-secondary"
}`}
>
<Icon size={18} />
</div>
<div className="flex-1 min-w-0">
- <div className="flex items-center gap-2">
+ <div className="flex items-center gap-2 flex-wrap">
<span className="text-[11px] font-medium text-text-primary truncate">
{template.name}
</span>
{template.id.startsWith("builtin-") && (
- <span className="px-1.5 py-0.5 text-[8px] bg-status-info/20 text-status-info rounded">
+ <span className="px-1.5 py-0.5 text-[8px] bg-status-info/20 text-status-info rounded shrink-0">
Built-in
</span>
)}
{template.source === "cloud" && (
- <span className="px-1.5 py-0.5 text-[8px] bg-primary/20 text-primary rounded flex items-center gap-1">
+ <span className="px-1.5 py-0.5 text-[8px] bg-primary/20 text-primary rounded flex items-center gap-1 shrink-0">
<Cloud size={8} />
Cloud
</span>
@@ -325,7 +325,7 @@ export const TemplatesBrowserPanel: React.FC<TemplatesBrowserPanelProps> = ({
if (showVariablesPanel && loadedTemplate) {
return (
- <div className="space-y-4">
+ <div className="space-y-4 w-full min-w-0 max-w-full">
<button
onClick={handleBackToTemplates}
className="flex items-center gap-1.5 text-[10px] text-text-muted hover:text-text-primary transition-colors"
@@ -363,10 +363,10 @@ export const TemplatesBrowserPanel: React.FC<TemplatesBrowserPanelProps> = ({
}
return (
- <div className="space-y-4">
+ <div className="space-y-4 w-full min-w-0 max-w-full">
<div className="flex items-center gap-2 p-2 bg-primary/10 rounded-lg border border-primary/30">
- <FolderOpen size={16} className="text-primary" />
- <div>
+ <FolderOpen size={16} className="text-primary shrink-0" />
+ <div className="min-w-0 flex-1">
<span className="text-[11px] font-medium text-text-primary">
Templates
</span>
@@ -376,10 +376,10 @@ export const TemplatesBrowserPanel: React.FC<TemplatesBrowserPanelProps> = ({
</div>
</div>
- <div className="flex gap-1 overflow-x-auto pb-1">
+ <div className="flex gap-1 overflow-x-auto pb-1 -mx-1 px-1">
<button
onClick={() => setSelectedCategory("all")}
- className={`px-3 py-1.5 rounded-lg text-[10px] whitespace-nowrap transition-colors ${
+ className={`shrink-0 px-3 py-1.5 rounded-lg text-[10px] whitespace-nowrap transition-colors ${
selectedCategory === "all"
? "bg-primary text-black font-medium"
: "bg-background-tertiary text-text-secondary hover:text-text-primary"
@@ -393,7 +393,7 @@ export const TemplatesBrowserPanel: React.FC<TemplatesBrowserPanelProps> = ({
<button
key={category.id}
onClick={() => setSelectedCategory(category.id)}
- className={`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] whitespace-nowrap transition-colors ${
+ className={`shrink-0 flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] whitespace-nowrap transition-colors ${
selectedCategory === category.id
? "bg-primary text-black font-medium"
: "bg-background-tertiary text-text-secondary hover:text-text-primary"
@@ -412,7 +412,7 @@ export const TemplatesBrowserPanel: React.FC<TemplatesBrowserPanelProps> = ({
</div>
)}
- <div className="space-y-2 max-h-80 overflow-y-auto">
+ <div className="space-y-2 max-h-80 overflow-y-auto overflow-x-hidden">
{filteredTemplates.length === 0 ? (
<div className="text-center py-8">
<FolderOpen
diff --git a/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx b/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx
index 59f2bc5f..876d0e9f 100644
--- a/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx
+++ b/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx
@@ -197,7 +197,7 @@ export const TextToSpeechPanel: React.FC = () => {
const maxChars = 5000;
return (
- <div className="space-y-3">
+ <div className="space-y-3 w-full min-w-0 max-w-full">
<audio ref={audioRef} onEnded={handleAudioEnded} className="hidden" />
<div className="flex items-center gap-2 p-2 bg-primary/10 rounded-lg border border-primary/30">