feat(ui): add sidebar density mode to session list (#764)

Adds compact/detailed toggle for the session list sidebar. Compact is the default (no behavior change for existing users). Detailed mode shows message count and model; profile names only appear when mixing sessions across profiles.

Fixes #673

Co-authored-by: franksong2702 <franksong2702@users.noreply.github.com>
This commit is contained in:
Frank Song
2026-04-21 03:43:40 +08:00
committed by GitHub
parent a8979f74d5
commit 0dd5d6f21c
10 changed files with 277 additions and 14 deletions

View File

@@ -618,6 +618,21 @@ function renderSessionListFromCache(){
const tsMs=_sessionTimestampMs(s);
titleRow.appendChild(title);
sessionText.appendChild(titleRow);
const density=(window._sidebarDensity==='detailed'?'detailed':'compact');
if(density==='detailed'){
const metaBits=[];
const msgCount=typeof s.message_count==='number'?s.message_count:0;
const msgLabel=(typeof t==='function')
? t('session_meta_messages', msgCount)
: `${msgCount} msg${msgCount===1?'':'s'}`;
metaBits.push(msgLabel);
if(s.model) metaBits.push(s.model);
if(_showAllProfiles&&s.profile) metaBits.push(s.profile);
const meta=document.createElement('div');
meta.className='session-meta';
meta.textContent=metaBits.join(' · ');
sessionText.appendChild(meta);
}
// Append tag chips after the title text
for(const tag of tags){
const chip=document.createElement('span');