Ui consistency

From waldur/waldur-homeport · View interactive version

Ui consistency is an AI agent skill from the GitHub repository waldur/waldur-homeport. Waldur HomePort UI/UX consistency patterns and design system rules. Use when creating or modifying UI components, tables, forms, buttons, dialogs, empty states, loading states, tooltips, or notifications. Enforces disabled button tooltips, empty state CTAs, proper null value display, and accessibili

How to use this skill

Skill file

UI Consistency Guidelines

Ensures consistent, accessible UI across Waldur HomePort.

Quick Reference (Critical Rules)

Null/Empty Values

// ALWAYS use renderFieldOrDash - never || 'N/A' or || ''
import { renderFieldOrDash } from '@/table/utils';
{
  renderFieldOrDash(value);
}

Disabled Buttons

// ALWAYS provide a reason explaining WHY disabled — prefer BaseButton's own
// disabledReason prop over wrapping it in a separate Tooltip
<BaseButton
  disabled={disabled}
  disabledReason={
    disabled ? translate('Resource must be in OK state') : undefined
  }
  label={translate('Action')}
/>

Empty States

// ALWAYS use NoResult with actionable CTA
<NoResult
  title={translate('No projects yet')}
  message={translate('Create your first project.')}
  actions={<CreateButton />}
/>

Disabled Styling

// Use solid color tokens - NEVER opacity
className={isDisabled ? 'text-quaternary' : ''}  // correct
className={isDisabled ? 'opacity-50' : ''}  // wrong

Decision Trees

Hide vs Disable Button?

Which Empty State?

Complete Guidelines

For full patterns, examples, and anti-patterns:

docs/ui-consistency-guidelines.md

Sections include:

Pre-Commit Checklist

Before completing UI work, verify:

Key Imports

import { NoResult } from '@/navigation/header/search/NoResult';
import { renderFieldOrDash } from '@/table/utils';
import { BaseButton, Tooltip } from 'waldur-ui';
import { hasPermission } from '@/permissions/hasPermission';
import { StateIndicator } from '@/core/StateIndicator';
import { LoadingErred } from '@/core/LoadingErred';
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.