diff --git a/www/app/components/dashboard.js b/www/app/components/dashboard.js index cf5c75c0..9c73f6f3 100644 --- a/www/app/components/dashboard.js +++ b/www/app/components/dashboard.js @@ -15,43 +15,82 @@ 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} - +
+ ⬇ +
+
+ {topics.map((item, index) => ( +
+
setOpenIndex(openIndex === index ? null : index)} + > +
{item.timestamp}
+
+ {item.title} + +
-
+ {openIndex === index && ( +
+ {item.transcript} +
+ )}
- {openIndex === index && ( -
{item.transcript}
- )} -
- ))} + ))} + {topics.length === 0 && ( +
No topics yet
+ )} +
{finalSummary && ( -
+

Final Summary

Duration: {finalSummary.duration}

{finalSummary.summary}

@@ -59,7 +98,7 @@ export function Dashboard({ )}
-
+
 {transcriptionText} 
diff --git a/www/app/components/record.js b/www/app/components/record.js index 33ee8fb4..d1a71093 100644 --- a/www/app/components/record.js +++ b/www/app/components/record.js @@ -67,7 +67,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", () => { @@ -115,6 +115,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 9fcf0087..128d8703 100644 --- a/www/app/page.js +++ b/www/app/page.js @@ -16,8 +16,8 @@ const App = () => { serverData?.peer?.send(JSON.stringify({ cmd: "STOP" })); return ( -
-
+
+

Reflector

Capture The Signal, Not The Noise