Commit 12e79c3d by michaelpastushkov

fix

parent b9350974
...@@ -198,9 +198,11 @@ ...@@ -198,9 +198,11 @@
position: fixed; position: fixed;
right: 1rem; right: 1rem;
bottom: calc(var(--footer-h) + .75rem + var(--composer-h)); bottom: calc(var(--footer-h) + .75rem + var(--composer-h));
/* hover above composer+footer */
z-index: 1100; z-index: 1100;
/* above composer/footer */ /* above composer/footer */
display: none; display: none;
/* hidden initially */
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border: 1px solid #ced4da; border: 1px solid #ced4da;
...@@ -252,7 +254,7 @@ ...@@ -252,7 +254,7 @@
<div class="composer py-3"> <div class="composer py-3">
<div class="container"> <div class="container">
<form id="promptForm" class="d-flex flex-column gap-2"> <form id="promptForm" class="d-flex flex-column gap-2">
<!-- Single row: textarea + Go/Stop (scroll button removed from here) --> <!-- Single row: textarea + Go/Stop -->
<div class="composer-row"> <div class="composer-row">
<textarea id="inputText" class="form-control" rows="1" placeholder=""></textarea> <textarea id="inputText" class="form-control" rows="1" placeholder=""></textarea>
<button id="goBtn" class="btn btn-primary" type="submit"></button> <button id="goBtn" class="btn btn-primary" type="submit"></button>
...@@ -265,7 +267,7 @@ ...@@ -265,7 +267,7 @@
<!-- Fixed, non-scrollable footer --> <!-- Fixed, non-scrollable footer -->
<footer id="disclaimer"></footer> <footer id="disclaimer"></footer>
<!-- Floating scroll-to-bottom button --> <!-- Floating scroll button -->
<button id="scrollDownBtn" type="button" aria-label="Scroll down" title="Scroll down"> <button id="scrollDownBtn" type="button" aria-label="Scroll down" title="Scroll down">
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"> <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path <path
...@@ -381,6 +383,7 @@ ...@@ -381,6 +383,7 @@
function updateScrollButton() { function updateScrollButton() {
const needs = isOverflowingAny() && !atBottom(); const needs = isOverflowingAny() && !atBottom();
// hidden initially (no overflow) and whenever you’re at the bottom
scrollDownBtn.style.display = needs ? 'inline-flex' : 'none'; scrollDownBtn.style.display = needs ? 'inline-flex' : 'none';
} }
...@@ -452,7 +455,7 @@ ...@@ -452,7 +455,7 @@
const { value, done } = await reader.read(); const { value, done } = await reader.read();
if (done) break; if (done) break;
const chunk = decoder.decode(value, { stream: true }); const chunk = decoder.decode(value, { stream: true });
rawMarkdown += chunk; // append chunk rawMarkdown += chunk; // append streamed chunk
flush(); flush();
} }
flush(); flush();
...@@ -504,7 +507,7 @@ ...@@ -504,7 +507,7 @@
try { await fetch('/api/clear', { method: 'GET' }); } catch (_) { } try { await fetch('/api/clear', { method: 'GET' }); } catch (_) { }
await loadLocale(CURRENT_LOCALE); await loadLocale(CURRENT_LOCALE);
inputText.focus(); inputText.focus();
updateScrollButton(); // initial updateScrollButton(); // initial -> hidden if no overflow
}); });
</script> </script>
</body> </body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment