ui: Add a 'define-diagnostic' macro.