diff --git a/repl/README.md b/repl/README.md index ee7c4842..e3e2b0b8 100644 --- a/repl/README.md +++ b/repl/README.md @@ -44,3 +44,4 @@ currently broken / buggy: - [x] highlighting sometimes drops highlights (zeldasRescue first note) - [ ] highlighting still sometimes drops highlights (zeldasRescue somtimes) - [ ] highlighting out of range error is back (delete large chunk at the top while highlighting below is triggered) +- [ ] find a way to display errors when console is closed / another tab selected diff --git a/repl/src/App.jsx b/repl/src/App.jsx index d782160d..5edb72ce 100644 --- a/repl/src/App.jsx +++ b/repl/src/App.jsx @@ -24,6 +24,7 @@ import StopCircleIcon from '@heroicons/react/20/solid/StopCircleIcon'; import CommandLineIcon from '@heroicons/react/20/solid/CommandLineIcon'; import SparklesIcon from '@heroicons/react/20/solid/SparklesIcon'; import LinkIcon from '@heroicons/react/20/solid/LinkIcon'; +import XMarkIcon from '@heroicons/react/20/solid/XMarkIcon'; import AcademicCapIcon from '@heroicons/react/20/solid/AcademicCapIcon'; initAudioOnFirstClick(); @@ -98,6 +99,7 @@ const isEmbedded = window.location !== window.parent.location; function App() { const [view, setView] = useState(); // codemirror view const [lastShared, setLastShared] = useState(); + const [activeFooter, setActiveFooter] = useState('console'); // logger const [log, setLog] = useState([]); @@ -121,11 +123,11 @@ function App() { }); }, []), ); - const logBox = useRef(); + const footerContent = useRef(); useLayoutEffect(() => { - if (logBox.current) { + if (footerContent.current) { // scroll log box to bottom when log changes - logBox.current.scrollTop = logBox.current?.scrollHeight; + footerContent.current.scrollTop = footerContent.current?.scrollHeight; } }, [log]); @@ -235,9 +237,30 @@ function App() { started && logger('[edit] code changed. hit ctrl+enter to update'); }; + const FooterTab = ({ label, children, type }) => ( + <> +