docs: update documentation of STA

This commit is contained in:
2026-05-15 10:01:36 +02:00
parent 94105a040c
commit 8cf13503da
9 changed files with 266 additions and 288 deletions

View File

@@ -28,7 +28,7 @@
--------------
* TODO Development phases [4/9]
* TODO Development phases [5/9]
** DONE Phase 1: Setup & Foundation (0.5 days) [8/8]
*Purpose*: Initialize project dependencies and directory structure
@@ -587,7 +587,9 @@ CLOSED: [2026-01-22 jeu. 00:02]
--------------
** STARTED Phase 4: US1 - Monitor & Toggle Relay States (MVP) (2 days) [3/5]
** DONE Phase 4: US1 - Monitor & Toggle Relay States (MVP) (2 days) [5/5]
CLOSED: [2026-05-15 ven. 03:59]
- State "DONE" from "STARTED" [2026-05-15 ven. 03:59]
- State "STARTED" from "TODO" [2026-01-23 ven. 20:20]
*Goal*: View current state of all 8 relays + toggle individual relay on/off
@@ -891,12 +893,14 @@ CLOSED: [2026-05-14 jeu. 20:09]
- *File*: =src/presentation/api/relay_api.rs=
- *Complexity*: Low | *Uncertainty*: Low
*** TODO Frontend Implementation [1/2]
*** DONE Frontend Implementation [2/2]
CLOSED: [2026-05-15 ven. 03:57]
- State "DONE" from "TODO" [2026-05-15 ven. 03:57]
- [X] *T052* [P] [US1] [TDD] Create =RelayDto= TypeScript interface
- Generate from OpenAPI spec or manually define
- *File*: =frontend/src/types/relay.ts=
- *Complexity*: Low | *Uncertainty*: Low
- [ ] *T053* [P] [US1] [TDD] Create API client service
- [X] *T053* [P] [US1] [TDD] Create API client service
- getAllRelays(): =Promise<RelayDto[]>=
- =toggleRelay(id: number): Promise=
- *File*: =frontend/src/api/relayApi.ts=
@@ -904,12 +908,14 @@ CLOSED: [2026-05-14 jeu. 20:09]
--------------
*** TODO T046: HTTP Polling Composable (DECOMPOSED) [0/7]
*** DONE T046: HTTP Polling Composable (DECOMPOSED) [7/7]
CLOSED: [2026-05-15 ven. 03:59]
- State "DONE" from "TODO" [2026-05-15 ven. 03:59]
*Complexity*: High → Broken into 4 sub-tasks
*Uncertainty*: Medium
*Rationale*: Vue 3 lifecycle hooks, polling management, memory leak prevention
- [ ] *T046a* [US1] [TDD] Create =useRelayPolling= composable structure
- [X] *T046a* [US1] [TDD] Create =useRelayPolling= composable structure
- Setup reactive refs: =relays=, =isLoading=, =error=, =lastFetchTime=
- Define interval variable and fetch function signature
@@ -948,10 +954,10 @@ CLOSED: [2026-05-14 jeu. 20:09]
*TDD Checklist*:
- [ ] Test: Composable returns correct reactive refs
- [ ] Test: Initial state is ~loading=true~, ~relays=[]~, ~error=null~
- [X] Test: Composable returns correct reactive refs
- [X] Test: Initial state is ~loading=true~, ~relays=[]~, ~error=null~
- [ ] *T046b* [US1] [TDD] Implement =fetchData= with parallel requests
- [X] *T046b* [US1] [TDD] Implement =fetchData= with parallel requests
- Fetch relays and health status in parallel using =Promise.all=
- Update reactive state on success
@@ -985,12 +991,12 @@ CLOSED: [2026-05-14 jeu. 20:09]
*TDD Checklist*:
- [ ] Test: =fetchData()= updates relays on success
- [ ] Test: =fetchData()= sets error on API failure
- [ ] Test: =fetchData()= sets ~isLoading=false~ after completion
- [ ] Test: =fetchData()= updates =lastFetchTime=
- [X] Test: =fetchData()= updates relays on success
- [X] Test: =fetchData()= sets error on API failure
- [X] Test: =fetchData()= sets ~isLoading=false~ after completion
- [X] Test: =fetchData()= updates =lastFetchTime=
- [ ] *T046c* [US1] [TDD] Implement polling lifecycle with cleanup
- [X] *T046c* [US1] [TDD] Implement polling lifecycle with cleanup
- =startPolling()=: Fetch immediately, then =setInterval=
- =stopPolling()=: =clearInterval= and =cleanup=
@@ -1029,12 +1035,12 @@ CLOSED: [2026-05-14 jeu. 20:09]
*TDD Checklist*:
- [ ] Test: =startPolling()= triggers immediate fetch
- [ ] Test: =startPolling()= sets interval for subsequent fetches
- [ ] Test: =stopPolling()= clears interval
- [ ] Test: =onUnmounted= hook calls =stopPolling()=
- [X] Test: =startPolling()= triggers immediate fetch
- [X] Test: =startPolling()= sets interval for subsequent fetches
- [X] Test: =stopPolling()= clears interval
- [X] Test: =onUnmounted= hook calls =stopPolling()=
- [ ] *T046d* [US1] [TDD] Add connection status tracking
- [X] *T046d* [US1] [TDD] Add connection status tracking
- Track =isConnected= based on fetch success/failure
- Display connection status in UI
@@ -1059,25 +1065,25 @@ CLOSED: [2026-05-14 jeu. 20:09]
*TDD Checklist*:
- [ ] Test: =isConnected= is true after successful fetch
- [ ] Test: =isConnected= is false after failed fetch
- [X] Test: =isConnected= is true after successful fetch
- [X] Test: =isConnected= is false after failed fetch
--------------
- [ ] *T055* [US1] [TDD] Create =RelayCard= component
- [X] *T055* [US1] [TDD] Create =RelayCard= component
- Props: relay (=RelayDto=)
- Display relay ID, state, label
- Emit toggle event on button click
- *File*: =frontend/src/components/RelayCard.vue=
- *Complexity*: Low | *Uncertainty*: Low
- [ ] *T056* [US1] [TDD] Create =RelayGrid= component
- [X] *T056* [US1] [TDD] Create =RelayGrid= component
- Use =useRelayPolling= composable
- Render 8 RelayCard components
- Handle toggle events by calling API
- Display loading/error states
- *File*: =frontend/src/components/RelayGrid.vue=
- *Complexity*: Medium | *Uncertainty*: Low
- [ ] *T057* [US1] [TDD] Integration test for US1
- [X] *T057* [US1] [TDD] Integration test for US1
- End-to-end test: Load page → see 8 relays → toggle relay 1 → verify state change
- Use Playwright or Cypress
- *File*: =frontend/tests/e2e/relay-control.spec.ts=