Frontend component consolidation
Ten months into frontend development, the codebase was working but not consistent. Domains had grown their own card components, playgrounds had fallen behind the patterns the team had settled on, and collection pages had drifted from each other in ways that had no good reason. Before starting the formula workspace in earnest, we stopped and fixed it.
What we built
A shared CollectionView component that handles both card and table layouts from the same configuration, a shared RecordCard component that gives every collection the same card contract, and a CollectionViewToggle that lets users switch between the two. The collection pattern was consolidated into one shared pipeline: one column config drives the table columns, the card slots, and the search and sort fields. The Formula collection was then built directly on that pattern.
Alongside that, a pass through the dev playgrounds to bring them back into alignment. Playgrounds are where developers go to see the correct implementation pattern for a component and test new things in isolation. After a sustained period of feature work they had started to drift, and some demonstrated patterns we had moved on from.
The problem it solves
The original design was for domains to use shared collection and card components. In practice, development had produced bespoke implementations: CompanyCard was 275 lines managing its own layout, RecipeCard was a separate domain-specific component, and the existing collection implementation had accumulated domain-specific behaviour that belonged in shared components.
None of it was deliberate. It is what happens when the pace of feature work outpaces the housekeeping. The Company Profile posts from earlier in the series were the point at which the collection patterns had solidified enough to be worth enforcing. This cleanup established those patterns as the gold standard before we started building more collection pages.
The challenges
The main work was in the collection pipeline. Different pages had accumulated different approaches to filtering, sorting and type discrimination. Making them consistent required extracting a shared typeFilters module and tightening the contracts that collection orchestrators depend on. The drift fix commit touched twelve files and added 84 tests for the collection predicates.
The card consolidation was more straightforward once the target shape was clear. CompanyCard was deleted. RecipeCard was deleted. Both pages now compose their card layout from the shared RecordCard contract. The domain code describes what to show; the component handles how to show it.
What makes this different
The point of the consolidation is not the components themselves. It is that a developer adding a new collection page now has one clear reference for how to do it. The playgrounds demonstrate the correct patterns. The shared components enforce the contracts. The formula workspace that comes next is the first collection built entirely on the consolidated foundation rather than alongside it.
Responsive behaviour - from phone through desktop - is part of the definition of done for every screen. The card and table toggle exists because different contexts call for different views, not because one is for desktop and the other for mobile.
What this unlocks
The frontend now has a stable, consistent foundation for the next phase of product work. Adding a collection page is a contained operation with a clear pattern to follow. The playgrounds accurately show what that pattern looks like.
This is also the transition point in this series. The posts up to here have reconstructed the development history from the start of the project. From here the build log runs fortnightly, covering work as it happens.
What's next
The formula workspace. Oil selection, ingredient weights, recipe steps, and the property results the saponification and prediction engine produces. The collection and creation flow are already there. The work the earlier backend posts described now gets its full frontend surface.
Liked this post? Tap the heart to let us know.
Get early access
Be the first to hear about early access, roadmap updates, and exclusive early adopter pricing.
Join the early access list