fix(chat): preserve session actions after panel resync

This commit is contained in:
ai-ag2026
2026-05-22 08:22:07 +02:00
parent f81d24ec4c
commit 77b0ca6e02
2 changed files with 8 additions and 0 deletions

View File

@@ -188,6 +188,12 @@ function _resyncChatSidebarAfterPanelSwitch() {
const run = () => {
if (_currentPanel !== 'chat') return;
if (typeof _renamingSid !== 'undefined' && _renamingSid) return;
// If the user opens the per-conversation action menu immediately after
// returning to Chat, do not let the deferred sidebar resync tear it down.
// renderSessionListFromCache() intentionally closes that menu before it
// rebuilds rows, which is correct for normal list refreshes but hostile to
// this one-shot panel-transition repair.
if (typeof _sessionActionMenu !== 'undefined' && _sessionActionMenu) return;
renderSessionListFromCache();
};
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(run);

View File

@@ -68,4 +68,6 @@ def test_chat_sidebar_resync_helper_is_guarded_and_bounded_to_one_animation_fram
assert "requestAnimationFrame" in helper
assert "setInterval" not in helper
assert "setTimeout" not in helper
assert "typeof _sessionActionMenu !== 'undefined' && _sessionActionMenu" in helper
assert helper.index("typeof _sessionActionMenu") < helper.index("renderSessionListFromCache();")
assert "renderSessionListFromCache();" in helper