Add a frontend screen in adepthood¶
Add a new screen to the React Native app and wire it into navigation. Verified against the repo state of 2026-07-31.
Prerequisites¶
cd frontend && npm ci- Familiarity with the feature-module layout: each domain owns a directory
under
frontend/src/features/(Auth,Course,Habits,Journal,Map,Practice,Return,Settings,Welcome,Invitations)
Steps¶
- Write the test first (Jest +
@testing-library/react-native):
import { render, fireEvent } from "@testing-library/react-native";
it("does the thing", () => {
const { getByText } = render(<MyScreen />);
fireEvent.press(getByText("Button"));
expect(getByText("Result")).toBeTruthy();
});
-
Create the screen in its feature module (a new directory under
frontend/src/features/for a new domain, or alongside siblings in an existing one). Style exclusively with Candle & Ink tokens fromfrontend/src/design/tokens.ts— no raw hex values (Candle & Ink). -
Register the route in
frontend/src/navigation/—BottomTabs.tsxfor a new tab,RootStack.tsxfor a stacked screen — and add its typed destination tonavigation/destinations.ts. -
If the screen talks to the backend, go through the shared API layer (
frontend/src/api/) and typed response schemas; state that outlives the screen belongs in a Zustand store (frontend/src/store/).
Verify¶
npm test
npm run lint # zero warnings
npx tsc --noEmit # strict mode
All exit 0, coverage stays at or above the 90% jest threshold, and the
screen renders in npm start with tokens (no hard-coded colors).