Add a swaying question mark beside Ask for suggestions and a chevron before Send

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-12 07:54:26 -08:00
1 parent 54b316cdf3
commit 97b5df61ea
7 files changed
+42 -1

No files matched your search

+3
View File
@@ -4234,6 +4234,9 @@
<span class="hint" id="send-hint"></span>
<button type="button" class="btn ghost" id="btn-clear" hidden>Clear</button>
<button type="button" class="btn" id="btn-dashboard" hidden>Back to the dashboard</button>
<span class="nudge send-nudge" id="send-nudge" aria-hidden="true" hidden>
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3l5 5-5 5" /></svg>
</span>
<button type="button" class="btn primary" id="btn-send" disabled>Send to Plan2Code</button>
</div>
</footer>
+16 -1
View File
@@ -798,7 +798,11 @@ export function renderAside() {
const attached = noteImages(item.id);
const row = attachRow(item.id, "Add files to this note");
if (!loopDriving() && !isDashboard() && SUGGEST_KINDS.includes(item.kind)) row.appendChild(suggestChip(item));
if (!loopDriving() && !isDashboard() && SUGGEST_KINDS.includes(item.kind)) {
const chip = suggestChip(item);
if (!chip.disabled) row.appendChild(suggestNudge());
row.appendChild(chip);
}
wrap.appendChild(row);
if (attached.length) wrap.appendChild(attachTray(item.id, attached));
@@ -851,6 +855,17 @@ function suggestChip(item) {
return chip;
}
// The question mark that sways beside a live Ask for suggestions chip, so the
// chip is noticed. The panel is redrawn often, so the sway starts where the
// clock says it should be: a fresh mark never jumps back to its first frame.
const NUDGE_CYCLE_MS = 2800;
function suggestNudge() {
const mark = el("span", "nudge suggest-nudge", "?");
mark.setAttribute("aria-hidden", "true");
mark.style.animationDelay = `-${Math.round(performance.now() % NUDGE_CYCLE_MS)}ms`;
return mark;
}
// The label on a note that is sent and not yet picked up, with the page's small
// ring in front so it is plain Plan2Code is still on it. Like the Ask reply
// line, no ring once the agent has gone quiet: a turning ring would pass a
+3
View File
@@ -1936,6 +1936,8 @@ export function renderFooter() {
const sendIsStep = !state.disabled && !unanswered().length;
btn.classList.toggle("primary", state.disabled || sendIsStep);
btn.classList.toggle("standby", !state.disabled && !sendIsStep);
// The chevron before Send sways only while Send is the filled, live step.
$("send-nudge").hidden = !sendIsStep;
const hint = $("send-hint");
hint.replaceChildren();
@@ -2173,6 +2175,7 @@ export async function send() {
const btn = $("btn-send");
btn.disabled = true;
$("send-nudge").hidden = true;
btn.textContent = "Sending…";
try {
const res = await fetch("/submit", {
+16
View File
@@ -483,6 +483,22 @@ input[type="text"].invalid, .md-host.invalid { border-color: var(--warn); }
100% { box-shadow: var(--glow), 0 0 0 6px transparent; }
}
#btn-send.primary:not(:disabled) { animation: send-pulse 2.4s ease-out infinite; }
/* A small accent mark that sways toward the button on its right: the chevron
before Send once Send is the step, the question mark before a live Ask for
suggestions. One sway there and back is 2.8s (NUDGE_CYCLE_MS in ask.js);
reduced motion holds it still. */
.nudge {
flex: none; display: inline-flex; align-items: center; justify-content: center;
color: var(--accent); pointer-events: none; user-select: none;
animation: nudge-sway 1.4s ease-in-out infinite alternate;
}
.nudge[hidden] { display: none; }
@keyframes nudge-sway {
from { transform: translateX(-3px); }
to { transform: translateX(3px); }
}
.suggest-nudge { font-size: 15px; font-weight: 800; line-height: 1; }
.send-nudge svg { width: 16px; height: 16px; display: block; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.danger { border-color: var(--warn); color: var(--warn); }
@@ -95,6 +95,7 @@
still, the working star included. */
.help-mood-bot, .help-mood-bot *, .help-mood-bot.is-work .eye { animation: none !important; }
#btn-send { animation: none; }
.nudge { animation: none; }
}
/* User Preferences: action rows (Cleanup's scan/delete buttons share this
+2
View File
@@ -441,6 +441,8 @@ h1 {
.attach-row { display: flex; align-items: center; margin: -4px 0 6px -13px; }
.attach-row.is-under { margin: 6px 0 4px -13px; }
.attach-row .suggest-chip { margin: 0 0 0 auto; }
.attach-row .suggest-nudge { margin-left: auto; }
.attach-row .suggest-nudge + .suggest-chip { margin-left: 9px; }
.msg .suggest-tag {
display: inline-block; margin-bottom: 4px;
background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line);