<commit_before>package cncta.ui;

class ToolBox extends qx.ui.container.Composite
{
    private var buttons:qx.ui.container.Composite;

    public function new()
    {
        super(new qx.ui.layout.Canvas());

        this.buttons = new qx.ui.container.Composite(new qx.ui.layout.VBox(2));
        this.attach_buttons();
        this.add(this.buttons, {right: 0, top: 0});
    }

    private inline function attach_buttons()
    {
        this.add_window_button(
            "Base Builder",
            "Get BaseBuilder URL",
            new BaseBuilder()
        );
    }

    private function add_window_button(label:String, tooltip:String,
                                       window:qx.ui.window.Window)
    {
        var listener = function() {
            if (window.isVisible())
                window.close();
            else
                window.open();
        };
        this.add_button(label, tooltip, listener);
    }

    private function add_button(label:String, tooltip:String,
                                listener:Void -> Void)<commit_msg>Add chat button to ToolBox.<commit_after>package cncta.ui;

class ToolBox extends qx.ui.container.Composite
{
    private var buttons:qx.ui.container.Composite;

    public function new()
    {
        super(new qx.ui.layout.Canvas());

        this.buttons = new qx.ui.container.Composite(new qx.ui.layout.VBox(2));
        this.attach_buttons();
        this.add(this.buttons, {right: 0, top: 0});
    }

    private inline function attach_buttons()
    {
        this.add_window_button(
            "Chat",
            "Open chat",
            new ChatWindow()
        );

        this.add_window_button(
            "Base Builder",
            "Get BaseBuilder URL",
            new BaseBuilder()
        );
    }

    private function add_window_button(label:String, tooltip:String,
                                       window:qx.ui.window.Window)
    {
        var listener = function() {
            if (window.isVisible())
                window.close();
            else
                window.open();
        };
        this.add_button(label, tooltip, listener);
    }

    private function add_button(label:String, tooltip:String,
                                listener:Void -> Void)
{'fraction_non_alphanumeric': 0.10821554770318022, 'fraction_numerical': 0.00265017667844523, 'mean_word_length': 1.7125748502994012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2608130', 'n_tokens_mistral': 651, 'n_tokens_neox': 626, 'n_words': 125}