---

description: "Task list for Bottom Navigation with Chat Entry"
---

# Tasks: Bottom Navigation with Chat Entry

**Input**: Design documents from `/specs/001-bottom-nav/`
**Prerequisites**: plan.md (required), spec.md (required for user stories), research.md, data-model.md, contracts/

**Tests**: Include targeted widget/provider tests for navigation guards and store selection per constitution/testing discipline.

**Organization**: Tasks are grouped by user story to enable independent implementation and testing of each story.

## Format: `[ID] [P?] [Story] Description`

- **[P]**: Can run in parallel (different files, no dependencies)
- **[Story]**: Which user story this task belongs to (e.g., US1, US2, US3)
- Include exact file paths in descriptions

## Path Conventions

- Flutter app: `lib/` (core, data, domain, presentation, router), generated code next to sources; tests under `test/` mirroring lib paths.
- Assets: `assets/images/` with entries in `pubspec.yaml`.
- If feature adds backend/API artifacts, document paths explicitly in plan.md.

## Phase 1: Setup (Shared Infrastructure)

**Purpose**: Project initialization and basic structure

- [X] T001 Confirm feature branch `001-bottom-nav` checked out and sync spec/plan in `specs/001-bottom-nav/`
- [X] T002 Validate Flutter/Dart toolchain version in `pubspec.yaml` matches plan (Flutter 3.38.3 / Dart 3.10.1)
- [X] T003 [P] Ensure STYLE_GUIDE-compliant icon assets/definitions exist for Home/Store/Chat/Settings in `lib/presentation/resources/` or add references

---

## Phase 2: Foundational (Blocking Prerequisites)

**Purpose**: Core infrastructure that MUST be complete before ANY user story can be implemented

**⚠️ CRITICAL**: No user story work can begin until this phase is complete

- [X] T004 Establish GoRouter shell route or nav scaffold for bottom navigation container in `lib/router/app_router.dart`
- [X] T005 Define/extend navigation tab state provider to preserve per-tab stacks in `lib/presentation/providers/navigation_tab_provider.dart`
- [X] T006 [P] Ensure store context provider exposes current store/availability for tab badge in `lib/presentation/providers/selected_store_provider.dart`
- [X] T007 [P] Add shared bottom nav UI component following STYLE_GUIDE in `lib/presentation/widgets/navigation/bottom_nav.dart`
- [X] T008 Wire bottom nav visibility guard for onboarding/auth flows in `lib/router/app_router.dart`

**Checkpoint**: Foundation ready - user story implementation can now begin in parallel

---

## Phase 3: User Story 1 - Navigate Core Areas Quickly (Priority: P1) 🎯 MVP

**Goal**: Persistent bottom nav enabling fast switching between Home, Store, and Settings with active state and preserved tab state.

**Independent Test**: From any signed-in screen, switch tabs and confirm target screen opens with correct active highlight and prior state retained.

### Tests for User Story 1

- [X] T009 [P] [US1] Widget test for bottom nav rendering/active state in `test/presentation/widgets/bottom_nav_test.dart`
- [X] T010 [P] [US1] Widget test verifying tab switch preserves Home/Settings state in `test/presentation/navigation/tab_state_preservation_test.dart`

### Implementation for User Story 1

- [X] T011 [US1] Implement bottom nav widget with icons/labels/active styling in `lib/presentation/widgets/navigation/bottom_nav.dart`
- [X] T012 [P] [US1] Hook tab navigation to GoRouter routes (Home/Store/Settings) in `lib/router/app_router.dart`
- [X] T013 [P] [US1] Manage tab state persistence in `lib/presentation/providers/navigation_tab_provider.dart`
- [X] T014 [US1] Add visibility logic to hide nav on onboarding/full-screen flows in `lib/router/app_router.dart`

**Checkpoint**: User Story 1 fully functional and testable independently

---

## Phase 4: User Story 2 - Switch Store Context (Priority: P2)

**Goal**: Store tab shows current store, lists available stores, and allows confirmed switching with offline/error handling.

**Independent Test**: Open Store tab, change store, confirm app reflects new store; offline/error states show retries without blocking nav.

### Tests for User Story 2

- [X] T015 [P] [US2] Widget test for Store tab loading/empty/error/offline states in `test/presentation/store/store_tab_states_test.dart`
- [X] T016 [P] [US2] Provider test for store selection update/confirmation in `test/domain/store/store_context_provider_test.dart`

### Implementation for User Story 2

- [X] T017 [US2] Display current store label/badge on Store tab entry point in `lib/presentation/widgets/navigation/bottom_nav.dart`
- [X] T018 [P] [US2] Implement Store tab UI with list, selection, confirmation, and warning on unsaved work in `lib/presentation/screens/store_selector/store_selector_screen.dart`
- [X] T019 [P] [US2] Call store list/select endpoints via existing provider/repo in `lib/presentation/providers/selected_store_provider.dart`
- [X] T020 [US2] Handle offline/error states with retry messaging per STYLE_GUIDE in `lib/presentation/screens/store_selector/store_selector_screen.dart`
- [X] T021 [US2] Ensure store switch updates shared context and downstream screens via provider notifiers in `lib/presentation/providers/selected_store_provider.dart`

**Checkpoint**: User Story 1 and 2 functional and independently testable

---

## Phase 5: User Story 3 - Access Chat Entry Point (Priority: P3)

**Goal**: Chat tab opens a chat container with clear availability/coming-soon messaging and non-blocking navigation.

**Independent Test**: From any tab, open Chat and see availability/placeholder; return to other tabs without state loss, including offline scenarios.

### Tests for User Story 3

- [X] T022 [P] [US3] Widget test for chat placeholder availability/offline messaging and nav return in `test/presentation/chat/chat_placeholder_test.dart`

### Implementation for User Story 3

- [X] T023 [US3] Add Chat tab entry and route wiring to chat container in `lib/router/app_router.dart`
- [X] T024 [P] [US3] Implement chat placeholder UI with availability/offline messaging in `lib/presentation/screens/chat/chat_tab.dart`
- [X] T025 [US3] Ensure chat tab does not block other navigation and respects nav state provider in `lib/presentation/providers/navigation_tab_provider.dart`

**Checkpoint**: All user stories independently functional

---

## Phase N: Polish & Cross-Cutting Concerns

**Purpose**: Improvements that affect multiple user stories

- [X] T026 [P] Add telemetry/logging hooks for tab usage and store switch outcomes in `lib/presentation/widgets/navigation/bottom_nav.dart`
- [X] T027 Refine accessibility labels for nav items and states in `lib/presentation/widgets/navigation/bottom_nav.dart`
- [X] T028 [P] Update documentation/quickstart with navigation/store/chat notes in `specs/001-bottom-nav/quickstart.md`
- [ ] T029 Run full test suite `flutter test` and address any navigation/store/chat regressions
- [X] T030 Code cleanup and ensure STYLE_GUIDE compliance across new widgets in `lib/presentation/`

---

## Dependencies & Execution Order

### Phase Dependencies

- Setup (Phase 1): No dependencies - start immediately.
- Foundational (Phase 2): Depends on Setup completion - BLOCKS all user stories.
- User Stories (Phase 3+): Depend on Foundational completion; can proceed in priority order or parallel if capacity allows.
- Polish (Final Phase): Depends on completion of targeted user stories.

### User Story Dependencies

- User Story 1 (P1): Starts after Foundational; no dependency on other stories.
- User Story 2 (P2): Starts after Foundational; uses Store context provider; independent of US1 logic.
- User Story 3 (P3): Starts after Foundational; independent; relies only on nav scaffold from US1 foundation.

### Within Each User Story

- Tests (if included) should be authored before implementation and run to fail initially.
- Models/providers before UI wiring; UI before guard integration; finalize with state preservation checks.
- Story completion validated via independent test criteria before moving to next priority.

### Parallel Opportunities

- Setup T001-T003 can run concurrently.
- Foundational T005-T007 and T008 can run in parallel after T004.
- After Foundational, US1/US2/US3 tasks in different files can proceed in parallel; marked [P] tasks are safe to parallelize.
- Tests within each story marked [P] can be developed/executed concurrently.

## Parallel Example: User Story 1

```bash
# In parallel
dart test test/presentation/widgets/bottom_nav_test.dart &
dart test test/presentation/navigation/tab_state_preservation_test.dart &
wait
```
