Expand longest active-session analytics coverage
Débutant
enhancementhelp wantedgood first issue
2 ★
Poids du clone léger
Mise à jour
Description
## User problem
The dashboard defines a continuous session as active periods separated by no
more than 30 seconds, while any idle period ends the session. Only one broad
analytics scenario currently covers this calculation.
## Expected result
Add focused unit tests that document the exact session boundaries and protect
the metric from regressions.
## Likely files
- `tests/test_analytics.py`
- `timetracker/analytics.py` only if a test reveals a defect
## Acceptance criteria
- Cover an empty period list and a single active period.
- Verify that a gap of exactly 30 seconds stays in the same session.
- Verify that a gap greater than 30 seconds starts a new session.
- Verify that an idle period always ends the current session.
- Cover overlapping active periods without double-counting elapsed time.
- Pass periods in unsorted order and verify deterministic output.
- Assert elapsed session time rather than the sum of stored durations.
## Test command
```powershell
python -m unittest tests.test_analytics -v
python -m unittest discover -v
```
Issues similaires
Tout voir
Python
Débutant
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an im…
Mise à jour
Python
Débutant
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:54…
Mise à jour
Python
Débutant
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the r…
Mise à jour