Skip to content

[Easy] fix(web): narrow setRole(e.target.value as any) to the role union #290

Description

@K1NGD4VID

Context

Navbar's role selector casts the raw select value to any. These any casts hide real bugs -- replace with proper types (or unknown with a narrowing guard).

Where

  • File: apps/web/components/shared/Navbar.tsx
  • Line: 128

Current Behavior

Explicit any cast at this line.

Expected Behavior

Narrow type (a union, an interface, or unknown with a guard).

Proposed Approach

  1. Look up the actual runtime shape (Freighter API types, Horizon SDK types, or your own domain types).
  2. Replace the any with the proper type.
  3. If the value is genuinely dynamic, use unknown and narrow with a typeof / in / schema-parse check.
  4. Run tsc --noEmit.

Acceptance Criteria

  • No any on this line
  • TypeScript build passes

Definition of Done

  • PR links back with Closes #<this-issue-number>.

  • CI is green (both Verify TypeScript Frontend & SDK and Verify Go Indexer & API jobs must pass).

  • Local verification:

  • pnpm --filter web exec tsc --noEmit clean

  • pnpm build succeeds

  • pnpm --filter web lint clean

  • pnpm --filter web test green

Related Issues

#210

Contributor Tips

  • Web app lives in apps/web/ (Next.js 15 App Router, TypeScript, Tailwind, shadcn).
  • Shared SDK is packages/sdk/. Rebuild with pnpm --filter @trusttrove/sdk build if you change it.
  • Iterate locally with pnpm --filter web dev -- connect Freighter to the Stellar testnet.
  • Type-check with pnpm --filter web exec tsc --noEmit before pushing.
  • Run tests with pnpm --filter web test.

Tech Stack

frontend

How to Claim

Comment .take (or say you're working on it) and open a PR with Closes #<this-issue-number> in the description.

Difficulty: Easy (complexity:low) -- used for Drips Wave point allocation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions