3.2 KiB
3.2 KiB
name, description
| name | description |
|---|---|
| angular-feature | Implement or modify Angular and Ionic features in Court Pilot while following its standalone-component, Dexie service, signal, localization, styling, and testing conventions. Use for changes to pages, routes, services, settings, and user-facing web or desktop UI behavior. |
Angular Feature Workflow
Use this workflow for Angular/Ionic feature work in Court Pilot.
1. Establish the behavior
- Read
AGENTS.md. - Identify the affected route in
src/app/app.routes.tsorsrc/app/tabs/tabs.routes.ts. - Read the page component, template, SCSS, related services, and adjacent specs.
- Check
docs/domain-glossary.mdbefore changing rotation or assignment behavior. - Ask the maintainer rather than inventing a rule when a domain question remains unresolved.
2. Choose the correct layer
- Keep rendering and user interaction in the page/component.
- Keep table access and reusable persistence operations in
src/app/services/. - Use Angular signals for reactive state and
computed()for derived state. - Follow existing
liveQuery()plustoSignal()patterns for reactive Dexie queries. - If one operation writes multiple tables, consider a Dexie transaction so failure cannot leave a partial move.
- Treat
db.tschanges as schema work. Add a new schema version for released-data changes; never rewrite an existing released schema in place.
3. Follow UI conventions
- Use standalone components.
- Import Ionic controls from
@ionic/angular/standaloneand list them in componentimports. - Use
inject()for dependencies. - Register new Ionicons with
addIcons(). - Keep page HTML and SCSS beside the page TypeScript file.
- Format touched files with the root
.prettierrc; do not reformat unrelated files or apply personal overrides. - Preserve strict typing; do not use
anyto bypass domain modeling.
4. Localize user-facing text
- Add a typed key to both
enandhuinsrc/app/i18n/translations.ts. - Keep interpolation placeholders identical in both languages.
- Use
TranslatePipein templates. - Use
TranslationServicefor alerts and TypeScript-created messages. - If the Hungarian translation is unknown, ask for it instead of inventing production copy.
5. Protect platform behavior
- Guard Tauri-only APIs with
isTauri()when browser execution is possible. - Remember that Linux updates are handled by Snap, while Windows and macOS use the Tauri updater.
- Do not assume Capacitor targets are active until their intended support is confirmed.
6. Add validation
- Add or update adjacent
*.spec.tscoverage for changed behavior. - Prefer behavior assertions over creation-only tests.
- Run the narrowest relevant test first when supported by the current Karma setup.
- Run
npm run lint. - Run
npm run build. - Report every command actually run and any validation that was unavailable.
Completion checklist
- The implementation follows an existing page/service pattern.
- Domain invariants remain intact.
- New user-facing text exists in English and Hungarian.
- Persistence changes have an explicit migration strategy.
- Relevant tests were updated.
- Lint and build results were reported.
- Documentation was updated if behavior or architecture changed.