@@ -1331,33 +1331,21 @@ class GridsetProcessor extends BaseProcessor {
13311331 GridGuid : page . id ,
13321332 // Calculate grid dimensions based on actual layout
13331333 ColumnDefinitions : this . calculateColumnDefinitions ( page ) ,
1334- RowDefinitions : this . calculateRowDefinitions ( page ) ,
1334+ RowDefinitions : this . calculateRowDefinitions ( page , false ) , // No automatic workspace row injection
13351335 AutoContentCommands : '' ,
13361336 Cells :
13371337 page . buttons . length > 0
13381338 ? {
13391339 Cell : [
1340- // Add workspace/message bar cell at the top of ALL pages
1341- // Grid3 uses 0-based coordinates; omit X and Y to use defaults (0, 0)
1342- {
1343- '@_ColumnSpan' : 4 ,
1344- Content : {
1345- ContentType : 'Workspace' ,
1346- ContentSubType : 'Chat' ,
1347- Style : {
1348- BasedOnStyle : 'Workspace' ,
1349- } ,
1350- } ,
1351- } ,
13521340 // Regular button cells
13531341 ...this . filterPageButtons ( page . buttons ) . map ( ( button , btnIndex ) => {
13541342 const buttonStyleId = button . style ? addStyle ( button . style ) : '' ;
13551343
13561344 // Find button position in grid layout
13571345 const position = this . findButtonPosition ( page , button , btnIndex ) ;
13581346
1359- // Shift all buttons down by 1 row to make room for workspace
1360- const yOffset = 1 ;
1347+ // Use position directly from tree
1348+ const yOffset = 0 ;
13611349
13621350 // Build CaptionAndImage object
13631351 const captionAndImage : Record < string , unknown > = {
@@ -1406,6 +1394,9 @@ class GridsetProcessor extends BaseProcessor {
14061394 '@_ColumnSpan' : position . columnSpan ,
14071395 '@_RowSpan' : position . rowSpan ,
14081396 Content : {
1397+ ContentType :
1398+ button . contentType === 'Normal' ? undefined : button . contentType ,
1399+ ContentSubType : button . contentSubType ,
14091400 Commands : this . generateCommandsFromSemanticAction ( button , tree ) ,
14101401 CaptionAndImage : captionAndImage ,
14111402 } ,
@@ -1542,15 +1533,19 @@ class GridsetProcessor extends BaseProcessor {
15421533 }
15431534
15441535 // Helper method to calculate row definitions based on page layout
1545- private calculateRowDefinitions ( page : AACPage ) : { RowDefinition : any [ ] } {
1536+ private calculateRowDefinitions (
1537+ page : AACPage ,
1538+ addWorkspaceOffset = false
1539+ ) : { RowDefinition : any [ ] } {
15461540 let maxRows = 4 ; // Default minimum
1541+ const offset = addWorkspaceOffset ? 1 : 0 ;
15471542
15481543 if ( page . grid && page . grid . length > 0 ) {
1549- maxRows = Math . max ( maxRows , page . grid . length ) ;
1544+ maxRows = Math . max ( maxRows , page . grid . length + offset ) ;
15501545 } else {
15511546 // Fallback: estimate from button count
15521547 const estimatedCols = Math . ceil ( Math . sqrt ( page . buttons . length ) ) ;
1553- maxRows = Math . max ( 4 , Math . ceil ( page . buttons . length / estimatedCols ) ) ;
1548+ maxRows = Math . max ( 4 , Math . ceil ( page . buttons . length / estimatedCols ) ) + offset ;
15541549 }
15551550
15561551 return {
0 commit comments