## Package-Specific Constraints

- **React Compiler is enabled.** Prefer compiler-led memoization and do not add `useMemo`, `useCallback`, or `React.memo` by default. Exception: if `eslint-plugin-react-hooks` reports `react-hooks/incompatible-library`, treat the affected component or hook as outside React Compiler optimization and follow the library's own usage and performance guidance instead of compiler assumptions. Prefer compiler-compatible alternative APIs when the library provides one.
- If a library hook needs `react-hooks/incompatible-library`, keep that hook in a leaf render component. Custom hooks may still own app state and event logic around that library, but they must not create and return mutable library instances. When introducing a new incompatible-library hook, add a matching ESLint restriction in the same change so custom hook files cannot hide it behind another boundary.
- `react-hooks/todo` is intentionally enabled in the repo lint config because it exposes React Compiler bailout diagnostics that are otherwise easy to miss, including unsupported `try/catch/finally` shapes.
- Prefer shadcn/ui components
- `src/shared/ui/` is reserved for shadcn/ui primitives and thin local patches to those files.
- Repo-owned shared components must not be added under `src/shared/ui/`; place them in a separate shared directory such as `src/shared/components/` so they stay linted.
- Shared helpers live under `src/shared/lib/`.
- Feature internals should default to `ui/`, `api/`, `model/`, and `hooks/`.
- The frontend uses vertical feature slices rooted under `src/features/`.
- Slice boundaries between `src/app/**`, `src/routes/**`, and `src/features/**` are enforced with `dependency-cruiser`.
- Inside a feature, prefer relative imports for feature-local code.
- Validate frontend slice-boundary changes with `pnpm run depcruise:frontend` or the repo-root `pnpm run check`.
- `src/app/**` and `src/routes/**` should consume only feature barrel exports such as `@/features/<feature>`.
- Test support modules should be named `test-utils.ts` or `test-utils.tsx`, colocated with the tests they support.

## Generated Files (Do Not Edit Manually)

- `src/shared/lib/bindings.ts` is generated by `tauri-specta`.
- Regenerate IPC bindings with `pnpm run gen:bindings` (from this package) or
  `pnpm --filter fricon-ui run gen:bindings` (from repo root).
- `src/routeTree.gen.ts` is generated by TanStack Router.
- Run shadcn cli with `pnpm --filter fricon-ui exec shadcn` (from repo root).

## Routing Rules Used in This Package

- Router is file-based under `src/routes/`.
- Under `src/routes/`, test/helper files must use a filename or folder prefixed with `-`
  so route generation skips them.

## Backend Integration Boundary

- Keep the generic Tauri bridge minimal in `src/shared/lib/tauri.ts`.
- Keep wire-to-domain normalization and query/event wiring inside feature-local `api/` modules.
- Prefer typed APIs from generated bindings (`events.*`, commands, payload types)
  instead of hardcoded Tauri event strings.
- Only `src/shared/lib/tauri.ts` and feature-local `api/*` modules should import from `src/shared/lib/bindings.ts`.
