Skip to content

Settings Surface

Plan Metadata

  • Plan type: plan
  • Parent plan: N/A
  • Depends on:
  • wearables-integration.md
  • mobile-signin-flow.md
  • mobile-auth-gating.md
  • frontend-logging.md
  • Status: documentation

Status semantics: - draft: Plan is being created or updated and is not final. - approved: Plan is approved but not yet applied in code. - documentation: Code currently exists and matches the plan contract.

Update rule: - When an existing plan is edited, set status to draft until re-approved.

System Intent

  • What is being built: Basic settings-screen UI contract mapping user-visible buttons to the plan(s) they validate.
  • Primary consumer(s): main/app/app/settings.tsx.
  • Boundary (black-box scope only): User-initiated settings actions (Back, Register/Unregister, Sign out) and their owning plan boundaries.

Stage Gate Tracker

  • [x] Stage 1 Mermaid approved
  • [x] Stage 2 I/O contracts approved
  • [x] Stage 3 pseudocode/technical details approved or skipped

1. Mermaid Diagram

Reference: .agent/skills/create-mermaid-diagram/SKILL.md

flowchart TD
  A[Settings Screen - main/app/app/settings.tsx] --> B[Back button]
  A --> C[Register or Unregister button]
  A --> D[Sign out button]
  C --> E[Wearables Integration Boundary - docs/plans/wearables-integration.md]
  D --> F[Mobile Signin Flow Boundary - docs/plans/mobile-signin-flow.md]
  D --> G[Mobile Auth Gating Boundary - docs/plans/mobile-auth-gating.md]
  A --> H[Frontend Logging Boundary - docs/plans/frontend-logging.md]

2. Black-Box Inputs and Outputs

Keep this short. Define types in JSON-style blocks and capture each flow with path-level rows. - Flow naming rule: each flow uses this format: - ### Flow: `<flowname>` - - Test files: <path/to/test_file.ext>, ... (or N/A when no automated test is required) - - Core files: <path/to/core_file.ext>, ... - N/A means explicit no-test-required waiver for that flow (not a missing mapping).

Global Types

Define shared types used across multiple flows.

SettingsButtonPress {
  button_label: "Back" | "Register" | "Unregister" | "Sign out"
}

SettingsActionResult {
  success: boolean
  primary_plan: string
  secondary_plan?: string
}

Flow: main/app/app/settings.tsx.SettingsScreen

  • Test files: N/A
  • Core files: main/app/app/settings.tsx

Type Definitions

SettingsScreenInput {
  route: "/settings"
}

SettingsScreenOutput {
  title: "Settings"
  has_back_button: true
  logging_flow: "settings"
}

Paths

path-name input output/expected state change path-type notes updated
settings-screen.render SettingsScreenInput SettingsScreenOutput title=Settings has_back_button=true logging_flow=settings happy path wraps screen in logging context provider Y
settings-screen.back-button SettingsButtonPress button_label=Back SettingsActionResult success=true primary_plan=mobile-auth-gating.md subpath returns to previous route; validated under route-gating/navigation boundary Y

Flow: main/app/app/settings.tsx.SettingsScreenContent

  • Test files: N/A
  • Core files: main/app/app/settings.tsx

Type Definitions

SettingsContentInput {
  button_press: SettingsButtonPress
}

SettingsContentOutput {
  result: SettingsActionResult
  next_route?: "/(auth)/login"
  is_registered?: boolean
}

Paths

path-name input output/expected state change path-type notes updated
settings-button.register-device SettingsContentInput button_press=Register SettingsContentOutput result.success=true result.primary_plan=wearables-integration.md is_registered=true happy path calls wearable registration flow and refreshes registration state Y
settings-button.unregister-device SettingsContentInput button_press=Unregister SettingsContentOutput result.success=true result.primary_plan=wearables-integration.md is_registered=false happy path calls wearable unregistration flow and refreshes registration state Y
settings-button.sign-out SettingsContentInput button_press=Sign out SettingsContentOutput result.success=true result.primary_plan=mobile-signin-flow.md result.secondary_plan=mobile-auth-gating.md next_route=/(auth)/login happy path clears auth session then transitions user to login surface Y

3. Pseudocode / Technical Details for Critical Flows (Optional)

  • Flow name:: settings-button-to-plan-map
    render settings actions
    on register or unregister press:
      invoke wearables action and refresh registration snapshot
    on sign out press:
      invoke auth-provider signOut and route to /(auth)/login
    treat each action as a validation entry point for its mapped plan(s)
    
  • Implementation notes:
  • This plan is intentionally basic and button-oriented.
  • Sign-out is mapped to existing auth plans until a dedicated sign-out plan is authored.

After all stages are approved, apply .agent/skills/reconcile-plans/SKILL.md to propagate contract updates across linked plans.