diff --git a/www/app/components/dashboard.js b/www/app/components/dashboard.js index d0b569ac..ef4ac5df 100644 --- a/www/app/components/dashboard.js +++ b/www/app/components/dashboard.js @@ -12,38 +12,59 @@ export function Dashboard({ stream, }) { const [openIndex, setOpenIndex] = useState(null); + const [autoscrollEnabled, setAutoscrollEnabled] = useState(true); + + useEffect(() => { + if (autoscrollEnabled) scrollToBottom(); + }, [topics.length]); + + const scrollToBottom = () => { + const topicsDiv = document.getElementById("topics-div"); + topicsDiv.scrollTop = topicsDiv.scrollHeight; + }; + + const handleScroll = (e) => { + const bottom = e.target.scrollHeight - e.target.scrollTop === e.target.clientHeight; + if (!bottom && autoscrollEnabled) { + setAutoscrollEnabled(false); + } else if (bottom && !autoscrollEnabled) { + setAutoscrollEnabled(true); + } + }; return ( <> -
-
+
+

Meeting Notes

-
Timestamp
-
Topic
-
+
Timestamp
+
Topic
-
+
+
{topics.map((item, index) => ( -
+
setOpenIndex(openIndex === index ? null : index)} >
{item.timestamp}
-
+
{item.title}
-
{openIndex === index && ( -
{item.transcript}
+
{item.transcript}
)}
))} @@ -53,7 +74,7 @@ export function Dashboard({
{finalSummary && ( -
+

Final Summary

Duration: {finalSummary.duration}

{finalSummary.summary}

@@ -61,7 +82,7 @@ export function Dashboard({ )}
-
+
 {transcriptionText} 
diff --git a/www/app/components/record.js b/www/app/components/record.js index cb3b03f8..e9d5e26b 100644 --- a/www/app/components/record.js +++ b/www/app/components/record.js @@ -66,7 +66,7 @@ export default function Recorder(props) { }); const wsWrapper = _wavesurfer.getWrapper(); wsWrapper.style.cursor = "pointer"; - wsWrapper.style.backgroundColor = "lightgray"; + wsWrapper.style.backgroundColor = "#e0c3fc42"; wsWrapper.style.borderRadius = "15px"; _wavesurfer.on("play", () => { @@ -114,6 +114,7 @@ export default function Recorder(props) {  
-
+
{/* TODO: Download audio tag */} + {/* TODO: current time / audio duration */}
); } diff --git a/www/app/globals.scss b/www/app/globals.scss index 016ef0b5..c24395c8 100644 --- a/www/app/globals.scss +++ b/www/app/globals.scss @@ -18,3 +18,10 @@ body { background: beige; border-radius: 5px; } + +.Dropdown-placeholder { + text-wrap: nowrap; +} +.Dropdown-arrow { + top: 47% !important; +} diff --git a/www/app/page.js b/www/app/page.js index 7e05b066..5dbe3fd5 100644 --- a/www/app/page.js +++ b/www/app/page.js @@ -15,7 +15,7 @@ const App = () => { const sendStopCmd = () => serverData?.peer?.send(JSON.stringify({ cmd: "STOP" })) return ( -
+

Reflector

Capture The Signal, Not The Noise