mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-24 21:38:18 +00:00
fix(comment): restrict timestamp capture toggle and badges to video files
This commit is contained in:
@@ -3,11 +3,11 @@ import type { UserInfo } from '@/dtos/team'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/ui/components/ui/dialog'
|
||||
import { Separator } from '@/ui/components/ui/separator'
|
||||
import { formatTimeAgo } from '@/ui/lib/time'
|
||||
|
||||
@@ -709,15 +709,17 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
|
||||
multiple
|
||||
onChange={handleFileSelect}
|
||||
/>
|
||||
<Button
|
||||
onClick={() => setIsTimestampEnabled(!isTimestampEnabled)}
|
||||
variant={isTimestampEnabled ? 'secondary' : 'ghost'}
|
||||
size="icon"
|
||||
className={`p-2 rounded-full cursor-pointer ${isTimestampEnabled ? 'text-blue-600 bg-blue-50 dark:bg-blue-900/20' : ''}`}
|
||||
title={isTimestampEnabled ? 'Disable Timestamp' : 'Enable Timestamp'}
|
||||
>
|
||||
<Clock className="w-4 h-4" />
|
||||
</Button>
|
||||
{currentTime !== undefined && frameRate !== undefined && (
|
||||
<Button
|
||||
onClick={() => setIsTimestampEnabled(!isTimestampEnabled)}
|
||||
variant={isTimestampEnabled ? 'secondary' : 'ghost'}
|
||||
size="icon"
|
||||
className={`p-2 rounded-full cursor-pointer ${isTimestampEnabled ? 'text-blue-600 bg-blue-50 dark:bg-blue-900/20' : ''}`}
|
||||
title={isTimestampEnabled ? 'Disable Timestamp' : 'Enable Timestamp'}
|
||||
>
|
||||
<Clock className="w-4 h-4" />
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
onClick={() => fileInputRef.current?.click()}
|
||||
className="p-2 rounded-full cursor-pointer"
|
||||
|
||||
@@ -331,7 +331,7 @@ export function FileViewerRightSidebar({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<Tabs defaultValue="comments" className="p-4 flex-1 flex flex-col px-2 min-h-0">
|
||||
<Tabs defaultValue="comments" className="p-1 flex-1 flex flex-col px-2 min-h-0">
|
||||
<TabsList className="w-full shrink-0">
|
||||
<TabsTrigger value="comments" className="flex-1">
|
||||
Comments
|
||||
@@ -352,7 +352,11 @@ export function FileViewerRightSidebar({
|
||||
onReply={setReplyingTo}
|
||||
onViewAttachment={setViewingAttachment}
|
||||
hasReplies={!!comment.replies?.length}
|
||||
frameRate={file?.media?.metadata?.frameRate || 30}
|
||||
frameRate={
|
||||
file?.mediaType?.startsWith('video/')
|
||||
? file?.media?.metadata?.frameRate || 30
|
||||
: undefined
|
||||
}
|
||||
isSelected={selectedCommentId === comment.id}
|
||||
onSelect={() => {
|
||||
onCommentSelect?.(comment)
|
||||
@@ -369,7 +373,11 @@ export function FileViewerRightSidebar({
|
||||
onViewAttachment={setViewingAttachment}
|
||||
hasReplies={false}
|
||||
isLastReply={index === (comment.replies?.length ?? 0) - 1}
|
||||
frameRate={file?.media?.metadata?.frameRate || 30}
|
||||
frameRate={
|
||||
file?.mediaType?.startsWith('video/')
|
||||
? file?.media?.metadata?.frameRate || 30
|
||||
: undefined
|
||||
}
|
||||
isSelected={selectedCommentId === reply.id}
|
||||
onSelect={() => {
|
||||
onCommentSelect?.(reply)
|
||||
@@ -398,8 +406,12 @@ export function FileViewerRightSidebar({
|
||||
bots={enabledBots}
|
||||
hideAnnotationControl={hideAnnotationControl}
|
||||
disableMentions={isPublic}
|
||||
currentTime={currentTime}
|
||||
frameRate={file?.media?.metadata?.frameRate || 30}
|
||||
currentTime={file?.mediaType?.startsWith('video/') ? currentTime : undefined}
|
||||
frameRate={
|
||||
file?.mediaType?.startsWith('video/')
|
||||
? file?.media?.metadata?.frameRate || 30
|
||||
: undefined
|
||||
}
|
||||
onTyping={onTyping}
|
||||
/>
|
||||
</GuestIdentityPopup>
|
||||
|
||||
Reference in New Issue
Block a user