@@ -365,14 +365,19 @@ async function init() {
365365 initOutputPalette ( data ) ;
366366
367367 // Restore tab: URL hash takes priority (explicit intent), then per-repo memory.
368+ // Default landing (no hash, no stored tab) = Decide, with its act-tab marked
369+ // active so routing state is consistent on first view.
368370 const hashTab = SLUG_TO_TAB [ location . hash . slice ( 1 ) ] ;
369371 if ( hashTab != null ) {
370372 show ( hashTab , { updateHash : false } ) ;
371373 } else if ( data . repoId ) {
372374 chrome . storage . local . get ( `repolens_tab_${ data . repoId } ` ) . then ( ( res ) => {
373375 const stored = res [ `repolens_tab_${ data . repoId } ` ] ;
374376 if ( stored != null && stored !== 9 ) show ( stored , { updateHash : true } ) ;
375- } ) . catch ( ( ) => { } ) ;
377+ else show ( 9 , { updateHash : false } ) ;
378+ } ) . catch ( ( ) => show ( 9 , { updateHash : false } ) ) ;
379+ } else {
380+ show ( 9 , { updateHash : false } ) ;
376381 }
377382
378383 // Header logo becomes Vee, reacting to the verdict (one-shot pop/squint on mount).
@@ -2235,7 +2240,7 @@ function renderSubNav(actId) {
22352240 // A single-tab act (Decide) needs no secondary row.
22362241 sub . innerHTML = tabs . length <= 1
22372242 ? ''
2238- : tabs . map ( ( n ) => `<button class="tab-btn" data-tab="${ n } ">${ TAB_LABELS [ n ] } </button>` ) . join ( '' ) ;
2243+ : tabs . map ( ( n ) => `<button class="tab-btn"${ n === 14 ? ' id="tab-sktpg"' : '' } data-tab="${ n } ">${ TAB_LABELS [ n ] } </button>` ) . join ( '' ) ;
22392244
22402245 if ( actId === 'deeper' ) {
22412246 sub . insertAdjacentHTML ( 'afterbegin' ,
@@ -2254,6 +2259,10 @@ function renderSubNav(actId) {
22542259 btn . appendChild ( i ) ;
22552260 }
22562261 } ) ;
2262+
2263+ // The Go-Deeper subnav owns the SKTPG button; re-apply its visibility setting
2264+ // now that #tab-sktpg has just been (re)rendered, so an off-toggle still hides it.
2265+ if ( actId === 'deeper' && typeof applySktpgVisibility === 'function' ) applySktpgVisibility ( ) ;
22572266}
22582267
22592268function show ( n , { updateHash = true } = { } ) {
0 commit comments