Skip to content

Add an options page for user-configurable tier score thresholds #27

Description

@knytcomics-ui

Summary

The four tier boundaries (20/50/75/100) are hardcoded in src/lib/tiers.ts:10-47 with no way for a user to adjust sensitivity (e.g. a more risk-averse user wanting 'Elevated' to start at 10 instead of 21).

Current Behavior / Relevant Code

  • src/lib/tiers.ts:10-53 (TIERS array and tierForScore); no chrome.storage read path exists to override these constants.

Why This Matters

Risk tolerance is inherently personal -- a power user doing frequent, low-value testnet transactions has different needs than someone moving significant mainnet funds; hardcoded thresholds serve neither well by default.

Proposed Solution

  • Add a manifest.json options_page (or options_ui) entry and a settings UI for adjusting the four boundary values, persisted to chrome.storage.sync.
  • Refactor tierForScore to accept (or read) configurable boundaries while keeping sane, validated defaults (monotonically increasing, 0-100 bounded).
  • Update tiers.test.ts to cover custom boundary configurations.

Acceptance Criteria

  • Users can adjust tier thresholds via an options page.
  • Invalid configurations (non-monotonic, out-of-range) are rejected with clear validation feedback.
  • Default behavior (current hardcoded values) is preserved when no customization is made.

Definition of Done

  • npm run lint, npm run typecheck, npm test, and npm run build all pass locally and in CI
  • New or changed behavior is covered by unit tests (and integration/E2E tests where the change touches interception, background messaging, or the popup)
  • Any user-facing or architectural change is reflected in README.md
  • No regressions to the existing test suite or existing tier/interception behavior

How to Claim This Issue (Application Process)

  1. Comment first. Post a short implementation plan on this issue — your proposed approach, the files you expect to touch, and any open questions — before writing code. This prevents duplicate effort and lets a maintainer flag concerns early, which matters especially for an issue at this complexity level.
  2. Wait for assignment. A maintainer will review your plan and assign the issue to you, typically within 48 hours. Please do not open a draft PR before you're assigned.
  3. Stay active. If there's no visible activity (commits or comments) for 10 days after assignment, the issue may be unassigned and reopened to other contributors.
  4. Submit a scoped PR. Reference this issue (Closes #<issue-number>), keep the diff scoped to the acceptance criteria above, and ensure all CI gates pass before requesting review.
  5. Engage with review. Respond to review feedback within a reasonable timeframe; PRs with no response after 7 days may be closed pending resubmission when you're ready to pick it back up.

Category: State Management & Extension Lifecycle
Estimated effort: M (medium, ~3-5 days)
Difficulty: Advanced — this issue assumes familiarity with the codebase's MV3 service-worker architecture, the Freighter interception protocol, and/or the Stellar SDK.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions