This should technically be a "dynamic command" (i.e. coming in and out of scope with the active file type) that would be treated similar to other Rmd oriented commands. See line 298 of TextFileType for other commands that are scoped to Knitted documents. 

Note however that since this command only appears on the toolbar (and doesn't have a keyboard shortcut or global menu item) nothing is broken as is, so if you want to wait to make this change until after the preview that's fine.