Skip to content

feat: add @myorg/todo library with TodoStore#110

Merged
chrisjwalk merged 12 commits into
mainfrom
feat/todo-store-109
Apr 12, 2026
Merged

feat: add @myorg/todo library with TodoStore#110
chrisjwalk merged 12 commits into
mainfrom
feat/todo-store-109

Conversation

@chrisjwalk-bot

Copy link
Copy Markdown
Collaborator

Closes #109

Changes

  • Todo model: id, title, description, completed, createdAt
  • TodoService: getAll(), create(), update(), remove()
  • TodoStore (scoped): rxResource for fetching, rxMethod for mutations
  • enableSync() / disableSync() — toggles API fetching; returns [] when disabled
  • Todo component: .ts-only, inline template, Tailwind, OnPush
  • 10 tests passing

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

7 similar comments
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@chrisjwalk chrisjwalk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please fix the linter error here?

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

chrisjwalk
chrisjwalk previously approved these changes Apr 12, 2026
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

chrisjwalk-bot and others added 12 commits April 11, 2026 21:50
- Todo model: id, title, description, completed, createdAt
- TodoService: getAll, create, update, remove
- TodoStore (scoped): rxResource for fetching, rxMethod for mutations
- enableSync/disableSync toggles API fetching (returns [] when off)
- Todo component: .ts-only, inline template, Tailwind, OnPush

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Frontend:
- TodoList, TodoForm, TodoPage components (.ts-only, Tailwind, OnPush)
- lib.routes.ts with TodoStore scoped to route
- /todos route added to app.routes.ts
- Todos nav link added to shared nav-links
- 16 passing tests across store and components

Backend:
- GET/POST /api/todos, PATCH/DELETE /api/todos/{id}
- In-memory TodoRepository (singleton, ConcurrentDictionary)
- TodoRepository registered in Program.cs
- 8 new unit tests for repository (9 total, all passing)
- Api.http updated with todo request examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- External labels (text-xs font-semibold text-on-surface-variant)
- subscriptSizing=dynamic to remove dead space below inputs
- Aligned button to bottom of fields on sm+ screens
- Remove MatLabel import (no longer needed)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Restore mat-label inside mat-form-field for proper validation display
- Wrap form in rounded-2xl bg-surface-container card to match other pages
- Keep subscriptSizing=dynamic and sm:flex-row layout

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaces plain text with a Shadcn-style alert:
- border border-outline-variant bg-surface-container-low rounded-xl p-4
- inbox icon + title + description

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rewrite TodoForm with @angular/forms/signals (experimental)
  - form() + [formField] directive replaces ReactiveFormsModule
  - required() validator with custom message
  - submit() handles validation + reset
  - computed formValid() drives button disabled state
  - Tailwind-styled native inputs (bg-surface, border-outline, focus:ring-primary)
  - Error shown inline below title input when touched + invalid
- Add curly: ['error', 'all'] to eslint.config.cjs
- Auto-fix existing curly violations in main-toolbar, wait-for-element, todo-form

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signal forms fix:
- submit() action receives FieldTree not plain model; read values
  via field.title().value() and return Promise.resolve()

Error handling:
- Add mutationError: string | null to TodoState
- Mutation tapResponse.error sets a user-friendly message in state
- Mutation tapResponse.next clears mutationError
- Add clearMutationError() store method
- TodoPage shows dismissible error banner for mutation errors
- TodoPage shows fetch error alert (cloud_off + retry button)
  when store.todos.error() is set, replacing the list

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use SignalFormControl from @angular/forms/signals/compat so the todo
form keeps signal-based validation rules while integrating with
mat-form-field / mat-label / mat-error via standard ReactiveFormsModule
formControlName binding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-110.eastus2.2.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Note

Coverage shown for affected projects only. Per-file thresholds (80%) are enforced by vitest.

Code Coverage

Package Line Rate Branch Rate Complexity Health
src 100% 100% 0
src.lib.components.counter 100% 100% 0
src.lib.components.counter-container 100% 100% 0
src.lib.state 100% 100% 0
src 100% 100% 0
src.lib.services 100% 100% 0
src.lib.state 100% 100% 0
src 100% 100% 0
src.lib.home 100% 100% 0
src 100% 100% 0
src.lib.login 100% 100% 0
src.lib.state 100% 100% 0
src 100% 100% 0
src.lib.components 98% 100% 0
src.lib.state 100% 100% 0
src.lib.testing 100% 100% 0
src 100% 100% 0
src.lib.components.forecast-table 100% 100% 0
src.lib.components.weather-forecast 100% 100% 0
src.lib.models 100% 100% 0
src.lib.services 100% 100% 0
src.lib.state 100% 100% 0
app 100% 100% 0
app.debug 83% 100% 0
Summary 99% (373 / 377) 100% (99 / 99) 0

@chrisjwalk chrisjwalk merged commit dc3e99b into main Apr 12, 2026
7 checks passed
@chrisjwalk chrisjwalk deleted the feat/todo-store-109 branch April 12, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add @myorg/todo library with TodoStore

2 participants