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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 1153 on expanded tree #1245

Merged

Conversation

davide-pi
Copy link
Contributor

@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
Contributor Author

@microsoft-github-policy-service agree

Copy link
Contributor

@patriksvensson patriksvensson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@patriksvensson
Copy link
Contributor

@davide-pi Looks good to me, but the PR must be rebased against main before we can merge it

@davide-pi
Copy link
Contributor Author

Thanks @patriksvensson I've merged the PR with the las changes in main!

@patriksvensson patriksvensson merged commit f8a4b22 into spectreconsole:main Sep 9, 2024
3 checks passed
@davide-pi davide-pi deleted the fix/issue-1153-expanded-tree branch September 9, 2024 18:41
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.

2 participants