fix(web): restore tool expansion directly
This commit is contained in:
@@ -162,12 +162,11 @@ export function createStructuredConnection(
|
||||
const oldToolHead = old?.querySelector<HTMLButtonElement>(".st-tool-head") ?? null;
|
||||
const wasExpanded = oldToolHead?.getAttribute("aria-expanded") === "true";
|
||||
const restoreFocus = document.activeElement === oldToolHead;
|
||||
const el = buildTranscriptRow(row, approvalStateFor(row));
|
||||
const el = buildTranscriptRow(row, approvalStateFor(row), wasExpanded);
|
||||
rowEls.set(row.id, el);
|
||||
if (old) old.replaceWith(el);
|
||||
else rowsEl.appendChild(el);
|
||||
const newToolHead = el.querySelector<HTMLButtonElement>(".st-tool-head");
|
||||
if (wasExpanded) newToolHead?.click();
|
||||
if (restoreFocus) newToolHead?.focus();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user