In the current stage, the OnSelectionChange event trigger is used as the simple trigger. In this case, unfortunately, the side bar cannot be used with this event trigger because it is required to authorize. An error of Exception: You do not have permission to call Ui.showSidebar. Required permissions: https://www.googleapis.com/auth/script.container.ui
occurs. Unfortunately, this is the current answer.
But, I think that by the future update, when the OnSelectionChange event trigger can be used as the installable trigger, your goal will be able to be achieved.
For this, how about proposing this for the issue tracker as the future request?
Reference: