fix(web): make dark-mode scrollbar thumbs visible#30031

merged5
main
fix/issue-29986
opened14d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 16h ago

Problem

In dark mode the scrollbar thumb is almost invisible. --app-scrollbar-thumb is rgb(255 255 255 / 8%), which renders as gray 20 on the #000 background (1.14:1), and the hover color renders as gray 31 (1.27:1). Reproduced on main (61c3794c32) in headed Chrome 156 and in the Linux Electron app: open a long thread in dark mode and the chat scrollbar's right-edge strip looks black.

Change

Raises the two dark-mode tokens in apps/web/src/index.css: idle thumb 8% → 36% white, hover 12% → 45% white. 36% is the smallest whole percentage that stays above WCAG 1.4.11's 3:1 on #000 after rounding: 35% renders as gray 89, 2.998:1. The same tokens paint the native ::-webkit-scrollbar thumb, the Base UI ScrollArea thumb and the Ghostty terminal thumb, so all three change together. Light mode, visibility timing (ScrollArea still appears on hover or scroll), width and hidden-scrollbar areas are unchanged.

Scope and approval

Fixes pingdotgg/t3code#29986

Triaged via the automated issue flow; GitCafe issue #29986.

Verification

  • vp run check:changed: format and typecheck pass. No tests were added, because this is a visual token change and the captures below are the proof.
  • Captures are real X11 pixels (ImageMagick import) from headed Chrome for Testing 156 and Electron 44.10.0 (Chromium 152) under Xvfb. Settings: DPR 1, 100% scale, reduced motion, clock frozen at 2030-01-01 12:00 UTC. Both sides were seeded with the same synthetic fixture (one 150-line user message, provider never started) on fresh databases (T3CODE_DEV_SEED=0). Every still was taken twice 500 ms apart and kept only when both grabs were pixel-identical.
  • Before = 61c3794c32, after = e106db8e19 (the fix commit). The PR head is a merge of main and leaves index.css, scroll-area.tsx, surface.ts, ModelPickerContent.tsx and combobox.tsx identical to the fix commit. An independent rebuild of R1 from the same scripts matched the delivered frames with 0 changed pixels.
  • Each sheet shows: Before | After full frames with SHAs; full-frame Diff0 (any channel delta > 0, amplified to white) and DiffT (max channel delta > 2/255); then 4× nearest-neighbour crops of the scrollbar strip in Before | After | Diff0 | DiffT order.
RowThumb / background beforeContrastAfterContrast
R1 chat, dark, 1440×900, idle20 / 01.14:192 / 03.14:1
R1 hover31 / 01.27:1115 / 04.43:1
R2 chat, dark, 390×844, idle20 / 01.14:192 / 03.14:1
R3 chat, Grove dark (lightest built-in dark canvas), idle(44,56,50) / (27,40,33)1.25:1(109,117,113) / (27,40,33)3.23:1
R4 Base UI ScrollArea (project icon picker), revealed / hover20 / 0, 31 / 01.14 / 1.27:192 / 0, 115 / 03.14 / 4.43:1
R5 Ghostty terminal, idle / track hover20 / 0, 31 / 01.14 / 1.27:192 / 0, 115 / 03.14 / 4.43:1
R6 chat, LIGHT control217 / 2521.38:1217 / 2521.38:1 (pixel-identical frame)
R7 chat, Linux Electron, dark, idle20 / 01.14:192 / 03.14:1
R8 model picker list on the glass popup, idle / hover43 / 26, 53 / 261.23 / 1.42:1108 / 26, 129 / 263.31 / 4.47:1

What else changed: only scrollbar thumb pixels. In R4, R5 and R8 the chat or settings scrollbar behind the dialog, terminal or popup also brightens. Nothing else differs at zero threshold, and R6 (light) is pixel-identical.

R1: chat, standard dark, 1440×900, idle and pointer on thumb (before 61c3794c32 | after e106db8e19)

Recording, same script on both sides: 0.0 s idle → ~1.1 s pointer on thumb → ~3.3 s pointer leaves.

R2: chat, standard dark, 390×844, idle

R3: chat, Grove dark, 1440×900, idle

R4: Base UI ScrollArea (Settings → Projects → project icon picker), standard dark, 1440×900

Recording, same script on both sides: 0.0 s idle (thumb hidden) → ~1.0 s pointer enters the area (thumb revealed) → ~2.1 s pointer on thumb → ~3.6 s pointer leaves (thumb hides again).

R5: Ghostty terminal with scrollback, standard dark, 1440×900

Recording, same script on both sides: 0.0 s idle → ~1.1 s pointer on track → ~3.2 s pointer leaves.

R6: chat, standard LIGHT, 1440×900 (control: unchanged)

R7: Linux Electron desktop app, chat, standard dark, 1440×900, idle

R8: composer model picker list (native scrollbar on the glass popup), standard dark, 1440×900, idle and hover

Seed and capture scripts are posted in a comment on this PR. They are not committed.

Not captured: native horizontal scrollbars in plain overflow containers (Mermaid diagrams, composer code blocks, ui/table.tsx). The global ::-webkit-scrollbar sets only width, so these are Chromium's default 15px tall. At 8% they were invisible in dark mode; they now show at the same 36%/45% colors, as they already do in light mode. Also not checked: macOS and Windows Electron (same stylesheet, not run) and mobile (React Native does not use these tokens).

Fixed by Claude Opus 5.5 (lead, implementation, review) and gpt-6.1-sol (review, proof audit, captures) in Claude Code and Codex through T3 Code.

🤖 Generated with Claude Code

Checks

21 successful · 22 skipped
All checks passed
a25d8a9

Added 3 commits

  • fix(web): make dark-mode scrollbar thumbs visible13283e6
  • Merge remote-tracking branch 'origin/main' into fix/issue-299865608847
  • fix(web): keep the dark idle scrollbar thumb above 3:1 after roundinge106db8

Seed and capture scripts behind the evidence in the PR body. They are scratch for this PR and are not committed. Run order: start each side with T3CODE_DEV_SEED=0 vp run dev, then python3 run-rows.py before|after under headless-desktop, then python3 compose.py. R8 uses r8-plan.mjs in place of inspect-plan.mjs.

run-rows.py
python
1import os,subprocess,pathlib,sys,time
2base=pathlib.Path('/tmp/issue-lead-29986-r1/capture/20261103T081056Z')
3side=sys.argv[1];checkout='/home/ubuntu/wt/issue-29986'+('-before' if side=='before' else '');origin='http://localhost:'+('7110' if side=='before' else '7586')
4for row,scheme in [('R1','dark'),('R2','dark'),('R3','dark'),('R4','dark'),('R5','dark'),('R6','light')]:
5 if row not in sys.argv[2:]:continue
6 out=base/(side+'-'+row.lower()+'-'+time.strftime('%H%M%S'));out.mkdir(exist_ok=True)
7 with open(out/'pair.txt','w') as f:subprocess.run(['node','apps/server/src/bin.ts','pair','--base-dir',checkout+'/.t3','--label','cap'],cwd=checkout,stdout=f,check=True)
8 env={**os.environ,'PLAYWRIGHT_CORE':checkout+'/node_modules/.pnpm/playwright-core@1.60.0/node_modules/playwright-core/index.mjs','CDP_PORT':str((9450 if side=='after' else 9460)+int(row[1:])),'CAP_W':'390' if row=='R2' else '1440','CAP_H':'844' if row=='R2' else '900'}
9 with open(out/'run.log','w') as f:r=subprocess.run(['headless-desktop','node',str(base/'capture.mjs'),origin,str(out/'pair.txt'),str(out),checkout,row,scheme],cwd=checkout,env=env,stdout=f,stderr=f)
10 print(side,row,r.returncode,flush=True)
seed.mjs
js
1import {execFileSync} from 'node:child_process';
2export const fixtureText=Array.from({length:150},(_,i)=>`Line ${String(i+1).padStart(3,'0')} — synthetic scrollbar evidence; identical before and after.`).join('\n');
3export async function seed(page,checkout){
4 await page.evaluate(()=>{window.capRpc=async(tag,payload)=>{const {ticket}=await(await fetch('/api/auth/websocket-ticket/rpc',{method:'POST'})).json();const ws=new WebSocket(location.origin.replace('http','ws')+'/ws?orchestrationProtocol=2&wsTicket='+encodeURIComponent(ticket));await new Promise((r,j)=>{ws.onopen=r;ws.onerror=j});return await new Promise((r,j)=>{ws.onmessage=e=>{const d=JSON.parse(e.data);if(d._tag==='Exit'){ws.close();d.exit._tag==='Success'?r(d.exit.value):j(new Error(JSON.stringify(d.exit)))}};ws.send(JSON.stringify({_tag:'Request',id:'900',tag,payload,headers:[]}))})}});
5 const rpc=(tag,payload)=>page.evaluate(([tag,payload])=>window.capRpc(tag,payload),[tag,payload]);
6 const rows=execFileSync('sqlite3',['-readonly',checkout+'/.t3/userdata/statev2.sqlite','select project_id from projection_projects where deleted_at is null;'],{encoding:'utf8'}).trim().split('\n').filter(Boolean);
7 if(!rows.includes('scrollbar-project')){
8 await rpc('projects.mutate',{type:'project.create',commandId:crypto.randomUUID(),projectId:'scrollbar-project',title:'Scrollbar evidence',workspaceRoot:'/tmp/issue-lead-29986-r1/capture/20261103T072338Z/fixture-project',createWorkspaceRootIfMissing:true});
9 await rpc('orchestration.dispatchCommand',{type:'thread.create',commandId:crypto.randomUUID(),threadId:'scrollbar-thread',projectId:'scrollbar-project',title:'Scrollbar evidence',modelSelection:{instanceId:'codex',model:'gpt-6.1-sol'},runtimeMode:'full-access',interactionMode:'default',branch:null,worktreePath:null,createdBy:'user',creationSource:'web'});
10 await rpc('orchestration.dispatchCommand',{type:'message.dispatch',commandId:crypto.randomUUID(),threadId:'scrollbar-thread',messageId:'scrollbar-message',text:fixtureText,attachments:[],dispatchMode:{type:'defer_start'},createdBy:'user',creationSource:'web'});
11 await rpc('orchestration.dispatchCommand',{type:'thread.stop',commandId:crypto.randomUUID(),threadId:'scrollbar-thread'});
12 }
13 for(const projectId of rows.filter(id=>id!=='scrollbar-project'))await rpc('projects.mutate',{type:'project.delete',commandId:crypto.randomUUID(),projectId,force:true});
14}
capture.mjs
js
1// Extended copy of lead capture.mjs. Real headed X11 pixels include native scrollbars.
2import {spawn,execFileSync} from 'node:child_process';
3import {mkdirSync,writeFileSync,readFileSync} from 'node:fs';import {join} from 'node:path';
4import {seed} from './seed.mjs';import {record} from './recording.mjs';
5const {chromium}=await import(process.env.PLAYWRIGHT_CORE);
6const [origin,tokenFile,outDir,checkout,row='R1',scheme='dark']=process.argv.slice(2);
7const W=Number(process.env.CAP_W||1440),H=Number(process.env.CAP_H||900);mkdirSync(outDir,{recursive:true});
8const port=Number(process.env.CDP_PORT||9420);
9const child=spawn('/home/ubuntu/.agent-browser/browsers/chrome-156.0.8078.47/chrome',[`--user-data-dir=${outDir}/profile`,`--remote-debugging-port=${port}`,`--window-size=${W},${H}`,'--window-position=0,0','--force-device-scale-factor=1','--no-first-run','--test-type','--disable-infobars','--no-default-browser-check','--disable-gpu','--no-sandbox',`--app=${origin}/pair`],{stdio:'ignore'});writeFileSync(outDir+'/chrome.pid',String(child.pid));
10let browser;const log=[];const note=s=>{console.log(s);log.push(s)};
11const raw=name=>{const p=join(outDir,name+'.png');execFileSync('import',['-window','root','-crop',`${W}x${H}+0+0`,'+repage',p]);return p};
12async function settled(page,name){await page.waitForLoadState('networkidle');await page.evaluate(()=>document.fonts.ready);for(let n=0;n<12;n++){raw('settle-a');await page.waitForTimeout(500);raw('settle-b');let same=false;try{execFileSync('compare',['-metric','AE',outDir+'/settle-a.png',outDir+'/settle-b.png','null:'],{stdio:'pipe'});same=true}catch{}if(same){execFileSync('cp',[outDir+'/settle-b.png',outDir+'/'+name+'.png']);note('settled '+name+' pixel-identical 500ms');return} }throw new Error('unsettled '+name)}
13try{
14 for(let n=0;n<50&&!browser;n++){try{browser=await chromium.connectOverCDP(`http://127.0.0.1:${port}`)}catch{await new Promise(r=>setTimeout(r,200))}}
15 const context=browser.contexts()[0],page=context.pages()[0];page.setDefaultTimeout(15000);
16 await page.emulateMedia({colorScheme:scheme,reducedMotion:'reduce'});
17 await page.getByLabel('Pairing token').fill(readFileSync(tokenFile,'utf8').match(/Token:\s*(\S+)/)[1]);await page.getByRole('button',{name:'Continue',exact:true}).click();await page.waitForURL(url=>!url.pathname.includes('/pair'));await page.waitForLoadState('networkidle');await page.waitForTimeout(2000);
18 if(process.env.CAP_SEED==='1')await seed(page,checkout);
19
20 await page.evaluate(s=>{localStorage.setItem('t3code:theme',s);localStorage.setItem('t3code:theme-appearance-mode',s);localStorage.setItem('t3code:theme-follow-system','false')},scheme);
21 await page.clock.setFixedTime(new Date('2030-01-01T12:00:00Z'));await page.reload();if(row==='R3'){await page.goto(origin+'/settings/appearance');await page.getByRole('button',{name:'Use Grove theme',exact:true}).click();await page.getByRole('button',{name:'Use dark mode',exact:true}).click();}await page.goto(origin+'/'+readFileSync(checkout+'/.t3/userdata/environment-id','utf8').trim()+'/scrollbar-thread');await page.locator('.messages-timeline-scroll').waitFor();await page.clock.setFixedTime(new Date('2030-01-01T12:00:00Z'));
22 const details=page.getByRole('button',{name:'Toggle thread details panel'});if(await details.getAttribute('aria-pressed')==='true')await details.click();
23 const expand=page.getByRole('button',{name:'Show full message',exact:true});if(await expand.count())await expand.click();
24 await page.waitForFunction(()=>{const e=document.querySelector('.messages-timeline-scroll');return e&&e.scrollHeight>e.clientHeight*2});
25 await page.evaluate(()=>{const e=document.querySelector('.messages-timeline-scroll');e.scrollTop=Math.round((e.scrollHeight-e.clientHeight)*.4)});
26 await page.mouse.move(500,450);
27 if(['INSPECT','R4','R5'].includes(row)){writeFileSync(outDir+'/body.txt',await page.locator('body').innerText());raw('inspect');await import('./inspect-plan.mjs').then(m=>m.default({page,browser,raw,settled,outDir,note}));}
28 else{
29 const geo=await page.locator('.messages-timeline-scroll').evaluate(e=>{const r=e.getBoundingClientRect();const th=Math.max(e.clientHeight*e.clientHeight/e.scrollHeight,20);return {x:r.right-3,y:r.top+(e.scrollTop/(e.scrollHeight-e.clientHeight))*(e.clientHeight-th)+th/2,rect:{x:r.x,y:r.y,width:r.width,height:r.height},scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,scrollTop:e.scrollTop,thumbHeight:th,dpr:devicePixelRatio,viewport:[innerWidth,innerHeight],theme:document.documentElement.dataset.themeId||'standard',dark:document.documentElement.classList.contains('dark'),var:getComputedStyle(document.documentElement).getPropertyValue('--app-scrollbar-thumb')}});
30 writeFileSync(outDir+'/geometry.json',JSON.stringify(geo,null,2));await settled(page,'idle');await page.mouse.move(geo.x,geo.y);await settled(page,'hover');if(row==='R1'){await record({page,raw,outDir,frames:16,steps:[{frame:0,label:'idle',x:500,y:450},{frame:4,label:'hover thumb',x:geo.x,y:geo.y},{frame:12,label:'leave',x:500,y:450}]});note('native thumb interaction recorded at 4 fps target; see frame-times.json');}
31 }
32 await browser.close();
33}catch(e){try{raw('failure');writeFileSync(outDir+'/failure-body.txt',await browser.contexts()[0].pages()[0].locator('body').innerText())}catch{}throw e}finally{child.kill();writeFileSync(outDir+'/driver.log',log.join('\n'))}
inspect-plan.mjs
js
1import {writeFileSync} from 'node:fs';import {record} from './recording.mjs';
2export default async function({page,browser,raw,settled,outDir,note}){
3 const row=process.argv[6];const origin=process.argv[2];
4 if(row==='R4'){
5 await page.goto(origin+'/settings/projects');await page.getByText('/tmp/issue-lead-29986-r1/capture/20261103T072338Z/fixture-project',{exact:true}).click();await page.getByRole('button',{name:'Choose a project icon',exact:true}).click();await page.getByLabel('Search Lucide icons').fill('a');await page.getByRole('heading',{name:'Choose project icon',exact:true}).click();
6 const viewport=page.getByRole('dialog').locator('[data-slot="scroll-area-viewport"]').filter({has:page.getByLabel('Search Lucide icons')});
7 const thumb=page.getByRole('dialog').locator('[data-slot="scroll-area-thumb"]').first();await thumb.waitFor({state:'attached'});
8 const geo=await thumb.evaluate(e=>({thumb:e.getBoundingClientRect().toJSON(),track:e.parentElement.getBoundingClientRect().toJSON(),root:e.parentElement.parentElement.getBoundingClientRect().toJSON(),theme:document.documentElement.dataset.themeId||'standard',dpr:devicePixelRatio,viewport:[innerWidth,innerHeight]}));
9 writeFileSync(outDir+'/geometry.json',JSON.stringify(geo,null,2));
10 const idle={x:1100,y:750},reveal={x:geo.root.x+1,y:geo.root.y+10},hover={x:geo.thumb.x+geo.thumb.width/2,y:geo.thumb.y+geo.thumb.height/2};
11 await page.mouse.move(idle.x,idle.y);await settled(page,'idle');await page.mouse.move(reveal.x,reveal.y);await settled(page,'reveal');await page.mouse.move(hover.x,hover.y);await settled(page,'hover');await page.mouse.move(idle.x,idle.y);await settled(page,'leave');
12 await record({page,raw,outDir,frames:20,steps:[{frame:0,label:'idle',...idle},{frame:4,label:'hover area reveal',...reveal},{frame:8,label:'hover thumb',...hover},{frame:14,label:'leave',...idle}]});note('ScrollArea project icon picker search a');
13 }else if(row==='R5'){
14 await page.getByRole('button',{name:'Toggle terminal drawer',exact:true}).click();
15 const input=page.getByLabel('Terminal input',{exact:true});await input.waitFor({state:'attached'});await page.waitForFunction(()=>{const c=document.querySelector('[aria-label="Terminal input"]')?.parentElement.querySelector('canvas');if(!c)return false;return c.getContext('2d').getImageData(0,0,c.width,Math.min(80,c.height)).data.some((v,i)=>i%4!==3&&v>60)});
16 await input.fill("printf '\\033[3J\\033[?25l\\033[2J\\033[H'; for i in $(seq 1 200); do printf 'Terminal evidence line %03d\\n' \"$i\"; done; printf '\\033[?25l'\n");
17 const track=page.getByLabel('Terminal scrollback',{exact:true});await page.waitForFunction(()=>document.querySelector('[aria-label="Terminal scrollback"]')?.getAttribute('aria-valuemax')==='188');
18 await track.focus();await track.press('Home');for(let i=0;i<5;i++)await track.press('PageDown');await input.focus();
19 const geo=await track.evaluate(e=>({track:e.getBoundingClientRect().toJSON(),thumb:e.firstElementChild.getBoundingClientRect().toJSON(),max:e.getAttribute('aria-valuemax'),now:e.getAttribute('aria-valuenow'),dpr:devicePixelRatio,viewport:[innerWidth,innerHeight]}));writeFileSync(outDir+'/geometry.json',JSON.stringify(geo,null,2));
20 await page.waitForLoadState('networkidle');await page.evaluate(()=>{const e=document.querySelector('.messages-timeline-scroll');e.scrollTop=Math.round((e.scrollHeight-e.clientHeight)*.4)});
21 await page.mouse.move(500,450);await settled(page,'idle');await page.mouse.move(geo.track.x+geo.track.width/2,geo.track.y+geo.track.height/2);await settled(page,'hover');
22 await record({page,raw,outDir,frames:16,steps:[{frame:0,label:'idle',x:500,y:450},{frame:4,label:'hover track',x:geo.track.x+geo.track.width/2,y:geo.track.y+geo.track.height/2},{frame:12,label:'leave track',x:500,y:450}]});note('terminal 200 synthetic lines; Home then 5 PageDown');
23 }else{writeFileSync(outDir+'/inspect.txt',await page.locator('body').innerText());}
24}
recording.mjs
js
1import {writeFileSync} from 'node:fs';
2export async function record({page,raw,outDir,steps,frames}){
3 const initial=steps.find(s=>s.frame===0);await page.mouse.move(initial.x,initial.y);await page.waitForTimeout(500);
4 const start=performance.now(),events=[],times=[];
5 for(let i=0;i<frames;i++){
6 await page.waitForTimeout(Math.max(0,start+i*250-performance.now()));
7 for(const step of steps.filter(s=>s.frame===i)){await page.mouse.move(step.x,step.y);events.push({step:step.label,frame:i,t:performance.now()-start})}
8 const begin=performance.now()-start;raw('frame-'+String(i).padStart(3,'0'));times.push({frame:i,beginMs:begin,endMs:performance.now()-start});
9 }
10 writeFileSync(outDir+'/steps.json',JSON.stringify(events,null,2));writeFileSync(outDir+'/frame-times.json',JSON.stringify(times,null,2));
11}
electron-capture.mjs
js
1import {readFileSync,mkdirSync,writeFileSync} from 'node:fs';import {execFileSync} from 'node:child_process';
2import {chromium} from '/home/ubuntu/wt/issue-29986/node_modules/.pnpm/playwright-core@1.60.0/node_modules/playwright-core/index.mjs';
3const [port,pid,checkout,outDir,tokenFile,backendOrigin='http://localhost:15150']=process.argv.slice(2);mkdirSync(outDir,{recursive:true});let ancestor=pid;while(ancestor!=='1'){const vars=readFileSync('/proc/'+ancestor+'/environ','utf8').split('\0');const display=vars.find(x=>x.startsWith('DISPLAY='));if(display){process.env.DISPLAY=display.slice(8);const auth=vars.find(x=>x.startsWith('XAUTHORITY='));if(auth)process.env.XAUTHORITY=auth.slice(11);break;}ancestor=readFileSync('/proc/'+ancestor+'/status','utf8').match(/PPid:\s+(\d+)/)[1];}
4const b=await chromium.connectOverCDP('http://localhost:'+port);const p=b.contexts()[0].pages()[0];p.setDefaultTimeout(15000);await p.emulateMedia({colorScheme:'dark',reducedMotion:'reduce'});
5const raw=name=>{execFileSync('import',['-window','root','-crop','1440x900+0+0','+repage',outDir+'/'+name+'.png'])};
6try{
7if(tokenFile){await p.goto('t3code-dev://app/');await p.getByText('Open Environments',{exact:true}).click();await p.getByRole('button',{name:'Add environment',exact:true}).click();await p.getByPlaceholder('backend.example.com').fill(backendOrigin);await p.getByPlaceholder('PAIRCODE').fill(readFileSync(tokenFile,'utf8').match(/Token:\s*(\S+)/)[1]);await p.getByRole('dialog').getByRole('button',{name:'Add environment',exact:true}).click();await p.getByText('Backend added',{exact:true}).waitFor();}
8await p.clock.setFixedTime(new Date('2030-01-01T12:00:00Z'));
9await p.evaluate(()=>{localStorage.setItem('t3code:theme','dark');localStorage.setItem('t3code:theme-appearance-mode','dark');localStorage.setItem('t3code:theme-follow-system','false')});
10const envId=readFileSync(checkout+'/.t3/userdata/environment-id','utf8').trim();await p.goto('t3code-dev://app/#/'+envId+'/scrollbar-thread');await p.locator('.messages-timeline-scroll').waitFor();
11const details=p.getByRole('button',{name:'Toggle thread details panel'});if(await details.getAttribute('aria-pressed')==='true')await details.click();const expand=p.getByRole('button',{name:'Show full message',exact:true});if(await expand.count())await expand.click();await p.waitForFunction(()=>{const e=document.querySelector('.messages-timeline-scroll');return e&&e.scrollHeight>e.clientHeight*2});await p.evaluate(()=>{const e=document.querySelector('.messages-timeline-scroll');e.scrollTop=Math.round((e.scrollHeight-e.clientHeight)*.4)});await p.mouse.move(500,450);await p.waitForLoadState('networkidle');await p.evaluate(()=>document.fonts.ready);
12await p.clock.setFixedTime(new Date('2030-01-01T12:00:00Z'));await p.evaluate(()=>{const e=document.querySelector('.messages-timeline-scroll');e.scrollTop=Math.round((e.scrollHeight-e.clientHeight)*.4)});
13const geo=await p.locator('.messages-timeline-scroll').evaluate(e=>{const r=e.getBoundingClientRect();const th=Math.max(e.clientHeight*e.clientHeight/e.scrollHeight,20);return {x:r.right-3,y:r.top+e.scrollTop/(e.scrollHeight-e.clientHeight)*(e.clientHeight-th)+th/2,rect:r.toJSON(),thumbHeight:th,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,viewport:[innerWidth,innerHeight],dpr:devicePixelRatio,ua:navigator.userAgent,theme:document.documentElement.dataset.themeId||'standard',dark:document.documentElement.classList.contains('dark'),var:getComputedStyle(document.documentElement).getPropertyValue('--app-scrollbar-thumb')}});writeFileSync(outDir+'/geometry.json',JSON.stringify(geo,null,2));
14for(let i=0;i<12;i++){raw('settle-a');await p.waitForTimeout(500);raw('settle-b');try{execFileSync('compare',['-metric','AE',outDir+'/settle-a.png',outDir+'/settle-b.png','null:'],{stdio:'pipe'});execFileSync('cp',[outDir+'/settle-b.png',outDir+'/idle.png']);console.log('settled idle pixel-identical 500ms');break}catch{}if(i===11)throw Error('unsettled')}
15}catch(e){raw('failure');writeFileSync(outDir+'/failure-body.txt',await p.locator('body').innerText());throw e}finally{await b.close()}
r8-plan.mjs
js
1import {writeFileSync} from 'node:fs';
2export default async function({page,browser,raw,settled,outDir,note}) {
3 await page.locator('[data-chat-provider-model-picker="true"]').click();
4 await page.locator('[data-model-picker-content]').waitFor();
5 await page.waitForLoadState('networkidle');
6 await page.getByRole('option',{name:'Show more',exact:true}).click();
7 const selector='[data-model-picker-content] [data-slot="combobox-list"] .scrollbar-gutter-stable';
8 const scroller=page.locator(selector);
9 await page.waitForFunction(s=>{const e=document.querySelector(s);return e&&e.scrollHeight>e.clientHeight},selector);
10 await page.mouse.move(850,640);await page.mouse.wheel(0,200);
11 await page.waitForFunction(s=>{const e=document.querySelector(s);return e.scrollTop===e.scrollHeight-e.clientHeight},selector);
12 const scrollProbe=await scroller.evaluate(e=>({atBottom:e.scrollTop,max:e.scrollHeight-e.clientHeight}));
13 await page.mouse.wheel(0,-200);
14 await page.waitForFunction(s=>document.querySelector(s).scrollTop===0,selector);
15 await page.getByText('Reasoning',{exact:true}).click();
16 await page.mouse.move(1100,300);await settled(page,'idle');
17 const geo=await scroller.evaluate((e,scrollProbe)=>{
18 const r=e.getBoundingClientRect();const track=getComputedStyle(e,'::-webkit-scrollbar-track');
19 const marginTop=parseFloat(track.marginTop)||0,marginBottom=parseFloat(track.marginBottom)||0;
20 const trackHeight=r.height-marginTop-marginBottom;
21 const thumbHeight=Math.max(trackHeight*e.clientHeight/e.scrollHeight,20);
22 const top=r.top+marginTop+e.scrollTop/(e.scrollHeight-e.clientHeight)*(trackHeight-thumbHeight);
23 return {rect:r.toJSON(),scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,scrollTop:e.scrollTop,scrollProbe,
24 track:{marginTop,marginBottom,height:trackHeight},thumb:{x:r.right-6,y:top,width:6,height:thumbHeight,bottom:top+thumbHeight},
25 x:r.right-3,y:top+thumbHeight/2,thumbHeight,backgroundXY:[r.right-3,r.top+3],
26 adjacentBackgroundXY:[r.right+1,top+thumbHeight/2],
27 dpr:devicePixelRatio,viewport:[innerWidth,innerHeight],theme:document.documentElement.dataset.themeId||'standard',dark:document.documentElement.classList.contains('dark'),
28 var:getComputedStyle(document.documentElement).getPropertyValue('--app-scrollbar-thumb'),hoverVar:getComputedStyle(document.documentElement).getPropertyValue('--app-scrollbar-thumb-hover'),
29 popup:document.querySelector('[data-model-picker-content]').closest('[data-slot="popover-popup"]').getBoundingClientRect().toJSON(),
30 options:[...document.querySelectorAll('[data-model-picker-content] [role="option"]')].map(e=>e.innerText),
31 chat:(()=>{const e=document.querySelector('.messages-timeline-scroll');return {scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}})()
32 };
33 },scrollProbe);
34 writeFileSync(outDir+'/geometry.json',JSON.stringify(geo,null,2));
35 writeFileSync(outDir+'/popup-body.txt',await page.locator('body').innerText());
36 await page.mouse.move(geo.x,geo.y);await settled(page,'hover');
37 note('R8 expanded Codex models through Show more; native list wheel probe '+JSON.stringify(scrollProbe));
38}
compose.py
python
1from pathlib import Path
2from PIL import Image,ImageChops,ImageDraw,ImageFont,ImageOps
3import json,math
4import numpy as np
5B=Path('/tmp/issue-lead-29986-r1/capture/20261103T081056Z');M=json.loads((B/'manifest.json').read_text())
6SHA={'before':'61c3794c32b0eeebfac09add43e403618c65d2d7','after':'e106db8e199b8c3f45005b0668043fa17e880dd8'}
7FONT='/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf'
8def font(s):return ImageFont.truetype(FONT,s)
9def label(im,xy,text,size=22,fill='#151515'):ImageDraw.Draw(im).text(xy,text,font=font(size),fill=fill)
10def lum(rgb):
11 a=[x/255 for x in rgb];a=[x/12.92 if x<=.04045 else ((x+.055)/1.055)**2.4 for x in a];return .2126*a[0]+.7152*a[1]+.0722*a[2]
12def contrast(a,b):return (max(lum(a),lum(b))+.05)/(min(lum(a),lum(b))+.05)
13def diff(a,b,t):
14 d=ImageChops.difference(a,b);r,g,bl=d.split();v=ImageChops.lighter(ImageChops.lighter(r,g),bl);return v.point(lambda x:255 if x>t else 0).convert('RGB')
15META={
16 'R1':('Long chat — idle + thumb hover','1440x900','Standard dark','Web / Chrome 156'),
17 'R2':('Narrow long chat — idle','390x844','Standard dark','Web / Chrome 156'),
18 'R3':('Lightest built-in dark canvas — idle','1440x900','Grove dark','Web / Chrome 156'),
19 'R4':('Base UI ScrollArea — project icon search a','1440x900','Standard dark','Web / Chrome 156'),
20 'R5':('Ghostty terminal — idle + track hover','1440x900','Standard dark','Web / Chrome 156'),
21 'R6':('Long chat — unchanged light control','1440x900','Standard light','Web / Chrome 156'),
22 'R7':('Linux Electron long chat — idle','1440x900','Standard dark','Electron 44.10.0 / Chromium 152')}
23measure=[];stats={};outputs=[]
24for row,pair in M.items():
25 states=['idle','hover'] if row in ['R1','R5'] else ['reveal'] if row=='R4' else ['idle']
26 crops=['idle','reveal','hover','leave'] if row=='R4' else states
27 imgs={side:{s:Image.open(Path(path)/(s+'.png')).convert('RGB') for s in set(states+crops)} for side,path in pair.items()}
28 beforegeo=json.loads((Path(pair['before'])/'geometry.json').read_text())
29 geo=json.loads((Path(pair['after'])/'geometry.json').read_text());w,h=imgs['after'][states[0]].size
30 if row in ['R4','R5']:
31 assert all(abs(beforegeo['thumb'][k]-geo['thumb'][k])<.001 for k in ['x','y','width','height']), (row,'mismatched thumb geometry',beforegeo,geo)
32 t=geo['thumb'];x=int(t['x']+t['width']/2);y=int(t['y']+t['height']/2);top=math.floor(t['y']);bottom=math.ceil(t['bottom']);back=(x,min(h-1,bottom+8))
33 else:
34 x=round(geo['x']);y=round(geo['y']);top=math.floor(geo['y']-geo['thumbHeight']/2);bottom=math.ceil(geo['y']+geo['thumbHeight']/2);back=(x,top-10)
35 crop=(max(0,x-12),max(0,top-16),min(w,x+7),min(h,bottom+16));cw,ch=(crop[2]-crop[0])*4,(crop[3]-crop[1])*4
36 head=100;fullh=len(states)*(2*h+160);each=ch+85;sheet=Image.new('RGB',(2*w,head+fullh+len(crops)*each+40),'#f7f7f7')
37 label(sheet,(22,12),f'{row} | {META[row][0]}',30 if w>500 else 20)
38 label(sheet,(22,53),f'{META[row][1]} | {META[row][2]} | {META[row][3]} | DPR 1 | 100% scale',22 if w>500 else 13)
39 yy=head
40 for state in states:
41 for j,side in enumerate(['before','after']):
42 label(sheet,(j*w+18,yy),side.title()+' — '+state,24 if w>500 else 18);sheet.paste(imgs[side][state],(j*w,yy+34));label(sheet,(j*w+18,yy+34+h),SHA[side][:10],20 if w>500 else 12)
43 yy+=h+80
44 for j,threshold in enumerate([0,2]):
45 label(sheet,(j*w+18,yy),f'Full-frame Diff{"0" if threshold==0 else "T"} — max channel delta > {threshold}/255',22 if w>500 else 12);sheet.paste(diff(imgs['before'][state],imgs['after'][state],threshold),(j*w,yy+34));label(sheet,(j*w+18,yy+34+h),'61c3794c32 -> e106db8e19',20 if w>500 else 12)
46 yy+=h+80
47 stats[row]={}
48 for state in crops:
49 a,b=imgs['before'][state],imgs['after'][state];d0=diff(a,b,0);dt=diff(a,b,2);d0.save(B/f'{row}-{state}-Diff0-full.png');dt.save(B/f'{row}-{state}-DiffT-full.png')
50 stats[row][state]={'changed0':sum(v[0]>0 for v in d0.getdata()),'changedT':sum(v[0]>0 for v in dt.getdata()),'bbox0':d0.getbbox()}
51 label(sheet,(18,yy),f'{state}: scrollbar segment x{crop[0]}..{crop[2]-1}, y{crop[1]}..{crop[3]-1} — 4x nearest neighbour',20 if w>500 else 12);yy+=30
52 names=['Before','After','Diff0: any delta > 0','DiffT: max delta > 2/255'];panels=[a,b,d0,dt]
53 for j,(name,img) in enumerate(zip(names,panels)):
54 col=(2*w)//4;fs=20 if w>500 else 12;label(sheet,(j*col+12,yy),name,fs);label(sheet,(j*col+12,yy+25),(SHA['before'][:10] if j==0 else SHA['after'][:10] if j==1 else '61c3794c32 -> e106db8e19'),fs-2);c=img.crop(crop).resize((cw,ch),Image.Resampling.NEAREST);sheet.paste(c,(j*col+(col-cw)//2,yy+53))
55 yy+=ch+55
56 for side in ['before','after']:
57 rgb=imgs[side][state].getpixel((x,y));bg=imgs[side][state].getpixel(back);measure.append({'row':row,'state':state,'side':side,'thumb':rgb,'background':bg,'contrast':contrast(rgb,bg),'thumbXY':[x,y],'backgroundXY':back})
58 dest=B/f'{row}-sheet.png';sheet.save(dest,optimize=True);outputs.append(str(dest));print(dest.name,sheet.size,dest.stat().st_size,stats[row])
59 for side in ['before','after']:
60 path=Path(pair[side]);files=sorted(path.glob('frame-*.png'))
61 if side=='before' and row in ['R1','R4','R5']:
62 import shutil
63 dest=B/f'{row}-before.gif';shutil.copy2(Path('/tmp/issue-lead-29986-r1/capture/20261103T072338Z')/dest.name,dest);outputs.append(str(dest));continue
64 if row not in ['R1','R4','R5'] or not (path/'frame-times.json').exists():continue
65 times=json.loads((path/'frame-times.json').read_text());frames=[]
66 for i,f in enumerate(files):
67 source=Image.open(f).convert('RGB');frame=Image.new('RGB',(source.width,source.height+56),'#f7f7f7');label(frame,(16,7),f'{row} {side.title()} {SHA[side][:10]} | {META[row][1]} | {META[row][2]} | capture t={times[i]["beginMs"]/1000:.2f}s',20);frame.paste(source,(0,56));frames.append(frame)
68 # Reserve measured thumb colors in the shared palette, so low-contrast states survive GIF quantization.
69 palette=Image.new('RGB',(frames[0].width,frames[0].height*2));palette.paste(frames[0],(0,0));palette.paste(frames[len(frames)//2],(0,frames[0].height));palette=palette.quantize(colors=240,method=Image.Quantize.MEDIANCUT);pal=palette.getpalette();reserved=[(0,0,0),(20,20,20),(31,31,31),(89,89,89),(91,91,91),(92,92,92),(115,115,115),(114,114,114),(252,252,252),(217,217,217),(191,191,191)];pal[240*3:240*3+len(reserved)*3]=[c for rgb in reserved for c in rgb];palette.putpalette(pal)
70 def quantize_reserved(im):
71 q=im.quantize(palette=palette,dither=Image.Dither.NONE);a=np.array(q);src=np.array(im)
72 for i,rgb in enumerate(reserved):a[np.all(src==rgb,axis=2)]=240+i
73 q=Image.fromarray(a);q.putpalette(pal);return q
74 frames=[quantize_reserved(im) for im in frames];dur=[max(10,round((times[i+1]['beginMs']-times[i]['beginMs'])/10)*10) if i+1<len(times) else 250 for i in range(len(times))]
75 dest=B/f'{row}-{side}.gif';frames[0].save(dest,save_all=True,append_images=frames[1:],duration=dur,loop=0,optimize=True,disposal=1);outputs.append(str(dest));print(dest.name,dest.stat().st_size,'ms',sum(dur))
76(B/'measurements.json').write_text(json.dumps(measure,indent=2));(B/'diff-stats.json').write_text(json.dumps(stats,indent=2));(B/'attachments.json').write_text(json.dumps(outputs,indent=2))
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This brightens default dark-mode scrollbar thumbs, leaving light mode unchanged. A human must confirm the new default appearance before merging.

No code changes detected at a25d8a9. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

External image Run configuration

External image Commits

Reviewing files that changed from the base of the PR and between 8740f312e8138d117e5864217ddabed5068b37d1 and a25d8a9d7164b3f9c3760555cda557a2d58f91e6.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The dark-mode scrollbar thumb changes from 8% to 36% white opacity. Its hover color changes from 12% to 45%. A comment documents the intended idle-thumb contrast.

Changes: Dark-mode scrollbar contrast

Layer / File(s)Summary
Update dark-mode thumb colors
apps/web/src/index.css
The dark-mode scrollbar thumb and hover colors use higher white opacity values. A comment states the intended contrast for the idle thumb.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: bugfix, size:XS

Suggested reviewers: macroscopeapp, t3dotgg

Merge Risk: External image Minimal · previous review 56088

No merge-blocking risk was identified; the scrollbar contrast change is ready for normal checks.

Pre-merge checks: Passed 4

Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main change: improving dark-mode scrollbar thumb visibility.
Description checkPassedThe description covers the problem, implementation, scope, linked issue, verification results, visual evidence, limitations, and agent details. It is sufficiently complete for review.
Linked Issues checkPassedIssue #29986 requires a dark-mode chat scrollbar that is visible and grabbable while hovering or scrolling, with at least 3:1 contrast against the background. The diff to apps/web/src/index.css (base …
Out of Scope Changes checkPassedThe whole-PR diff against the merge base changes only apps/web/src/index.css. It replaces two dark-mode scrollbar thumb opacity values and adds one explanatory CSS comment. All of these changes serve …
Full details: Linked Issues check

Explanation

Issue #29986 requires a dark-mode chat scrollbar that is visible and grabbable while hovering or scrolling, with at least 3:1 contrast against the background. The diff to apps/web/src/index.css (base to head) changes only the dark-mode tokens: --app-scrollbar-thumb goes from rgb(255 255 255 / 8%) to 36%, and --app-scrollbar-thumb-hover goes from 12% to 45%. A comment states the 3:1 target. On #000, 36% white renders as about gray 92 (sRGB relative luminance about 0.107), which gives a contrast ratio of about 3.14:1, so the idle thumb meets the stated threshold. The hover token is higher, so it also meets it. Visibility timing is unchanged, so the thumb still appears on hover or scroll, which matches the expected behavior. The issue's optional suggestions (an 'Always show scrollbars' setting, widening the bar, tying the color to the contrast setting) are not stated acceptance criteria and are not required. The PR description's capture evidence was not independently re-run; the contrast result is derived from the token values and the standard WCAG formula.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes only apps/web/src/index.css. It replaces two dark-mode scrollbar thumb opacity values and adds one explanatory CSS comment. All of these changes serve the issue #29986 objective. The PR summary and description list no other code changes. Light-mode tokens, the scrollbar width, and the ScrollArea visibility logic are not modified in the diff. The shared tokens also affect the native WebKit, Base UI ScrollArea, and Ghostty thumbs. The PR description states this effect as intended. It is a direct consequence of the token change, not an unrelated change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info

External image Run configuration

External image Commits

Reviewing files that changed from the base of the PR and between cefb544af3c98224874419198c0359b652ca3c94 and 5608847db39b4f54565dfe8a50cad9dd6f0f6d4c.

External image Files selected for processing: 1

  • apps/web/src/index.css

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Synced from GitHub

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 5608847.

This comment will update automatically after the next completed run.

Added 1 commit

  • Merge remote-tracking branch 'origin/main' into fix/issue-299868740f31

Evidence

Environment for every capture: real Linux Electron app under Xvfb, 1280×800 content viewport, standard T3 Code theme at default contrast. Each commit was built and run from its own worktree with a separate fresh database and identical synthetic conversation data.

Steps on both sides: open the completed 40-paragraph conversation, expand it, select dark mode, start at the top, scroll 650 px, locate and hover the right-edge thumb, then drag it down 150 px. Repeat in light mode. Every drag moved scrollTop from 650 to 1190. Stills passed a two-screenshot stability check 500 ms apart.

The base reproduces the faint dark thumb; the head visibly resolves it and exceeds 3:1 in both captured states. Light colors remain identical.

Driver, seed and interaction script, rendered pixel measurements.

AI-assisted; verified with the tests and tools listed above.

Not shown:

  • Standalone web-browser rendering was not proved: the built-in preview launches with --hide-scrollbars. Evidence instead proves the reported Linux desktop reproduction using real Electron.
  • Other scrollbar surfaces and custom themes were not exercised; the visual proof covers the reported conversation scrollbar in standard dark and light themes.

Added 1 commit

  • Merge branch 'main' into fix/issue-29986a25d8a9