Skip to content

Add "Load from URL" tab to GTFS selector - #13

Merged
chtitux merged 2 commits into
mainfrom
claude/add-gtfs-url-input-S9D6k
Mar 11, 2026
Merged

Add "Load from URL" tab to GTFS selector#13
chtitux merged 2 commits into
mainfrom
claude/add-gtfs-url-input-S9D6k

Conversation

@chtitux

@chtitux chtitux commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a new "Load from URL" feature to the GTFS selector, allowing users to input a GTFS feed URL directly instead of only being able to upload files or search predefined sources.

Key Changes

  • New UrlInput component: A reusable form component that accepts a GTFS feed URL, trims whitespace, and calls a callback with the result
  • "Load from URL" tab: Added to GtfsSelector as a new tab option alongside file import and source search
  • Styling: Added comprehensive CSS styles for the URL input form with focus states and hover effects
  • Exports: Exported UrlInput and UrlInputProps from the main index for standalone use
  • Tests: Added comprehensive test suite covering rendering, form submission, empty input validation, whitespace trimming, and className prop

Implementation Details

  • The UrlInput component uses React hooks (useState, useCallback) for state management
  • Form submission is prevented with e.preventDefault() and validates that the URL is not empty after trimming
  • The component integrates seamlessly with the existing tab-based UI pattern in GtfsSelector
  • Accessibility features included: proper ARIA labels, semantic HTML form elements, and keyboard support
  • Styling follows the existing design system with consistent spacing, colors, and transitions

https://claude.ai/code/session_01C57bNoi7igqU1xEtLS2Coy

claude added 2 commits March 11, 2026 15:48
Add a new UrlInput component and tab that allows users to paste a GTFS
feed URL directly. The tab is enabled by default and appears between
the file import and source search tabs. No URL format validation is
performed per design.

https://claude.ai/code/session_01C57bNoi7igqU1xEtLS2Coy
@chtitux
chtitux merged commit 799f45e into main Mar 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants