Keep layout constants, feature flags, and user-configurable settings in centralized configuration modules (not hardcoded in components). Motivation: makes it easy to find and change UI “magic” values (e.g., tab width, spacing) and ensures behavior can be toggled per-environment or per-user (e.g., suppressing update banners when users turn off update checks).
How to apply:
Examples:
Move tab width into magiclayout.ts: // magiclayout.ts export const TAB_WIDTH = 175;
// tabs.tsx import { TAB_WIDTH } from ‘../../config/magiclayout’;
Check a user setting before showing an update sidebar entry: // clientConfig.ts (runtime/user settings) export const clientConfig = { checkForUpdates: true, // toggled by user };
// sidebar.tsx import { clientConfig } from ‘../../config/clientConfig’; … {clientConfig.checkForUpdates && clientData?.releaseinfo?.releaseavailable && (
)}
Notes:
Enter the URL of a public GitHub repository