File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -428,10 +428,14 @@ export async function syncPrStatus(
428428 }
429429 }
430430
431- // Fetch inline review comments for open PRs whose updatedAt has changed.
431+ const wtPaths = await getWorktreePaths ( ) ;
432+ const activeBranches = new Set ( wtPaths . keys ( ) ) ;
433+
434+ // Fetch inline review comments only for PRs matching active worktrees.
432435 // PRs that haven't been updated reuse cached comments (saves API calls).
433436 const reviewTuples : { entry : PrEntry ; repoSlug : string | undefined } [ ] = [ ] ;
434- for ( const entries of branchPrs . values ( ) ) {
437+ for ( const [ branch , entries ] of branchPrs ) {
438+ if ( ! activeBranches . has ( branch ) ) continue ;
435439 for ( const entry of entries ) {
436440 if ( entry . state !== "open" ) continue ;
437441 const cachedUpdatedAt = prUpdatedAtCache . get ( entry . url ) ;
@@ -464,8 +468,6 @@ export async function syncPrStatus(
464468 ) ;
465469 }
466470 }
467-
468- const wtPaths = await getWorktreePaths ( ) ;
469471 const seen = new Set < string > ( ) ;
470472
471473 for ( const [ branch , entries ] of branchPrs ) {
Original file line number Diff line number Diff line change @@ -27,12 +27,12 @@ function checkDeps(): Dep[] {
2727 for ( const dep of deps ) {
2828 const found = which ( dep . tool ) ;
2929 if ( found ) {
30- p . log . success ( ` ${ dep . tool } — found `) ;
30+ console . log ( ` ✓ ${ dep . tool } `) ;
3131 } else if ( dep . required ) {
32- p . log . error ( ` ${ dep . tool } — not found (required)`) ;
32+ console . log ( ` ✗ ${ dep . tool } — not found (required)`) ;
3333 missing . push ( dep ) ;
3434 } else {
35- p . log . warning ( ` ${ dep . tool } — not found (optional: ${ dep . hint } )`) ;
35+ console . log ( ` ○ ${ dep . tool } — not found (optional)`) ;
3636 }
3737 }
3838 return missing ;
@@ -144,11 +144,9 @@ if (existsSync(wmdevYaml)) {
144144}
145145
146146// Step 6 — Summary
147- p . note (
148- `1. Edit .workmux.yaml to configure pane layout for your project
149- 2. Edit .wmdev.yaml to set up service ports and profiles
150- 3. Run: wmdev` ,
151- "Next steps" ,
152- ) ;
153-
154- p . outro ( "You're all set!" ) ;
147+ p . outro ( "You're all set! Next steps:" ) ;
148+ console . log ( ) ;
149+ console . log ( " 1. Edit .workmux.yaml to configure pane layout for your project" ) ;
150+ console . log ( " 2. Edit .wmdev.yaml to set up service ports and profiles" ) ;
151+ console . log ( " 3. Run: wmdev" ) ;
152+ console . log ( ) ;
Original file line number Diff line number Diff line change 288288 Notification .requestPermission ().catch (() => {});
289289 }
290290
291- // Pause polling when tab is hidden to reduce server load.
291+ // Pause polling when tab is hidden or idle (no interaction for 60s).
292+ let idleTimer: ReturnType <typeof setTimeout >;
293+ let idle = false ;
294+
295+ function resetIdleTimer(): void {
296+ if (idle ) {
297+ idle = false ;
298+ refresh ();
299+ interval = setInterval (refresh , 5000 );
300+ }
301+ clearTimeout (idleTimer );
302+ idleTimer = setTimeout (() => {
303+ idle = true ;
304+ clearInterval (interval );
305+ }, 60_000 );
306+ }
307+
308+ document .addEventListener (" click" , resetIdleTimer );
309+ document .addEventListener (" keydown" , resetIdleTimer );
310+ resetIdleTimer ();
311+
292312 function onVisibilityChange(): void {
293313 if (document .hidden ) {
294314 clearInterval (interval );
295315 } else {
316+ resetIdleTimer ();
296317 refresh ();
297318 interval = setInterval (refresh , 5000 );
298319 }
309330
310331 return () => {
311332 clearInterval (interval );
333+ clearTimeout (idleTimer );
334+ document .removeEventListener (" click" , resetIdleTimer );
335+ document .removeEventListener (" keydown" , resetIdleTimer );
312336 window .removeEventListener (" keydown" , handleKeydown );
313337 document .removeEventListener (" visibilitychange" , onVisibilityChange );
314338 mq .removeEventListener (" change" , onMqChange );
You can’t perform that action at this time.
0 commit comments