fix(editor): AI composer 400, slash-menu arrows, drag handle, block outline, hint
- AI (space) -> 400 DeepSeek: fdAgent.generate now uses the clean no-tools /api/agent/generate endpoint instead of the tool-enabled conversation engine (which sends tools/tool_choice schemas DeepSeek rejects). Fixes the composer, Ask AI, AI meeting note and summarize flows. - Slash menu arrows: selection highlight was invisible on open (nothing marked), so up/down appeared dead. Call _rs() on open + after filtering, and give the selected item an accent background + left bar. Verified with jsdom harness: Down/Up move selection, Enter applies. - Block outline when selected: suppress focus rings (outline/box-shadow) on all editable blocks ([data-bid], .block-content, page title). - Drag handle (6-dot): add .block-wrapper:hover/:focus-within .block-handle so it shows on hover for normal blocks (only column-wrappers showed it before). - Empty-block hint: brighter (--text-secondary, opacity .75) so the "Press space for AI or / for commands" text is clearly visible on empty paras. - VERSION + app.main -> 5.1.3; CHANGELOG updated. - 271 tests pass; page renders 200; /api/agent/generate route registered; JS validated (node --check + jsdom).
This commit is contained in:
@@ -238,7 +238,7 @@
|
||||
const r=el.getBoundingClientRect();SM._e.style.display='flex';
|
||||
SM._e.style.top=Math.max(4,(r.bottom+4>window.innerHeight-360)?r.top-364:r.bottom+4)+'px';
|
||||
SM._e.style.left=Math.min(r.left,window.innerWidth-340)+'px';
|
||||
setTimeout(()=>SM._in.focus(),10);SM._o=true;},
|
||||
SM._rs();setTimeout(()=>SM._in.focus(),10);SM._o=true;},
|
||||
close(){if(SM._e)SM._e.style.display='none';SM._o=false;SM._in&&(SM._in.value='');if(SM._pv)SM._pv.style.display='none';},
|
||||
flt(){if(!SM._li)return;SM._it=[];const q=(SM._in.value||'').toLowerCase();SM._q=q;let h='';
|
||||
for(const g of CMDS){let items=g.items;if(q)items=items.filter(c=>c.name.toLowerCase().includes(q)||c.id.includes(q));if(!items.length)continue;
|
||||
@@ -248,7 +248,7 @@
|
||||
<span class="slash-item-icon" style="width:26px;height:26px;display:flex;align-items:center;justify-content:center;font-size:15px;background:var(--bg-secondary);border-radius:4px;flex-shrink:0">${c.icon}</span>
|
||||
<span class="slash-item-name" style="flex:1;font-weight:500">${c.name}</span>
|
||||
<span class="slash-item-hint" style="font-size:12px;color:var(--text-dim);font-family:var(--font-mono);opacity:.7">${_SHORTCUT[c.id]||''}</span></div>`;});}
|
||||
SM._li.innerHTML=h;},
|
||||
SM._li.innerHTML=h;SM._rs();},
|
||||
_kd(e){if(e.key==='ArrowDown'){e.preventDefault();SM._s=Math.min(SM._s+1,SM._it.length-1);SM._rs();}
|
||||
else if(e.key==='ArrowUp'){e.preventDefault();SM._s=Math.max(SM._s-1,0);SM._rs();}
|
||||
else if(e.key==='Enter'){e.preventDefault();const c=SM._it[SM._s];if(c)SM.sel(c.id);}
|
||||
|
||||
Reference in New Issue
Block a user