From ae5029f33fcbcaffbd4bfd0de894aefb8c3278cd Mon Sep 17 00:00:00 2001 From: Gianpaolo Date: Wed, 19 Nov 2025 17:55:22 +0100 Subject: [PATCH] feat(transcript): add components for speaker, translations, and word wrappers - Introduced SpeakerWrapper for displaying speaker information and play button. - Created TranslationsWrapper for layout of content and translations. - Added WordWrapper for styling individual words in the transcript. - Integrated new components into TranscriptTheme for better organization. feat(transcript): implement translation loader and context management - Added TranslationLoader component to show loading state during translation processing. - Established context for managing tooltip modal references. - Created tools context for managing sentiment display and language preferences. feat(transcript): enhance video context and observation handling - Implemented VideoContext for managing open accordion state in video components. - Developed useSetStartTimeFromObservation hook to set video playback time based on URL observations. feat(transcript): add translation tools and preferred language handling - Created hooks for requesting translations and managing preferred language settings. - Integrated translation tools into the main transcript component for user interaction. feat(transcript): add SVG assets for sentiment indicators - Added SVG icons for positive, neutral, negative, very positive, and very negative sentiments. chore(transcript): refactor and organize transcript components - Refactored Transcript component to utilize new hooks and context for improved readability and maintainability. - Updated imports and component structure for better organization. --- src/common/Pages.tsx | 5 + src/pages/VideoShared/Actions.tsx | 144 +++++++ src/pages/VideoShared/Content.tsx | 24 ++ .../components/ConfirmDeleteModal.tsx | 77 ++++ .../VideoShared/components/NoObservations.tsx | 20 + .../VideoShared/components/Observation.tsx | 219 +++++++++++ .../components/ObservationForm.tsx | 357 ++++++++++++++++++ .../components/ObservationTooltip.tsx | 78 ++++ .../components/PageHeader/ShortcutHelper.tsx | 106 ++++++ .../components/PageHeader/UsecaseSelect.tsx | 103 +++++ .../components/PageHeader/VideoPagination.tsx | 81 ++++ .../components/PageHeader/index.tsx | 127 +++++++ .../PageHeader/useUsecaseWithVideos.tsx | 63 ++++ src/pages/VideoShared/components/Player.tsx | 199 ++++++++++ .../components/SentimentOverview/index.tsx | 91 +++++ .../components/TitleDropdownNew.tsx | 120 ++++++ .../components/Transcript/EmptyState.tsx | 41 ++ .../components/Transcript/Header.tsx | 71 ++++ .../TranscriptTheme/ActiveWrapper.tsx | 13 + .../TranscriptTheme/ObservationWrapper.tsx | 64 ++++ .../TranscriptTheme/ParagraphWrapper.tsx | 25 ++ .../TranscriptTheme/SentenceWrapper.tsx | 38 ++ .../TranscriptTheme/SentencesWrapper.tsx | 18 + .../TranscriptTheme/SentimentWrapper.tsx | 149 ++++++++ .../TranscriptTheme/SpeakerWrapper.tsx | 59 +++ .../TranscriptTheme/TranslationsWrapper.tsx | 16 + .../TranscriptTheme/WordWrapper.tsx | 16 + .../Transcript/TranscriptTheme/index.tsx | 33 ++ .../Transcript/TranslationLoader.tsx | 36 ++ .../components/Transcript/assets/negative.svg | 5 + .../components/Transcript/assets/neutral.svg | 5 + .../components/Transcript/assets/positive.svg | 5 + .../Transcript/assets/very_negative.svg | 5 + .../Transcript/assets/very_positive.svg | 5 + .../components/Transcript/index.tsx | 82 ++++ .../components/Transcript/useContent.tsx | 47 +++ .../components/Transcript/useObservations.tsx | 47 +++ src/pages/VideoShared/components/context.tsx | 40 ++ .../tools/assets/showSentimentIcon.svg | 14 + .../components/tools/context/ToolsContext.tsx | 48 +++ .../tools/hooks/useRequestTranslation.tsx | 51 +++ .../tools/hooks/useTranslationTools.tsx | 83 ++++ .../VideoShared/components/tools/index.tsx | 47 +++ .../components/tools/usePreferredLanguage.tsx | 17 + .../VideoShared/context/VideoContext.tsx | 42 +++ src/pages/VideoShared/index.tsx | 103 +++++ .../useSetStartTimeFromObservation.ts | 32 ++ 47 files changed, 3071 insertions(+) create mode 100644 src/pages/VideoShared/Actions.tsx create mode 100644 src/pages/VideoShared/Content.tsx create mode 100644 src/pages/VideoShared/components/ConfirmDeleteModal.tsx create mode 100644 src/pages/VideoShared/components/NoObservations.tsx create mode 100644 src/pages/VideoShared/components/Observation.tsx create mode 100644 src/pages/VideoShared/components/ObservationForm.tsx create mode 100644 src/pages/VideoShared/components/ObservationTooltip.tsx create mode 100644 src/pages/VideoShared/components/PageHeader/ShortcutHelper.tsx create mode 100644 src/pages/VideoShared/components/PageHeader/UsecaseSelect.tsx create mode 100644 src/pages/VideoShared/components/PageHeader/VideoPagination.tsx create mode 100644 src/pages/VideoShared/components/PageHeader/index.tsx create mode 100644 src/pages/VideoShared/components/PageHeader/useUsecaseWithVideos.tsx create mode 100644 src/pages/VideoShared/components/Player.tsx create mode 100644 src/pages/VideoShared/components/SentimentOverview/index.tsx create mode 100644 src/pages/VideoShared/components/TitleDropdownNew.tsx create mode 100644 src/pages/VideoShared/components/Transcript/EmptyState.tsx create mode 100644 src/pages/VideoShared/components/Transcript/Header.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/ActiveWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/ObservationWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/ParagraphWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/SentenceWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/SentencesWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/SentimentWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/SpeakerWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/TranslationsWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/WordWrapper.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranscriptTheme/index.tsx create mode 100644 src/pages/VideoShared/components/Transcript/TranslationLoader.tsx create mode 100644 src/pages/VideoShared/components/Transcript/assets/negative.svg create mode 100644 src/pages/VideoShared/components/Transcript/assets/neutral.svg create mode 100644 src/pages/VideoShared/components/Transcript/assets/positive.svg create mode 100644 src/pages/VideoShared/components/Transcript/assets/very_negative.svg create mode 100644 src/pages/VideoShared/components/Transcript/assets/very_positive.svg create mode 100644 src/pages/VideoShared/components/Transcript/index.tsx create mode 100644 src/pages/VideoShared/components/Transcript/useContent.tsx create mode 100644 src/pages/VideoShared/components/Transcript/useObservations.tsx create mode 100644 src/pages/VideoShared/components/context.tsx create mode 100644 src/pages/VideoShared/components/tools/assets/showSentimentIcon.svg create mode 100644 src/pages/VideoShared/components/tools/context/ToolsContext.tsx create mode 100644 src/pages/VideoShared/components/tools/hooks/useRequestTranslation.tsx create mode 100644 src/pages/VideoShared/components/tools/hooks/useTranslationTools.tsx create mode 100644 src/pages/VideoShared/components/tools/index.tsx create mode 100644 src/pages/VideoShared/components/tools/usePreferredLanguage.tsx create mode 100644 src/pages/VideoShared/context/VideoContext.tsx create mode 100644 src/pages/VideoShared/index.tsx create mode 100644 src/pages/VideoShared/useSetStartTimeFromObservation.ts diff --git a/src/common/Pages.tsx b/src/common/Pages.tsx index 730061d7e..cafaa0eac 100644 --- a/src/common/Pages.tsx +++ b/src/common/Pages.tsx @@ -28,6 +28,7 @@ import Profile from 'src/pages/Profile'; import Template from 'src/pages/Template'; import Templates from 'src/pages/Templates'; import Video from 'src/pages/Video'; +import VideoShared from 'src/pages/VideoShared'; import Videos from 'src/pages/Videos'; import { Redirect } from './Redirect'; @@ -111,6 +112,10 @@ const Pages = () => { path={`/${langPrefix}/campaigns/:campaignId/videos/:videoId`} element={