mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-12 06:08:37 +00:00
floating error message
This commit is contained in:
parent
45b5b5960f
commit
7ab263b514
@ -46,6 +46,6 @@ currently broken / buggy:
|
||||
- [x] scheduler.getPhase is quantized to clock interval
|
||||
- => draw was choppy + that also caused useHighlighting bugs
|
||||
- [x] pianoroll keeps rolling when pressing stop
|
||||
- [ ] find a way to display errors when console is closed / another tab selected
|
||||
- [x] find a way to display errors when console is closed / another tab selected
|
||||
- [ ] highlighting out of range error is back (delete large chunk at the top while highlighting below is triggered)
|
||||
- [ ] idea: interpolate between running and evaluated code!
|
||||
|
||||
@ -109,21 +109,22 @@ function App() {
|
||||
const [isZen, setIsZen] = useState(false);
|
||||
const [pending, setPending] = useState(false);
|
||||
|
||||
const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop } = useStrudel({
|
||||
initialCode: '// LOADING',
|
||||
defaultOutput: webaudioOutput,
|
||||
getTime,
|
||||
autolink: true,
|
||||
beforeEval: () => {
|
||||
cleanupUi();
|
||||
cleanupDraw();
|
||||
setPending(true);
|
||||
},
|
||||
afterEval: () => {
|
||||
setPending(false);
|
||||
},
|
||||
onToggle: (play) => !play && cleanupDraw(false),
|
||||
});
|
||||
const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop, error } =
|
||||
useStrudel({
|
||||
initialCode: '// LOADING',
|
||||
defaultOutput: webaudioOutput,
|
||||
getTime,
|
||||
autolink: true,
|
||||
beforeEval: () => {
|
||||
cleanupUi();
|
||||
cleanupDraw();
|
||||
setPending(true);
|
||||
},
|
||||
afterEval: () => {
|
||||
setPending(false);
|
||||
},
|
||||
onToggle: (play) => !play && cleanupDraw(false),
|
||||
});
|
||||
|
||||
// init code
|
||||
useEffect(() => {
|
||||
@ -264,6 +265,9 @@ function App() {
|
||||
}}
|
||||
/>
|
||||
</section>
|
||||
{error && (
|
||||
<div className="text-red-500 p-4 bg-lineblack animate-pulse">{error.message || 'Unknown Error :-/'}</div>
|
||||
)}
|
||||
<Footer />
|
||||
</div>
|
||||
</AppContext.Provider>
|
||||
|
||||
@ -30,9 +30,6 @@ export function Footer() {
|
||||
useLogger(
|
||||
useCallback((e) => {
|
||||
const { message, type, data } = e.detail;
|
||||
if (type === 'error') {
|
||||
setActiveFooter('console');
|
||||
}
|
||||
setLog((l) => {
|
||||
const lastLog = l.length ? l[l.length - 1] : undefined;
|
||||
const id = nanoid(12);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user