fix: narrow sidebar render-skip signature
This commit is contained in:
parent
6a0f5937cf
commit
5973d2b0e0
2 changed files with 27 additions and 1 deletions
|
|
@ -4357,8 +4357,21 @@ let _lastSessionListRenderSig = null;
|
|||
function _sessionListRenderSignature(){
|
||||
try{
|
||||
const search=($('sessionSearch')&&$('sessionSearch').value)||'';
|
||||
const sessionKeys = [
|
||||
'session_id','id','display_name','title','created_at','started_at',
|
||||
'updated_at','last_message_at','last_activity','message_count',
|
||||
'actual_message_count','is_streaming','streaming','status','pinned',
|
||||
'archived','project_id','source','session_source','generation',
|
||||
'_lineage_root_id','_lineage_tip_id','_compression_segment_count',
|
||||
];
|
||||
const sessionsSlim = Array.isArray(_allSessions) ? _allSessions.map(s => {
|
||||
if(!s || typeof s !== 'object') return s;
|
||||
const out={};
|
||||
sessionKeys.forEach(k=>{ if(Object.prototype.hasOwnProperty.call(s,k)) out[k]=s[k]; });
|
||||
return out;
|
||||
}) : _allSessions;
|
||||
return JSON.stringify([
|
||||
_allSessions,
|
||||
sessionsSlim,
|
||||
_allProjects,
|
||||
_activeSessionIdForSidebar(),
|
||||
search,
|
||||
|
|
|
|||
|
|
@ -122,6 +122,19 @@ def test_session_event_profile_filter_tolerates_default_root_aliases():
|
|||
assert "S.activeProfileIsDefault = !!data.is_default;" in PANELS_JS
|
||||
|
||||
|
||||
def test_session_list_render_signature_ignores_non_display_session_fields():
|
||||
start = SESSIONS_JS.find("function _sessionListRenderSignature()")
|
||||
assert start != -1
|
||||
block = SESSIONS_JS[start:start + 1500]
|
||||
assert "const sessionKeys = [" in block
|
||||
assert "const sessionsSlim = Array.isArray(_allSessions)" in block
|
||||
assert "sessionKeys.forEach" in block
|
||||
assert "_allSessions," not in block
|
||||
assert "message_count" in block
|
||||
assert "last_message_at" in block
|
||||
assert "_compression_segment_count" in block
|
||||
|
||||
|
||||
def test_pwa_pull_to_refresh_refreshes_session_list_not_page_when_available():
|
||||
assert "window.refreshSessionList('pull', {force:true, refreshActive:true})" in UI_JS
|
||||
assert "Promise.resolve(window.refreshSessionList('pull', {force:true, refreshActive:true})).catch(()=>{}).finally(_ptrReset)" in UI_JS
|
||||
|
|
|
|||
Loading…
Reference in a new issue