fix(#4961): keep URL boot prefill draft-only

This commit is contained in:
Rod Boev committed 2026-06-29 10:03:36 -04:00
1 parent 71cd69cfbf
commit faed296819
3 files changed
+5 -12

No files matched your search

-6
View File
@@ -111,12 +111,6 @@ async function _applyComposerPrefillOnBoot(prefillIntent){
msg.value=text;
if(typeof autoResize==='function') autoResize();
else if(typeof updateSendBtn==='function') updateSendBtn();
if(!prefillIntent.autoSend) return;
if(typeof handleComposerPrimaryAction==='function'){
await handleComposerPrimaryAction();
return;
}
if(typeof send==='function') await send();
}
// Mobile navigation.
+1 -2
View File
@@ -3230,12 +3230,11 @@ function _composerPrefillIntentFromLocation(){
const hasSend=qs.has('send');
if(!hasQ&&!hasPrompt&&!hasSend) return empty;
const text=hasQ?(qs.get('q')||''):(hasPrompt?(qs.get('prompt')||''):'');
const autoSend=hasSend&&/^(1|true|yes|on)$/i.test(String(qs.get('send')||'').trim());
return {
hasParams:true,
hasText:!!String(text).trim(),
text,
autoSend
autoSend:false
};
}catch(_e){return empty;}
}
+4 -4
View File
@@ -73,7 +73,7 @@ console.log(JSON.stringify({ first, second, third }));
"hasParams": True,
"hasText": True,
"text": "hello world",
"autoSend": True,
"autoSend": False,
}
assert payload["second"] == {
"hasParams": True,
@@ -85,7 +85,7 @@ console.log(JSON.stringify({ first, second, third }));
"hasParams": True,
"hasText": False,
"text": " ",
"autoSend": True,
"autoSend": False,
}
@@ -155,7 +155,7 @@ console.log(JSON.stringify(result));
assert load_pos > prefill_guard
def test_apply_prefill_updates_composer_and_optionally_autosends():
def test_apply_prefill_updates_composer_without_autosending():
source = _node_prelude() + """
(async () => {
evalBoot('_applyComposerPrefillOnBoot');
@@ -181,7 +181,7 @@ def test_apply_prefill_updates_composer_and_optionally_autosends():
});
"""
payload = json.loads(_run_node(source))
assert payload["counts"] == {"autoResize": 1, "updateSendBtn": 1, "send": 1}
assert payload["counts"] == {"autoResize": 1, "updateSendBtn": 1, "send": 0}
assert payload["value"] == "second pass"