Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 1153 on expanded tree #1245

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

davide-pi
Copy link

@davide-pi davide-pi commented Jun 21, 2023

Description

Fix issue #1153

Examples

Before fix After fix
image image

To Test

To test the fix the following code was used.
Is sufficient to put it into the Main method of the Program.cs in the Spectre.Console.Analyzer.Sandbox to see the difference between expanded and not expanded trees.

NOTE: Curly brackets are used to simplify code duplication for test purposes only

      {
            AnsiConsole.MarkupLine("Expaded [green]default true[/]");
            var root = new Tree("root");
            root.AddNode("node1");
            root.AddNode("node2");
            AnsiConsole.Render(root);
        }

        AnsiConsole.MarkupLine("");
        AnsiConsole.MarkupLine("");

        {
            AnsiConsole.MarkupLine("Expaded [red]false[/] in init");
            var root = new Tree("root") { Expanded = false };
            root.AddNode("node1");
            root.AddNode("node2");
            AnsiConsole.Render(root);
        }
        AnsiConsole.MarkupLine("");
        {
            AnsiConsole.MarkupLine("Expaded [green]true[/] in init");
            var root = new Tree("root") { Expanded = true };
            root.AddNode("node1");
            root.AddNode("node2");
            AnsiConsole.Render(root);
        }

        AnsiConsole.MarkupLine("");
        AnsiConsole.MarkupLine("");

        {
            AnsiConsole.MarkupLine("Expaded [red]false[/] after init");
            var root = new Tree("root");
            root.Expanded = false;
            root.AddNode("node1");
            root.AddNode("node2");
            AnsiConsole.Render(root);
        }
        AnsiConsole.MarkupLine("");
        {
            AnsiConsole.MarkupLine("Expaded [green]true[/] after init");
            var root = new Tree("root");
            root.Expanded = true;
            root.AddNode("node1");
            root.AddNode("node2");
            AnsiConsole.Render(root);
        }

Please upvote 馃憤 this pull request if you are interested in it.

@davide-pi
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant