Skip to content

feat: ✨ add vehicles browser and switch to Star Citizen Wiki API v3 spec - #288

Merged
flexbox merged 3 commits into
mainfrom
feature/spacecraft-vehicles
Nov 16, 2026
Merged

flexbox merged 3 commits into
mainfrom
feature/spacecraft-vehicles

Conversation

@flexbox

@flexbox flexbox commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a Vehicles tab and browser screen to the spacecraft app, with a VehicleCard for each entry.
  • Replaces the API client with the full Star Citizen Wiki spec (api/starcitizen.yml), generated with Orval into src/api/.
  • Vehicles are fetched from /api/vehicles (v3) with page[size]=50 and infinite scroll.
  • Pagination uses page[number] instead of page. With page, the API ignores page[size] and falls back to 30 per page.
  • VehicleCard uses the GameVehicle type. The middle chip now shows the vehicle type, because size is no longer in the schema.
  • Role, type, and production-status chips are deduplicated, since a vehicle's role and type can be the same word (e.g. "Destroyer") and caused a duplicate-key error.
  • VehiclesScreen tolerates missing data and meta, since every response field is optional in v3.

Testing

  • Ran the app on the iOS simulator: the Vehicles screen loads with no errors, pages are 50 items, and infinite scroll reached "150 of 311 vehicles".
  • Confirmed against the live API that page[size]=50&page[number]=2 returns per_page: 50, current_page: 2.
  • ESLint passes on the changed vehicle files and orval.config.ts.
  • tsc --noEmit reports no errors in the vehicle files. It still reports 10 errors in unrelated files (Card.stories.tsx, StarshipCard.test.tsx, PilotNavigator.tsx, PlanetNavigator.tsx, StarshipNavigator.tsx, PlanetsScreen.tsx, TermsScreen.tsx, withAnimated.tsx). These predate this change.
  • Not run: unit tests for VehicleCard or VehiclesScreen.

Known spec mismatches

  • The spec documents translation locales as en/de, but the API still returns en_EN/de_DE. VehicleCard reads both forms.
  • The API still returns a size field that the spec no longer lists.

- Add a Vehicles tab and details flow (VehiclesScreen, VehicleCard, VehicleNavigator)
- Generate the Star Citizen Wiki API client with orval from api/starcitizen.yml
- Add DataTableKeyValueRow and a typography theme for shared display styles
- Add ajv and orval dev dependencies and an argent MCP config for VS Code
- Replace the vehicles-only OpenAPI 3.1 spec with the full Star Citizen Wiki API 3.0 spec in api/starcitizen.yml
- Regenerate the orval client and schemas in src/api/ from the new spec
- Update VehicleCard and VehiclesScreen to match the regenerated types
- Add challenge 04 on generating a typed react-query client with Orval, with the SWAPI starships OpenAPI spec in challenges/data/swapi.yml
- Remove the spacecraft vehicles browser: its Star Citizen spec, Orval config, generated API, screen, card and navigator
- Drop the matching Orval and generated-client dependencies and update the tab navigator and routes
@flexbox
flexbox merged commit e43cc49 into main Nov 16, 2026
1 check failed
@flexbox
flexbox deleted the feature/spacecraft-vehicles branch November 16, 2026 21:28
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.

1 participant