This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-01 02:49:33 -05:00
1 parent 650b817925
commit 0016266c06
2 files changed
+9 -5

No files matched your search

+1 -1
View File
@@ -284,7 +284,7 @@ def validate_memory_operations(form_data) -> list[dict]:
def model_allows_memory(model: dict | None) -> bool: def model_allows_memory(model: dict | None) -> bool:
return (model or {}).get('info', {}).get('meta', {}).get('capabilities', {}).get('memory', True) return ((model or {}).get('info', {}).get('meta', {}).get('capabilities') or {}).get('memory', True)
async def add_memory_context(request, form_data: dict, user, model: dict | None = None): async def add_memory_context(request, form_data: dict, user, model: dict | None = None):
@@ -47,7 +47,7 @@
const handleKeyDown = (event: KeyboardEvent) => { const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape') { if (event.key === 'Escape') {
console.log('Escape'); console.log('Escape');
show = false; cancelHandler();
} }
if (event.key === 'Enter') { if (event.key === 'Enter') {
@@ -65,6 +65,11 @@
dispatch('confirm', _inputValue); dispatch('confirm', _inputValue);
}; };
const cancelHandler = () => {
show = false;
dispatch('cancel');
};
onMount(() => { onMount(() => {
mounted = true; mounted = true;
}); });
@@ -107,7 +112,7 @@
class=" fixed top-0 right-0 left-0 bottom-0 bg-black/60 w-full h-screen max-h-[100dvh] flex justify-center z-99999999 overflow-hidden overscroll-contain" class=" fixed top-0 right-0 left-0 bottom-0 bg-black/60 w-full h-screen max-h-[100dvh] flex justify-center z-99999999 overflow-hidden overscroll-contain"
in:fade={{ duration: 10 }} in:fade={{ duration: 10 }}
on:mousedown={() => { on:mousedown={() => {
show = false; cancelHandler();
}} }}
> >
<div <div
@@ -174,8 +179,7 @@
<button <button
class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-white font-medium w-full py-2 rounded-3xl transition" class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-white font-medium w-full py-2 rounded-3xl transition"
on:click={() => { on:click={() => {
show = false; cancelHandler();
dispatch('cancel');
}} }}
type="button" type="button"
> >