@@ -5916,25 +5916,63 @@ function _showAiReplyChoice(btn, em, data) {
// Full = layered concentric circles to suggest "more, deeper" — not a fully
// filled circle so it reads as a complement to the lightning, not as a "stop".
menu.innerHTML = `
-
-
-
- Fast
-
-
-
- Full
-
+
+
+
+
+ Fast
+
+
+
+ Full
+
+
+
+
+
+
+
+
+
+
+ Draft fast
+
+
+
+ Draft full
+
+
+
`;
+ const notePanel = menu.querySelector('[data-note-panel]');
+ const noteInput = menu.querySelector('[data-note-input]');
+ const noteActions = menu.querySelector('[data-note-actions]');
+ menu.querySelector('[data-act="note-toggle"]').addEventListener('click', (ev) => {
+ ev.preventDefault();
+ ev.stopPropagation();
+ const opening = notePanel.hasAttribute('hidden');
+ if (opening) {
+ notePanel.removeAttribute('hidden');
+ setTimeout(() => noteInput.focus(), 0);
+ } else {
+ notePanel.setAttribute('hidden', '');
+ }
+ });
+ noteInput.addEventListener('input', () => {
+ if (noteInput.value.trim()) noteActions.removeAttribute('hidden');
+ else noteActions.setAttribute('hidden', '');
+ });
menu.addEventListener('click', async (ev) => {
const choice = ev.target.closest('[data-mode]');
if (!choice) return;
ev.preventDefault();
ev.stopPropagation();
const mode = choice.getAttribute('data-mode') || 'ai-reply';
+ const useNote = choice.getAttribute('data-note') === '1';
+ const noteHint = useNote ? (noteInput.value || '').trim() : '';
_closeAiReplyChoice();
- await _runAiReplyFromButton(btn, em, data, mode);
+ await _runAiReplyFromButton(btn, em, data, mode, noteHint);
});
// Esc closes the popover; ignore plain clicks inside the menu so the
// textarea stays focused.