mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-02-04 18:06:48 +00:00
transcript gutter
This commit is contained in:
@@ -6,6 +6,7 @@ import { formatTime } from "../../../../lib/time";
|
|||||||
import { getTopicColor } from "../../../../lib/topicColors";
|
import { getTopicColor } from "../../../../lib/topicColors";
|
||||||
import { TranscriptStatus } from "../../../../lib/transcript";
|
import { TranscriptStatus } from "../../../../lib/transcript";
|
||||||
import { featureEnabled } from "../../../../lib/features";
|
import { featureEnabled } from "../../../../lib/features";
|
||||||
|
import { TOPICS_SCROLL_DIV_ID } from "./constants";
|
||||||
|
|
||||||
type TopicListProps = {
|
type TopicListProps = {
|
||||||
topics: Topic[];
|
topics: Topic[];
|
||||||
@@ -50,13 +51,13 @@ export function TopicList({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const scrollToBottom = () => {
|
const scrollToBottom = () => {
|
||||||
const topicsDiv = document.getElementById("topics-scroll-div");
|
const topicsDiv = document.getElementById(TOPICS_SCROLL_DIV_ID);
|
||||||
if (topicsDiv) topicsDiv.scrollTop = topicsDiv.scrollHeight;
|
if (topicsDiv) topicsDiv.scrollTop = topicsDiv.scrollHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (autoscroll) {
|
if (autoscroll) {
|
||||||
const topicsDiv = document.getElementById("topics-scroll-div");
|
const topicsDiv = document.getElementById(TOPICS_SCROLL_DIV_ID);
|
||||||
topicsDiv && toggleScroll(topicsDiv);
|
topicsDiv && toggleScroll(topicsDiv);
|
||||||
}
|
}
|
||||||
}, [activeTopic, autoscroll]);
|
}, [activeTopic, autoscroll]);
|
||||||
@@ -110,7 +111,7 @@ export function TopicList({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
id="topics-scroll-div"
|
id={TOPICS_SCROLL_DIV_ID}
|
||||||
overflowY="auto"
|
overflowY="auto"
|
||||||
h="full"
|
h="full"
|
||||||
onScroll={handleScroll}
|
onScroll={handleScroll}
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
|||||||
<>
|
<>
|
||||||
<Grid
|
<Grid
|
||||||
templateColumns="1fr"
|
templateColumns="1fr"
|
||||||
templateRows="auto minmax(0, 1fr)"
|
templateRows="auto auto"
|
||||||
gap={4}
|
gap={4}
|
||||||
mt={4}
|
mt={4}
|
||||||
mb={4}
|
mb={4}
|
||||||
@@ -229,80 +229,89 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<Flex
|
<Grid
|
||||||
direction="column"
|
templateColumns={{ base: "minmax(0, 1fr)", md: "repeat(2, 1fr)" }}
|
||||||
|
templateRows={{
|
||||||
|
base: "auto auto auto",
|
||||||
|
md: "auto auto",
|
||||||
|
}}
|
||||||
gap={4}
|
gap={4}
|
||||||
|
gridRowGap={2}
|
||||||
padding={4}
|
padding={4}
|
||||||
paddingBottom={0}
|
|
||||||
background="gray.bg"
|
background="gray.bg"
|
||||||
border="2px solid"
|
border={"2px solid"}
|
||||||
borderColor="gray.bg"
|
borderColor={"gray.bg"}
|
||||||
borderRadius={8}
|
borderRadius={8}
|
||||||
>
|
>
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
<Flex direction="column" gap={0}>
|
<GridItem colSpan={{ base: 1, md: 2 }}>
|
||||||
<Flex alignItems="center" gap={2}>
|
<Flex direction="column" gap={0}>
|
||||||
<TranscriptTitle
|
<Flex alignItems="center" gap={2}>
|
||||||
title={transcript.data?.title || "Unnamed Transcript"}
|
<TranscriptTitle
|
||||||
transcriptId={transcriptId}
|
title={transcript.data?.title || "Unnamed Transcript"}
|
||||||
onUpdate={() => {
|
transcriptId={transcriptId}
|
||||||
transcript.refetch().then(() => {});
|
onUpdate={() => {
|
||||||
}}
|
transcript.refetch().then(() => {});
|
||||||
transcript={transcript.data || null}
|
}}
|
||||||
topics={topics.topics}
|
transcript={transcript.data || null}
|
||||||
finalSummaryElement={finalSummaryElement}
|
topics={topics.topics}
|
||||||
/>
|
finalSummaryElement={finalSummaryElement}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
{mp3.audioDeleted && (
|
||||||
|
<Text fontSize="xs" color="gray.600" fontStyle="italic">
|
||||||
|
No audio is available because one or more participants didn't
|
||||||
|
consent to keep the audio
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
{mp3.audioDeleted && (
|
</GridItem>
|
||||||
<Text fontSize="xs" color="gray.600" fontStyle="italic">
|
|
||||||
No audio is available because one or more participants didn't
|
{/* Left column: Topics List */}
|
||||||
consent to keep the audio
|
<GridItem display="flex" flexDirection="column" gap={4} h="100%">
|
||||||
</Text>
|
<TopicList
|
||||||
|
topics={topics.topics || []}
|
||||||
|
useActiveTopic={useActiveTopic}
|
||||||
|
autoscroll={false}
|
||||||
|
transcriptId={transcriptId}
|
||||||
|
status={transcript.data?.status || null}
|
||||||
|
currentTranscriptText=""
|
||||||
|
onTopicClick={handleTopicClick}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Transcript with colored gutter (scrollable) */}
|
||||||
|
{topics.topics && topics.topics.length > 0 && (
|
||||||
|
<Box
|
||||||
|
overflowY="auto"
|
||||||
|
flex={1}
|
||||||
|
minH="0"
|
||||||
|
pr={2}
|
||||||
|
css={{
|
||||||
|
"&::-webkit-scrollbar": {
|
||||||
|
width: "8px",
|
||||||
|
},
|
||||||
|
"&::-webkit-scrollbar-track": {
|
||||||
|
background: "transparent",
|
||||||
|
},
|
||||||
|
"&::-webkit-scrollbar-thumb": {
|
||||||
|
background: "#CBD5E0",
|
||||||
|
borderRadius: "4px",
|
||||||
|
},
|
||||||
|
"&::-webkit-scrollbar-thumb:hover": {
|
||||||
|
background: "#A0AEC0",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TranscriptWithGutter
|
||||||
|
topics={topics.topics}
|
||||||
|
getSpeakerName={getSpeakerName}
|
||||||
|
onGutterClick={handleGutterClick}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</GridItem>
|
||||||
|
|
||||||
{/* Topics List (top section - fixed height, scrollable) */}
|
{/* Right column: Final Summary */}
|
||||||
<TopicList
|
|
||||||
topics={topics.topics || []}
|
|
||||||
useActiveTopic={useActiveTopic}
|
|
||||||
autoscroll={false}
|
|
||||||
transcriptId={transcriptId}
|
|
||||||
status={transcript.data?.status || null}
|
|
||||||
currentTranscriptText=""
|
|
||||||
onTopicClick={handleTopicClick}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Transcript with colored gutter (bottom section - scrollable container) */}
|
|
||||||
{topics.topics && topics.topics.length > 0 && (
|
|
||||||
<Box
|
|
||||||
overflowY="auto"
|
|
||||||
maxH="600px"
|
|
||||||
pr={2}
|
|
||||||
css={{
|
|
||||||
"&::-webkit-scrollbar": {
|
|
||||||
width: "8px",
|
|
||||||
},
|
|
||||||
"&::-webkit-scrollbar-track": {
|
|
||||||
background: "transparent",
|
|
||||||
},
|
|
||||||
"&::-webkit-scrollbar-thumb": {
|
|
||||||
background: "#CBD5E0",
|
|
||||||
borderRadius: "4px",
|
|
||||||
},
|
|
||||||
"&::-webkit-scrollbar-thumb:hover": {
|
|
||||||
background: "#A0AEC0",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TranscriptWithGutter
|
|
||||||
topics={topics.topics}
|
|
||||||
getSpeakerName={getSpeakerName}
|
|
||||||
onGutterClick={handleGutterClick}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Final Summary (at bottom) */}
|
|
||||||
{transcript.data && topics.topics ? (
|
{transcript.data && topics.topics ? (
|
||||||
<FinalSummary
|
<FinalSummary
|
||||||
transcript={transcript.data}
|
transcript={transcript.data}
|
||||||
@@ -313,7 +322,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
|||||||
finalSummaryRef={setFinalSummaryElement}
|
finalSummaryRef={setFinalSummaryElement}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Flex justify="center" alignItems="center" h="200px">
|
<Flex justify="center" alignItems="center" h="100%">
|
||||||
<Flex direction="column" h="full" justify="center" align="center">
|
<Flex direction="column" h="full" justify="center" align="center">
|
||||||
{transcript?.data?.status == "processing" ? (
|
{transcript?.data?.status == "processing" ? (
|
||||||
<Text>Loading Transcript</Text>
|
<Text>Loading Transcript</Text>
|
||||||
@@ -326,7 +335,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user