Skip to content

Add share-by-URL for search parameters #6

Description

@grantfox-oss

Summary

There is currently no way to share a specific search with someone. This issue encodes the current search inputs (source, destination, amount, direction, and network) as URL query parameters so a user can copy the URL from their browser and share it. Opening the URL pre-fills the form and runs the search automatically.

Task

  • On search submission, push the search parameters to the URL using useRouter and useSearchParams from next/navigation.
  • On page load, read any present query parameters and use them to pre-populate the form state and trigger a search.
  • Handle malformed or partial query parameters gracefully by falling back to defaults.
  • Do not push a new history entry on polling re-fetches, only on user-initiated searches.

Acceptance Criteria

  • After a search, the URL contains query parameters representing the current inputs.
  • Pasting the URL into a new tab pre-fills the form and runs the search automatically.
  • Malformed query parameters do not crash the app.
  • The browser back button navigates to the previous search state, not a blank form.

Files in Scope

  • src/app/page.tsx
  • src/components/path-form.tsx
  • src/hooks/use-paths.ts

Complexity

  • Low

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignenhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions