fix(chat): preserve session actions after panel resync
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user