Commit b5ce8b9
authored
Add reserve pressure user input to dive planner (#67)
* UI tests for editable reserve pressure field (TDD red)
* Implement requirements for UX of user input of reserve pressure in dive planning
* Add tests for plan calculator to ensure that user entry of reserve is respected in the calculations
* Update dive planner to respect reserve pressure entered by user (TDD green phase)
* dart format . corrections
* fix: use ref.read for pressureUnitProvider to prevent plan state reset
ref.watch inside divePlanNotifierProvider caused the entire notifier to be
recreated when the user changed their pressure unit in settings, destroying
all in-progress plan segments, tanks, and edits.
Changed to ref.read since the pressure unit is only needed to compute the
initial default reserve pressure value, not to reactively track changes.
Fixes CODE_REVIEW.md issue #1 (HIGH).
* feat: validate reserve pressure input with localized errors
* fix: wrap reserve pressure input in Expanded to prevent row overflow on narrow screens
* feat: reset to default reserve pressure when field cleared, with localized info message
* fix: add Semantics label to reserve pressure TextField for screen readers
* fix: display exact user-entered reserve pressure in warning messages
* refactor: extract magic number 50 to DivePlanState.kDefaultReservePressureBar constant
* style: dart format corrections
* fix: use max tank pressure instead of sum for reserve validation to match calculator logic
* Add pull request description for editable reserve pressure feature
* fix: enforce digits-only input on reserve pressure field
* Remove PUSH_TEMPLATE.md
* Add tests for missing coverage flagged by codecov bot1 parent 7dd57eb commit b5ce8b9
30 files changed
Lines changed: 1086 additions & 23 deletions
File tree
- lib
- features/dive_planner
- data/services
- domain/entities
- presentation
- providers
- widgets
- l10n/arb
- test/features/dive_planner
- data/services
- domain/entities
- presentation
- providers
- widgets
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
301 | 303 | | |
302 | 304 | | |
303 | 305 | | |
304 | | - | |
| 306 | + | |
| 307 | + | |
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
308 | 311 | | |
309 | 312 | | |
310 | | - | |
| 313 | + | |
311 | 314 | | |
312 | | - | |
| 315 | + | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
| |||
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
328 | | - | |
| 331 | + | |
| 332 | + | |
329 | 333 | | |
330 | 334 | | |
331 | 335 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
464 | 467 | | |
465 | 468 | | |
466 | 469 | | |
| |||
494 | 497 | | |
495 | 498 | | |
496 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
497 | 503 | | |
498 | 504 | | |
499 | 505 | | |
| |||
518 | 524 | | |
519 | 525 | | |
520 | 526 | | |
| 527 | + | |
521 | 528 | | |
522 | 529 | | |
523 | 530 | | |
| |||
564 | 571 | | |
565 | 572 | | |
566 | 573 | | |
| 574 | + | |
567 | 575 | | |
568 | 576 | | |
569 | 577 | | |
| |||
589 | 597 | | |
590 | 598 | | |
591 | 599 | | |
| 600 | + | |
592 | 601 | | |
593 | 602 | | |
594 | 603 | | |
| |||
609 | 618 | | |
610 | 619 | | |
611 | 620 | | |
| 621 | + | |
612 | 622 | | |
613 | 623 | | |
614 | 624 | | |
| |||
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| 59 | + | |
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
| |||
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
75 | | - | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| |||
282 | 291 | | |
283 | 292 | | |
284 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
285 | 303 | | |
286 | 304 | | |
287 | 305 | | |
| |||
365 | 383 | | |
366 | 384 | | |
367 | 385 | | |
368 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
369 | 392 | | |
370 | 393 | | |
371 | 394 | | |
| |||
387 | 410 | | |
388 | 411 | | |
389 | 412 | | |
| 413 | + | |
390 | 414 | | |
391 | 415 | | |
392 | 416 | | |
| |||
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| |||
239 | 249 | | |
240 | 250 | | |
241 | 251 | | |
242 | | - | |
243 | | - | |
244 | | - | |
| 252 | + | |
245 | 253 | | |
246 | 254 | | |
247 | 255 | | |
| |||
0 commit comments