forked from 77media/video-flow
点击视频编辑按钮会跳到第一个分镜,应该修改跳转到当前分镜
This commit is contained in:
parent
eccb0a3e53
commit
6d703aef5e
@ -268,7 +268,7 @@ export function InputBar({ onSend, setVideoPreview, initialVideoUrl, initialVide
|
||||
<motion.div layout key="text-input" className="flex-1 flex">
|
||||
<textarea
|
||||
ref={textareaRef}
|
||||
placeholder="输入文字…"
|
||||
placeholder="Describe your idea..."
|
||||
className="w-full pl-2 pr-2 py-4 rounded-2 leading-4 text-sm border-none bg-transparent text-white placeholder:text-white/[0.40] focus:outline-none resize-none min-h-[48px] max-h-[120px] overflow-y-auto"
|
||||
rows={1}
|
||||
value={text}
|
||||
|
||||
@ -176,13 +176,6 @@ export default function SmartChatBox({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Error message */}
|
||||
{error && (
|
||||
<div className="text-red-500 text-center py-2 text-sm">
|
||||
{error.message}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Back to latest button */}
|
||||
{isViewingHistory && !isAtBottom && (
|
||||
<BackToLatestButton onClick={backToLatest} />
|
||||
|
||||
@ -63,15 +63,16 @@ export const ShotTabContent = forwardRef<
|
||||
const [updateData, setUpdateData] = useState<VideoSegmentEntity[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('shotTabContent-----shotData', shotData);
|
||||
}, [shotData]);
|
||||
console.log('shotTabContent-----selectedSegment', selectedSegment);
|
||||
}, [selectedSegment]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('-==========shotData===========-', shotData);
|
||||
console.log('-==========shotTabContent===========-', shotData, currentSketchIndex, originalVideos);
|
||||
// 只在初始化且有角色数据时执行
|
||||
if (isInitialized && shotData.length > 0) {
|
||||
setIsInitialized(false);
|
||||
setSelectedSegment(shotData[0]);
|
||||
const defaultSelectIndex = currentSketchIndex >= shotData.length ? 0 : currentSketchIndex;
|
||||
setSelectedSegment(shotData[defaultSelectIndex]);
|
||||
}
|
||||
}, [shotData, isInitialized]);
|
||||
|
||||
@ -118,7 +119,6 @@ export const ShotTabContent = forwardRef<
|
||||
// 清空检测状态 和 检测结果
|
||||
setScanState('idle');
|
||||
setDetections([]);
|
||||
setSelectedSegment(shotData[0]);
|
||||
}
|
||||
}, [shotData, selectedSegment]);
|
||||
|
||||
@ -314,7 +314,7 @@ export const ShotTabContent = forwardRef<
|
||||
<HorizontalScroller
|
||||
itemWidth={128}
|
||||
gap={0}
|
||||
selectedIndex={originalVideos.findIndex(shot => selectedSegment?.videoUrl.some(url => url.video_id === shot.video_id))}
|
||||
selectedIndex={originalVideos.findIndex(shot => selectedSegment?.id === shot.video_id)}
|
||||
onItemClick={(i: number) => handleSelectShot(i)}
|
||||
>
|
||||
{originalVideos.map((shot, index) => (
|
||||
@ -322,7 +322,7 @@ export const ShotTabContent = forwardRef<
|
||||
key={shot.video_id || index}
|
||||
className={cn(
|
||||
'relative flex-shrink-0 w-32 aspect-video rounded-lg overflow-hidden cursor-pointer group',
|
||||
selectedSegment?.videoUrl.some(url => url.video_id === shot.video_id) ? 'ring-2 ring-blue-500' : 'hover:ring-2 hover:ring-blue-500/50'
|
||||
selectedSegment?.id === shot.video_id ? 'ring-2 ring-blue-500' : 'hover:ring-2 hover:ring-blue-500/50'
|
||||
)}
|
||||
whileHover={{ scale: 1.02 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
@ -361,11 +361,11 @@ export const ShotTabContent = forwardRef<
|
||||
<HorizontalScroller
|
||||
itemWidth={'auto'}
|
||||
gap={0}
|
||||
selectedIndex={originalVideos.findIndex(shot => selectedSegment?.videoUrl.some(url => url.video_id === shot.video_id))}
|
||||
selectedIndex={originalVideos.findIndex(shot => selectedSegment?.id === shot.video_id)}
|
||||
onItemClick={(i: number) => handleSelectShot(i)}
|
||||
>
|
||||
{originalVideos.map((shot, index) => {
|
||||
const isActive = selectedSegment?.videoUrl.some(url => url.video_id === shot.video_id);
|
||||
const isActive = selectedSegment?.id === shot.video_id;
|
||||
return (
|
||||
<motion.div
|
||||
key={shot.video_id || index}
|
||||
@ -611,3 +611,5 @@ export const ShotTabContent = forwardRef<
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
ShotTabContent.displayName = 'ShotTabContent';
|
||||
Loading…
x
Reference in New Issue
Block a user