Abstract Factory
Your toolbar builds each widget on its own line: new WinButton() here, a checkbox three files over, a menu in the render loop. Ship the macOS skin and one of those lines keeps making the Windows part.
- ▸The bug isn't one wrong widget; it's that nothing stops a macOS button from rendering next to a Windows checkbox.
- ▸Pick the look once at startup and every widget follows; no call site decides on its own anymore.
- ▸Cheap to add a whole new skin, costly to add one widget to every skin, a deliberate trade.
A settings panel renders a button, a checkbox, and a dropdown. Each is built where it's used: if (os === 'win') new WinButton() else new MacButton() in the header, the same fork for the checkbox in the body, a third fork for the menu in the footer. Three forks, three files, all reading the same os flag.
Then a designer ships a fresh macOS look and someone updates two of the three forks. The build passes, the tests pass, every widget is valid on its own. But the footer menu still runs the old branch, so a crisp Mac button and checkbox sit above a square-cornered Windows dropdown. Nothing in the code connects the three choices, so nothing notices they disagree. The defect isn't a broken widget; it's that the three widgets were free to come from different sets.