Browse Source

Make new architecture the default and validate all tests pass

Co-authored-by: tig <[email protected]>
copilot-swe-agent[bot] 2 months ago
parent
commit
ae980c392e

+ 1 - 1
Terminal.Gui/Text/TextFormatter.cs

@@ -34,7 +34,7 @@ public class TextFormatter
     ///     When true, the Draw method will use the new separated formatter/renderer architecture.
     ///     When true, the Draw method will use the new separated formatter/renderer architecture.
     ///     This provides better performance and addresses Format/Draw coupling issues.
     ///     This provides better performance and addresses Format/Draw coupling issues.
     /// </summary>
     /// </summary>
-    public bool UseNewArchitecture { get; set; } = false;
+    public bool UseNewArchitecture { get; set; } = true;
 
 
     /// <summary>
     /// <summary>
     ///     Initializes a new instance of the <see cref="TextFormatter"/> class.
     ///     Initializes a new instance of the <see cref="TextFormatter"/> class.

+ 7 - 4
Tests/UnitTestsParallelizable/Text/TextFormatterNewArchitectureTests.cs

@@ -150,17 +150,17 @@ public class TextFormatterNewArchitectureTests
     }
     }
 
 
     [Fact]
     [Fact]
-    public void TextFormatter_UseNewArchitecture_Flag_Works()
+    public void TextFormatter_UseNewArchitecture_Flag_DefaultsToTrue()
     {
     {
         Application.Init(new FakeDriver());
         Application.Init(new FakeDriver());
 
 
         var tf = new TextFormatter
         var tf = new TextFormatter
         {
         {
-            Text = "Hello World",
-            UseNewArchitecture = true // Enable new architecture
+            Text = "Hello World"
+            // UseNewArchitecture defaults to true now
         };
         };
 
 
-        // This should now use the new architecture via the Draw method
+        // This should use the new architecture by default
         tf.Draw(new Rectangle(0, 0, 10, 1), Attribute.Default, Attribute.Default);
         tf.Draw(new Rectangle(0, 0, 10, 1), Attribute.Default, Attribute.Default);
         
         
         // Test that the new architecture produces results
         // Test that the new architecture produces results
@@ -168,6 +168,9 @@ public class TextFormatterNewArchitectureTests
         Assert.True(size.Width > 0);
         Assert.True(size.Width > 0);
         Assert.True(size.Height > 0);
         Assert.True(size.Height > 0);
         
         
+        // Verify default is true
+        Assert.True(tf.UseNewArchitecture);
+        
         Application.Shutdown();
         Application.Shutdown();
     }
     }
 }
 }