Ensure that configuration user interfaces accurately reflect the underlying configuration behavior and data structures. UI controls should provide clear, transparent mapping to the actual configuration values, including precedence rules and field relationships.
Ensure that configuration user interfaces accurately reflect the underlying configuration behavior and data structures. UI controls should provide clear, transparent mapping to the actual configuration values, including precedence rules and field relationships.
When building configuration forms, avoid situations where:
For example, if your backend has precedence rules like “ValuesObject takes precedence over Values”, the UI should either:
// Bad: UI checkbox maps to multiple backend states
const isEnabled = automated.enabled !== false; // Could be undefined, true, or false
// Better: Explicit handling of configuration states
const getAutoSyncState = (automated) => {
if (automated.enabled === false) return 'disabled';
if (automated.enabled === true) return 'enabled';
return 'default-enabled'; // When enabled field is undefined
};
This prevents user confusion and ensures that configuration changes through the UI produce predictable results in the underlying system.
Enter the URL of a public GitHub repository