function setupUI() {
    var ctxEl = document.getElementById('contextMenu');
    document.addEventListener('mousedown', (e) => {
        // Check if mouse is not inside the context menu and menu is visible
        if (!((e.clientX >= ctxPos.x && e.clientX <= ctxPos.x + ctxEl.offsetWidth)
            && (e.clientY >= ctxPos.y && e.clientY <= ctxPos.y + ctxEl.offsetHeight))
            && (ctxPos.visible && e.which !== 3)) {
            hideContextMenu();
        }

        // Change the position of context whenever mouse is clicked
        ctxPos.x = e.clientX;
        ctxPos.y = e.clientY;
    });
    document.getElementById('canvasArea').oncontextmenu = showContextMenu;

    $('#sideBar').resizable({
        handles: 'e',
        // minWidth:270,
    });
    $('#menu, #subcircuitMenu').accordion({
        collapsible: true,
        active: false,
        heightStyle: 'content',
    });
    $('#menu2, #subcircuitMenu').accordion({
        collapsible: true,
        active: false,
        heightStyle: 'content',
    });

    $('.logixModules').mousedown(createElement);

    $('.logixButton').on('click',function () {
        logixFunction[this.id]();
    });
    // var dummyCounter=0;

    // calling apply on select theme in dropdown
    $('.applyTheme').on('change',function () {
        applyVerilogTheme();
    });


    $('.logixModules').hover(function () {
        // Tooltip can be statically defined in the prototype.
        var { tooltipText } = modules[this.id].prototype;
        if (!tooltipText) return;
        $('#Help').addClass('show');
        $('#Help').empty();
        $('#Help').append(tooltipText);
    }); // code goes in document ready fn only
    $('.logixModules').mouseleave(() => {
        $('#Help').removeClass('show');
    }); // code goes in document ready fn only

    $('#report').on('click', function() {
        var message=$('#issuetext').val();
        var email=$('#emailtext').val();
        message += "\nEmail:"+ email
        message += "\nURL: " + window.location.href;
        message += `\nUser Id: ${window.user_id}`
        postUserIssue(message)
        $('#issuetext').hide();
        $('#emailtext').hide();
        $('#report').hide();
        $('#report-label').hide();
        $('#email-label').hide();
        })
    $('.issue').on('hide.bs.modal', function(e) {
        listenToSimulator=true
        $('#result').html("");
        $('#issuetext').show();
        $('#emailtext').show();
        $('#issuetext').val("");
        $('#emailtext').val("");
        $('#report').show();
        $('#report-label').show();
        $('#email-label').show();
    })
    $('#reportIssue').on('click',function(){
      listenToSimulator=false
    })

    // $('#saveAsImg').on('click',function(){
    //     saveAsImg();
    // });
    // $('#Save').on('click',function(){
    //     Save();
    // });
    // $('#moduleProperty').draggable();
    setupPanels();
    setupVerilogExportCodeWindow();
    setupBitConvertor();
}
adds some UI elements to side bar and
menu also attaches listeners to sidebar
@category ux