How to use 'isVisible' for toolbar icons

How to use ‘isVisible’ for toolbar icons? I tried to add it to the toolbar registration, but it did not take effect,like this,so where should I implement this method?
517cdc4a7282a9ac847a76307cfbd83

 isVisible: () => true,

Have you tried this ?

Yes, I tried, but it didn’t take effect.

@xiaofan I do not believe that isVisible is supported for the global toolbar, only if the command is enabled/disabled. The interface is also defined as:

where isVisible is omitted:

I understand what you mean. Thank you for your reply.