@@ -903,19 +903,24 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
903903 localStorage . setItem ( storageKey , '1' ) ;
904904 } ,
905905
906- switchConfigMode ( mode ) {
907- const normalizedMode = typeof mode === 'string'
908- ? mode . trim ( ) . toLowerCase ( )
909- : '' ;
910- this . configMode = CONFIG_MODE_SET . has ( normalizedMode ) ? normalizedMode : 'codex' ;
911- if ( this . mainTab === 'config' ) {
912- if ( this . configMode === 'claude' ) {
913- const refresh = ( ) => {
914- this . refreshClaudeModelContext ( ) ;
915- } ;
916- if ( typeof this . scheduleAfterFrame === 'function' ) {
917- this . scheduleAfterFrame ( refresh ) ;
918- } else {
906+ switchConfigMode ( mode ) {
907+ const normalizedMode = typeof mode === 'string'
908+ ? mode . trim ( ) . toLowerCase ( )
909+ : '' ;
910+ this . configMode = CONFIG_MODE_SET . has ( normalizedMode ) ? normalizedMode : 'codex' ;
911+ if ( this . mainTab === 'config' ) {
912+ if ( this . configMode === 'claude' ) {
913+ const expectedMainTab = 'config' ;
914+ const expectedConfigMode = 'claude' ;
915+ const refresh = ( ) => {
916+ if ( this . mainTab !== expectedMainTab || this . configMode !== expectedConfigMode ) {
917+ return ;
918+ }
919+ this . refreshClaudeModelContext ( ) ;
920+ } ;
921+ if ( typeof this . scheduleAfterFrame === 'function' ) {
922+ this . scheduleAfterFrame ( refresh ) ;
923+ } else {
919924 refresh ( ) ;
920925 }
921926 }
@@ -1039,34 +1044,46 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
10391044 }
10401045 return ( Date . now ( ) - Number ( state . at || 0 ) ) <= 1000 ;
10411046 } ,
1042- onMainTabPointerDown ( tab ) {
1043- const event = arguments . length > 1 ? arguments [ 1 ] : null ;
1044- if ( event && typeof event . button === 'number' && event . button !== 0 ) {
1045- return ;
1046- }
1047+ onMainTabPointerDown ( tab ) {
1048+ const event = arguments . length > 1 ? arguments [ 1 ] : null ;
1049+ if ( event && typeof event . button === 'number' && event . button !== 0 ) {
1050+ return ;
1051+ }
10471052 const normalizedTab = typeof tab === 'string' ? tab . trim ( ) . toLowerCase ( ) : '' ;
10481053 if ( ! normalizedTab ) return ;
10491054 this . setMainTabSwitchIntent ( normalizedTab ) ;
1050- this . applyImmediateNavIntent ( normalizedTab ) ;
1051- const shouldHideSessionPanel = this . mainTab === 'sessions' && normalizedTab !== 'sessions' ;
1052- this . setSessionPanelFastHidden ( shouldHideSessionPanel ) ;
1053- this . recordPointerNavCommit ( 'main' , normalizedTab ) ;
1054- this . switchMainTab ( normalizedTab ) ;
1055- } ,
1056- onConfigTabPointerDown ( mode ) {
1057- const event = arguments . length > 1 ? arguments [ 1 ] : null ;
1055+ this . applyImmediateNavIntent ( normalizedTab ) ;
1056+ const shouldHideSessionPanel = this . mainTab === 'sessions' && normalizedTab !== 'sessions' ;
1057+ this . setSessionPanelFastHidden ( shouldHideSessionPanel ) ;
1058+ const pointerType = event && typeof event . pointerType === 'string'
1059+ ? event . pointerType . trim ( ) . toLowerCase ( )
1060+ : '' ;
1061+ if ( pointerType === 'touch' ) {
1062+ return ;
1063+ }
1064+ this . recordPointerNavCommit ( 'main' , normalizedTab ) ;
1065+ this . switchMainTab ( normalizedTab ) ;
1066+ } ,
1067+ onConfigTabPointerDown ( mode ) {
1068+ const event = arguments . length > 1 ? arguments [ 1 ] : null ;
10581069 if ( event && typeof event . button === 'number' && event . button !== 0 ) {
10591070 return ;
10601071 }
10611072 const normalizedMode = typeof mode === 'string' ? mode . trim ( ) . toLowerCase ( ) : '' ;
10621073 if ( ! normalizedMode ) return ;
1063- this . setMainTabSwitchIntent ( 'config' ) ;
1064- this . applyImmediateNavIntent ( 'config' , normalizedMode ) ;
1065- const shouldHideSessionPanel = this . mainTab === 'sessions' ;
1066- this . setSessionPanelFastHidden ( shouldHideSessionPanel ) ;
1067- this . recordPointerNavCommit ( 'config' , normalizedMode ) ;
1068- this . switchConfigMode ( normalizedMode ) ;
1069- } ,
1074+ this . setMainTabSwitchIntent ( 'config' ) ;
1075+ this . applyImmediateNavIntent ( 'config' , normalizedMode ) ;
1076+ const shouldHideSessionPanel = this . mainTab === 'sessions' ;
1077+ this . setSessionPanelFastHidden ( shouldHideSessionPanel ) ;
1078+ const pointerType = event && typeof event . pointerType === 'string'
1079+ ? event . pointerType . trim ( ) . toLowerCase ( )
1080+ : '' ;
1081+ if ( pointerType === 'touch' ) {
1082+ return ;
1083+ }
1084+ this . recordPointerNavCommit ( 'config' , normalizedMode ) ;
1085+ this . switchConfigMode ( normalizedMode ) ;
1086+ } ,
10701087 onMainTabClick ( tab ) {
10711088 const normalizedTab = typeof tab === 'string' ? tab . trim ( ) . toLowerCase ( ) : '' ;
10721089 if ( ! normalizedTab ) return ;
@@ -2027,15 +2044,20 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
20272044 }
20282045 return refreshedNodes ;
20292046 } ,
2030- getSessionMessageRefBinder ( messageKey ) {
2031- if ( ! this . isSessionTimelineNodeKey ( messageKey ) ) return null ;
2032- if ( ! this . sessionMessageRefBinderMap [ messageKey ] ) {
2033- this . sessionMessageRefBinderMap [ messageKey ] = ( el ) => {
2034- this . bindSessionMessageRef ( messageKey , el ) ;
2035- } ;
2036- }
2037- return this . sessionMessageRefBinderMap [ messageKey ] ;
2038- } ,
2047+ getSessionMessageRefBinder ( messageKey ) {
2048+ if ( ! this . isSessionTimelineNodeKey ( messageKey ) ) return null ;
2049+ const current = this . sessionMessageRefBinderMap [ messageKey ] ;
2050+ if ( ! current || current . ticket !== this . sessionTabRenderTicket ) {
2051+ const ticket = this . sessionTabRenderTicket ;
2052+ this . sessionMessageRefBinderMap [ messageKey ] = {
2053+ ticket,
2054+ bind : ( el ) => {
2055+ this . bindSessionMessageRef ( messageKey , el , ticket ) ;
2056+ }
2057+ } ;
2058+ }
2059+ return this . sessionMessageRefBinderMap [ messageKey ] . bind ;
2060+ } ,
20392061 updateSessionTimelineOffset ( ) {
20402062 const container = this . sessionPreviewContainerEl || this . $refs . sessionPreviewContainer ;
20412063 if ( ! container || ! container . style ) return ;
@@ -2046,12 +2068,13 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
20462068 const offset = headerHeight > 0 ? ( headerHeight + 12 ) : 72 ;
20472069 container . style . setProperty ( '--session-preview-header-offset' , `${ offset } px` ) ;
20482070 } ,
2049- bindSessionMessageRef ( messageKey , el ) {
2050- if ( ! this . sessionTimelineEnabled ) return ;
2051- if ( ! messageKey ) return ;
2052- if ( el ) {
2053- if ( ! this . isSessionTimelineNodeKey ( messageKey ) ) return ;
2054- if ( this . sessionMessageRefMap [ messageKey ] === el ) return ;
2071+ bindSessionMessageRef ( messageKey , el , ticket = this . sessionTabRenderTicket ) {
2072+ if ( ! this . sessionTimelineEnabled ) return ;
2073+ if ( ! messageKey ) return ;
2074+ if ( ticket !== this . sessionTabRenderTicket ) return ;
2075+ if ( el ) {
2076+ if ( ! this . isSessionTimelineNodeKey ( messageKey ) ) return ;
2077+ if ( this . sessionMessageRefMap [ messageKey ] === el ) return ;
20552078 this . sessionMessageRefMap [ messageKey ] = el ;
20562079 this . invalidateSessionTimelineMeasurementCache ( ) ;
20572080 } else {
0 commit comments