Enable automatic web search by default; improve toggle behavior and search planning.
This commit is contained in:
@@ -64,12 +64,14 @@ function toggleChatDrawer() {
|
||||
function handleDisclosureToggle(event) {
|
||||
const disclosure = event.target;
|
||||
if (!(disclosure instanceof HTMLDetailsElement) || !chatDrawer?.contains(disclosure)) return;
|
||||
// Nested disclosures must not close their parent or lose their expanded state.
|
||||
if (!disclosure.matches(".chat-drawer-body > details")) return;
|
||||
if (disclosure.matches(".chat-drawer-more, .chat-drawer-danger")) {
|
||||
const hint = disclosure.querySelector(":scope > summary .chat-drawer-row-hint");
|
||||
if (hint) hint.textContent = disclosure.open ? "Hide" : "Show";
|
||||
}
|
||||
if (disclosure.open) {
|
||||
chatDrawer.querySelectorAll("details[open]").forEach((other) => {
|
||||
chatDrawer.querySelectorAll(".chat-drawer-body > details[open]").forEach((other) => {
|
||||
if (other !== disclosure) other.open = false;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user