@@ -1292,9 +1292,13 @@ class GridsetProcessor extends BaseProcessor {
12921292 break ;
12931293
12941294 case 'Jump.ToKeyboard' : {
1295- // Navigate to the set keyboard if we found one in settings
1295+ // Prefer explicit keyboard page metadata when available.
1296+ // Some Gridsets resolve the keyboard page in metadata
1297+ // without preserving tree.keyboardGridName during parse.
12961298 const keyboardGridName = ( tree as any ) . keyboardGridName as string ;
1297- const keyboardPageId = gridNameToIdMap . get ( keyboardGridName ) ;
1299+ const keyboardPageId =
1300+ tree . metadata ?. defaultKeyboardPageId ||
1301+ gridNameToIdMap . get ( keyboardGridName ) ;
12981302 if ( keyboardPageId && ! navigationTarget ) {
12991303 navigationTarget = keyboardPageId ;
13001304 }
@@ -1900,6 +1904,7 @@ class GridsetProcessor extends BaseProcessor {
19001904 settingsData ?. gridSetSettings ?. keyboardGrid ||
19011905 settingsData ?. GridsetSettings ?. KeyboardGrid ;
19021906 if ( keyboardGridName && typeof keyboardGridName === 'string' ) {
1907+ ( tree as any ) . keyboardGridName = keyboardGridName ;
19031908 metadata . defaultKeyboardPageId = gridNameToIdMap . get ( keyboardGridName ) ;
19041909 }
19051910 }
@@ -1909,6 +1914,24 @@ class GridsetProcessor extends BaseProcessor {
19091914
19101915 // Set metadata on tree
19111916 tree . metadata = metadata ;
1917+ if ( metadata . defaultKeyboardPageId ) {
1918+ Object . values ( tree . pages ) . forEach ( ( page ) => {
1919+ page . buttons . forEach ( ( button ) => {
1920+ if (
1921+ button ?. semanticAction ?. platformData ?. grid3 ?. commandId === 'Jump.ToKeyboard' &&
1922+ ! button . targetPageId
1923+ ) {
1924+ button . targetPageId = metadata . defaultKeyboardPageId ;
1925+ if ( button . semanticAction ) {
1926+ button . semanticAction . targetId = metadata . defaultKeyboardPageId ;
1927+ if ( button . semanticAction . fallback ?. type === 'NAVIGATE' ) {
1928+ button . semanticAction . fallback . targetPageId = metadata . defaultKeyboardPageId ;
1929+ }
1930+ }
1931+ }
1932+ } ) ;
1933+ } ) ;
1934+ }
19121935
19131936 return tree ;
19141937 }
0 commit comments