diff --git a/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/.openspec.yaml b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/.openspec.yaml new file mode 100644 index 000000000..81cd71fe0 --- /dev/null +++ b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-05-11 diff --git a/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/design.md b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/design.md new file mode 100644 index 000000000..dbb836df7 --- /dev/null +++ b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/design.md @@ -0,0 +1,42 @@ +## Context + +The signer setup QR flows reuse a shared segmented control component to switch derivation contexts (e.g., Singlesig BIP84 vs Multisig BIP48). In light mode, the inactive label can render with insufficient contrast, reducing readability in setup flows such as Passport onboarding. + +## Goals / Non-Goals + +**Goals:** +- Ensure inactive and active segmented options remain readable in light and dark themes. +- Keep current segmented behavior, interaction, and option selection logic unchanged. +- Limit scope to UI styling in the shared segmented control. + +**Non-Goals:** +- No changes to Redux slices or sagas. +- No changes to hardware signer scanning, PSBT flow, or derivation/business logic. +- No schema, MMKV, or migration changes. + +## Decisions + +1. **Set explicit unselected label color using themed text color** + - Rationale: the label currently depends on implicit text color defaults, which can be low-contrast on certain backgrounds. + - Alternative considered: adjust background color only. Rejected because text contrast remains brittle if theme tokens change. + +2. **Keep selected-state color override unchanged** + - Rationale: selected text color is already legible on the highlighted segment; changing it is unnecessary for this issue. + +3. **Apply fix in shared `SegmentController` component** + - Rationale: one targeted change fixes all screens that use this control and avoids duplicated per-screen patches. + +Affected files (expected): +- `src/components/SegmentController.tsx` (modified) + +Redux/store and data flow impact: +- Redux slices/sagas: none +- PSBT/hardware interaction flow: none +- Realm/MMKV/migrations: none + +## Risks / Trade-offs + +- **[Risk]** Theme token mismatch could still produce low contrast in custom themes. + **Mitigation:** use existing `secondaryText` token already used by sub-labels in this component. +- **[Trade-off]** Shared component update may adjust visuals beyond Passport setup. + **Mitigation:** limit change to inactive main label color only. diff --git a/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/proposal.md b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/proposal.md new file mode 100644 index 000000000..2ab8af41c --- /dev/null +++ b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/proposal.md @@ -0,0 +1,30 @@ +## Why + +On the Passport setup QR scan flow, the segmented toggle for Singlesig/Multisig has poor contrast in light mode, making the inactive option hard to read. This creates setup confusion and increases the risk of users selecting the wrong derivation mode. + +## What Changes + +- Fix text contrast in the segmented control used during signer setup flows so inactive options remain legible. +- Keep selected-state styling and interaction behavior unchanged. +- Apply only focused UI styling updates without altering signing logic, derivation handling, or navigation. + +## Capabilities + +### New Capabilities +- `signer-setup-segment-visibility`: Ensure segmented options on signer setup screens are clearly readable in supported themes. + +### Modified Capabilities +- None. + +## Impact + +- **Environments:** both mainnet and testnet (UI-only change). +- **Hardware signer compatibility:** affects setup UX for Passport and any signer flows that reuse the same segmented control; no protocol or key-handling changes. +- **Subscription tiers:** no tier gating impact. +- **Security/privacy impact:** no changes to key material handling, network calls, or storage; display-only improvement. + +## Non-goals + +- No changes to derivation path defaults (BIP84/BIP48) or signer setup business logic. +- No redesign of segmented layout, spacing, or animation behavior beyond readability fixes. +- No changes to unrelated setup screens. diff --git a/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/specs/signer-setup-segment-visibility/spec.md b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/specs/signer-setup-segment-visibility/spec.md new file mode 100644 index 000000000..0f09e49e8 --- /dev/null +++ b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/specs/signer-setup-segment-visibility/spec.md @@ -0,0 +1,14 @@ +## ADDED Requirements + +### Requirement: Signer setup segmented options remain readable +The system MUST render both selected and unselected options in the signer setup segmented controller with sufficient visual contrast in supported themes, so users can identify Singlesig and Multisig choices during setup. + +#### Scenario: Readable inactive option in light theme +- **GIVEN** a user is on a signer setup flow that shows the segmented controller for Singlesig and Multisig selection +- **WHEN** one option is inactive in light theme +- **THEN** the inactive option label SHALL remain clearly readable against the segmented control background + +#### Scenario: Selected option remains readable after contrast fix +- **GIVEN** a user is on a signer setup flow with the segmented controller rendered +- **WHEN** the user selects either Singlesig or Multisig +- **THEN** the selected option label SHALL remain readable on the selected segment background diff --git a/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/tasks.md b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/tasks.md new file mode 100644 index 000000000..02edc08e8 --- /dev/null +++ b/openspec/changes/archive/2026-05-11-fix-passport-setup-segment-contrast/tasks.md @@ -0,0 +1,20 @@ +## 1. UI Components + +- [x] 1.1 Update `src/components/SegmentController.tsx` so inactive segment labels use explicit themed text color for readability. +- [x] 1.2 Keep selected segment label styling unchanged and verify Singlesig/Multisig labels remain readable. + +## 2. Business Logic / Hooks + +- [x] 2.1 Confirm no changes are required to signer setup flow logic or hooks; keep behavior unchanged. + +## 3. Store (Slice + Saga) + +- [x] 3.1 Confirm no Redux slice/saga updates are needed for this UI-only fix. + +## 4. Storage + +- [x] 4.1 Confirm no Realm/MMKV schema or persisted state changes are needed. + +## 5. Tests + +- [x] 5.1 Run targeted existing validation for changed UI file(s) and ensure no regressions in the touched area. diff --git a/openspec/specs/signer-setup-segment-visibility/spec.md b/openspec/specs/signer-setup-segment-visibility/spec.md new file mode 100644 index 000000000..8d960dc1c --- /dev/null +++ b/openspec/specs/signer-setup-segment-visibility/spec.md @@ -0,0 +1,18 @@ +# signer-setup-segment-visibility Specification + +## Purpose +TBD - created by archiving change fix-passport-setup-segment-contrast. Update Purpose after archive. +## Requirements +### Requirement: Signer setup segmented options remain readable +The system MUST render both selected and unselected options in the signer setup segmented controller with sufficient visual contrast in supported themes, so users can identify Singlesig and Multisig choices during setup. + +#### Scenario: Readable inactive option in light theme +- **GIVEN** a user is on a signer setup flow that shows the segmented controller for Singlesig and Multisig selection +- **WHEN** one option is inactive in light theme +- **THEN** the inactive option label SHALL remain clearly readable against the segmented control background + +#### Scenario: Selected option remains readable after contrast fix +- **GIVEN** a user is on a signer setup flow with the segmented controller rendered +- **WHEN** the user selects either Singlesig or Multisig +- **THEN** the selected option label SHALL remain readable on the selected segment background + diff --git a/src/components/SegmentController.tsx b/src/components/SegmentController.tsx index c750a0716..c10b15061 100644 --- a/src/components/SegmentController.tsx +++ b/src/components/SegmentController.tsx @@ -59,7 +59,10 @@ export const SegmentedController = ({ /> {options.map((option, index) => ( handlePress(index)} style={styles.option}> - + {option.label}