Moxie Demo buttons open the new chat page; chat: seamless restart after session timeout
This commit is contained in:
parent
d43680135a
commit
d44a1118ae
@ -424,7 +424,7 @@
|
|||||||
messages = [];
|
messages = [];
|
||||||
try { sessionStorage.removeItem(STORAGE_KEY); } catch (e) { }
|
try { sessionStorage.removeItem(STORAGE_KEY); } catch (e) { }
|
||||||
welcome.style.display = '';
|
welcome.style.display = '';
|
||||||
countdownEl.textContent = '10:00';
|
countdownEl.textContent = formatCountdown(SESSION_TIMEOUT_MS);
|
||||||
countdownEl.classList.remove('session-warn');
|
countdownEl.classList.remove('session-warn');
|
||||||
addSystemPill('Your session timed out after 10 minutes of inactivity — this chat was cleared. Say hello to start a new one.');
|
addSystemPill('Your session timed out after 10 minutes of inactivity — this chat was cleared. Say hello to start a new one.');
|
||||||
chatScroll.scrollTop = chatScroll.scrollHeight;
|
chatScroll.scrollTop = chatScroll.scrollHeight;
|
||||||
@ -514,15 +514,16 @@
|
|||||||
|
|
||||||
async function send(text) {
|
async function send(text) {
|
||||||
const prompt = (text || '').trim();
|
const prompt = (text || '').trim();
|
||||||
if (!prompt || generating || expired) return;
|
if (!prompt || generating) return;
|
||||||
|
if (expired) newChat(); // typing after a timeout seamlessly starts a fresh session
|
||||||
|
|
||||||
hideWelcome();
|
hideWelcome();
|
||||||
touchSession();
|
|
||||||
|
|
||||||
// User bubble
|
// User bubble
|
||||||
const userBubble = addMessageRow('user');
|
const userBubble = addMessageRow('user');
|
||||||
userBubble.textContent = prompt;
|
userBubble.textContent = prompt;
|
||||||
messages.push({ role: 'user', content: prompt });
|
messages.push({ role: 'user', content: prompt });
|
||||||
|
touchSession(); // persist the user message immediately, not only after the reply
|
||||||
input.value = '';
|
input.value = '';
|
||||||
autosize();
|
autosize();
|
||||||
chatScroll.scrollTop = chatScroll.scrollHeight;
|
chatScroll.scrollTop = chatScroll.scrollHeight;
|
||||||
|
|||||||
@ -1310,7 +1310,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="flex items-center gap-x-8 text-sm font-medium">
|
<div class="flex items-center gap-x-8 text-sm font-medium">
|
||||||
<a href="#benefits" class="hover:text-emerald-400">How It Works</a>
|
<a href="#benefits" class="hover:text-emerald-400">How It Works</a>
|
||||||
<a href="https://ai.moxiegen.com/" class="hover:text-emerald-400">Moxie Demo</a>
|
<a href="chat.html" class="hover:text-emerald-400">Moxie Demo</a>
|
||||||
<button onclick="openWhitepaper()" class="hover:text-emerald-400 flex items-center gap-1.5">
|
<button onclick="openWhitepaper()" class="hover:text-emerald-400 flex items-center gap-1.5">
|
||||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
@ -1374,7 +1374,7 @@
|
|||||||
<button onclick="document.getElementById('contact').scrollIntoView({ behavior: 'smooth' })"
|
<button onclick="document.getElementById('contact').scrollIntoView({ behavior: 'smooth' })"
|
||||||
class="px-10 py-5 bg-emerald-400 hover:bg-emerald-300 text-slate-950 text-xl font-semibold rounded-3xl flex items-center gap-x-3">Get
|
class="px-10 py-5 bg-emerald-400 hover:bg-emerald-300 text-slate-950 text-xl font-semibold rounded-3xl flex items-center gap-x-3">Get
|
||||||
Moxie <span class="text-3xl leading-none">→</span></button>
|
Moxie <span class="text-3xl leading-none">→</span></button>
|
||||||
<a href="https://ai.moxiegen.com/"
|
<a href="chat.html"
|
||||||
class="px-8 py-5 border border-white/30 hover:border-white/60 text-xl font-medium rounded-3xl flex items-center">Moxie
|
class="px-8 py-5 border border-white/30 hover:border-white/60 text-xl font-medium rounded-3xl flex items-center">Moxie
|
||||||
Demo</a>
|
Demo</a>
|
||||||
<button onclick="openWhitepaper()"
|
<button onclick="openWhitepaper()"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user