Skip to content

Add skyscanner-flights extension - #22646

Merged
raycastbot merged 15 commits into
raycast:mainfrom
ayushtom:ext/skyscanner-flights
Nov 5, 2025
Merged

raycastbot merged 15 commits into
raycast:mainfrom
ayushtom:ext/skyscanner-flights

Conversation

@ayushtom

@ayushtom ayushtom commented Nov 4, 2025 •

Copy link
Copy Markdown
Contributor

Description

A Raycast extension for quickly searching flights on Skyscanner using natural language.

Planning travel shouldn't be complicated. This extension makes it incredibly easy to search for flights - just describe your trip in plain English like "NYC to LA next Monday for 2" and instantly open Skyscanner with your search ready.

Features

  • AI-Powered Natural Language Search: Describe flights conversationally - "Direct flight from Mumbai to Dubai tomorrow" or "JFK to LAX returning Friday for 2 adults" (requires Raycast Pro)
  • 6,000+ Airports Worldwide: Search from a comprehensive offline database of airports by name, city, country, or IATA code
  • Dynamic Airport Search: Type-ahead search in dropdown fields makes finding the right airport instant
  • Auto-detect Trip Type: Automatically recognizes one-way vs round-trip from your natural language query or return date selection
  • Stops Filter: Choose between direct flights only, flights with stops, or any number of stops
  • Instant Browser Launch: Opens Skyscanner.com with all your search parameters pre-filled, ready to compare prices
  • Offline Airport Database: Airport autocomplete works without internet connection for lightning-fast searches
  • Instant Form Access: Jump straight into the search form without any AI text field - perfect for users who prefer direct input

Commands

  • Search Flights: Describe your trip in natural language or use the fallback form to enter origin, destination, dates, number of passengers, and stops preference. Press CMD + Enter to instantly open Skyscanner.com with your complete flight search ready to go.
  • Search Flights Form: Fill out the form with your origin airport, destination airport, departure date, optional return date, number of passengers (1-8), and stops preference. Press CMD + Enter to instantly open Skyscanner.com with your complete flight search loaded and ready to go.

Screencast

raycast_1080.mp4

Checklist

- Add extension screenshots for Raycast Store submission
- Remove airplane icons from airport dropdown items
- Revert time-based dynamic icons
- Add time-based dynamic icons for airport dropdowns
- Remove Levenshtein fuzzy search
- Add autofocus to origin airport field
- Add fuzzy search with Levenshtein distance
- Prepare for Raycast Store submission
- Improve UX: Auto-detect trip type and clarify Skyscanner integration
- Prepare extension for submission
- feat: update codebase
- Initial commit: Raycast Skyscanner extension
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Nov 4, 2025
@raycastbot

ghost commented Nov 4, 2025

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

Once the PR is approved and merged, the extension will be available on our Store.

@ayushtom
ayushtom marked this pull request as ready for review November 4, 2025 13:09

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR adds a new Skyscanner Flight Search extension that allows users to quickly search for flights directly from Raycast. The extension provides a form-based interface where users can specify origin/destination airports (with fuzzy search through a local database of 6,000+ airports), select departure/return dates, trip type, and passenger count. Once submitted, it constructs a Skyscanner URL and opens it in the browser with pre-filled search parameters. The extension includes comprehensive airport data sourced from OpenFlights, proper TypeScript configuration, ESLint/Prettier setup, and follows standard Raycast extension patterns with form validation and error handling.

PR Description Notes:

  • The description section is empty and should explain what the new extension does
  • Missing screencast/screenshot as requested in the template

Important Files Changed

Filename Score Overview
extensions/skyscanner-flights/.gitignore 5/5 Standard .gitignore file with comprehensive rules for Node.js/TypeScript projects
extensions/skyscanner-flights/src/data/README.md 5/5 Documentation for airport data source, structure, and usage instructions
extensions/skyscanner-flights/tsconfig.json 5/5 Standard TypeScript configuration with ES2023 target and React JSX support
extensions/skyscanner-flights/README.md 5/5 Comprehensive user documentation with features, usage, and setup instructions
extensions/skyscanner-flights/package.json 4/5 Extension manifest with proper structure but missing metadata folder screenshots
extensions/skyscanner-flights/src/search-flights.tsx 4/5 Main extension logic with form handling, validation, and Skyscanner URL construction
extensions/skyscanner-flights/CHANGELOG.md 5/5 Properly formatted changelog with required merge date template
extensions/skyscanner-flights/eslint.config.js 5/5 Standard Raycast ESLint configuration setup
extensions/skyscanner-flights/.prettierrc 5/5 Code formatting configuration following Raycast conventions

Confidence score: 4/5

  • This extension appears safe to merge with only minor issues that should be addressed before store publication
  • Score reflects good overall structure and implementation but missing required metadata screenshots and empty PR description, plus some validation edge cases in the main component
  • Pay close attention to package.json (missing metadata screenshots) and search-flights.tsx (form validation and error handling)

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@ayushtom

ghost commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

@greptile-apps need a review again

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I'll review the main search functionality and provide a comprehensive review:

Code Review: Skyscanner Flights Extension

Overall Structure ✅

The extension follows Raycast conventions well with proper file organization, configuration, and TypeScript usage.

Key Strengths ✅

  1. Comprehensive Airport Database: 6,000+ airports with proper data structure
  2. Good User Experience: Intuitive form with autocomplete and validation
  3. Proper Error Handling: Uses showFailureToast for validation errors
  4. Clean Code Structure: Well-separated concerns with data, components, and utilities

Issues Found 🚨

1. Critical Performance Issue - Large Bundle Size

The airports.ts file contains 6,054 airports inline, making it ~671KB. This will significantly impact extension load time.

Recommendation:

// Move airport data to a separate JSON file or use lazy loading
// Consider implementing server-side search or chunked loading

2. Search Function Missing

The searchAirportsLocal function is imported but not defined in the airports file.

Needs Fix: Add the search function to airports.ts:

export function searchAirportsLocal(query: string): Airport[] {
  const lowerQuery = query.toLowerCase();
  return airports
    .filter(airport => 
      airport.iata.toLowerCase().includes(lowerQuery) ||
      airport.name.toLowerCase().includes(lowerQuery) ||
      airport.city.toLowerCase().includes(lowerQuery) ||
      airport.country.toLowerCase().includes(lowerQuery)
    )
    .slice(0, 50); // Limit results for performance
}

3. Form Validation Logic Issue

The validation assumes the selected value will be a 3-letter code, but the dropdown value is already the IATA code.

Current Issue:

if (!origin || origin.length !== 3) {
  // This validation is redundant since dropdown only allows valid IATA codes
}

4. Date Handling Enhancement

Consider adding minimum date validation to prevent past dates:

// Add to form validation
if (values.date < new Date()) {
  await showFailureToast({
    title: "Invalid Date",
    message: "Departure date cannot be in the past",
  });
  return;
}

5. Loading State Management

The loading state is set but never properly reset in all scenarios.

Minor Improvements 📝

  1. Form Field Ordering: Consider reordering return date after departure date for better UX
  2. Default Values: The adults field could have better default handling
  3. URL Construction: Could be more readable with URL constructor
  4. Type Safety: The FormValues interface could be more specific about date requirements

Configuration Files ✅

  • ESLint config looks good
  • Package.json properly configured
  • TypeScript config appropriate
  • Proper gitignore

Suggestions for Optimization 🔧

  1. Implement Progressive Search: Only show airports after 2+ characters typed
  2. Add Recent Searches: Cache recent airport selections
  3. Improve Bundle Size: Consider external airport API or chunked data loading
  4. Add Form Persistence: Save form state between sessions

Security & Privacy ✅

  • No sensitive data handling
  • External URLs properly constructed
  • No API keys or credentials needed

The extension is well-built overall but has a critical performance issue with the large inline airport dataset that should be addressed before publishing.

ayushtom added 6 commits November 4, 2025 19:44
- chore: update params in catch
- chore: update error lint
- Remove form persistence feature
- Add form validation and persistence improvements
- chore: fix linting
- chore: remove console logs
- chore: add logging
- chore: update screenshots
- chore: update with ai features
- feat: update with ai prompt
- chore: update metadata
- feat: add separate manual form command and refactor shared utilities
@ayushtom

ghost commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

@greptile-apps check the pr again

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the PR for the new skyscanner-flights extension. This is a well-structured extension that allows users to search for flights using either natural language (with AI parsing) or a manual form. Here are the key observations:

Strengths

✅ Well-organized code structure with proper separation of concerns:

  • Components in /components
  • Utilities in /utils
  • Data handling in /data

✅ Good error handling and fallbacks - gracefully falls back to manual form when AI parsing fails

✅ Comprehensive airport database with 6,000+ airports and efficient local search

✅ User-friendly features:

  • Natural language processing for flight queries
  • Type-ahead airport search
  • Date validation
  • Round-trip detection

✅ Proper validation for all form inputs (dates, passenger count, airport codes)

Areas for Review

⚠️ Analytics tracking - Uses Mixpanel with a hardcoded token. Consider:

  • Making the token configurable or removing analytics entirely
  • Ensuring user privacy compliance
  • The current implementation generates random distinct_ids

⚠️ Large airport data file - The airports.ts file appears to be quite large (not shown in diff). Consider:

  • Verifying the file size doesn't impact extension performance
  • Ensuring it's properly optimized for search

⚠️ Error messages could be more user-friendly in some cases, particularly around AI parsing failures

Code Quality

The code follows good TypeScript practices with:

  • Proper type definitions
  • Clean component separation
  • Consistent error handling
  • Good use of Raycast APIs

Functionality

The extension provides a smooth user experience with:

  • AI-powered natural language search (requires Raycast Pro)
  • Manual form fallback for all users
  • Direct integration with Skyscanner.com
  • Comprehensive airport search capabilities

Overall, this is a solid extension that follows Raycast best practices and provides genuine value to users planning travel. The fallback mechanisms ensure it works for all users regardless of their Raycast subscription level.

@ayushtom

ghost commented Nov 5, 2025 •

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer

the documentation shares the following snippet for handling errors - https://developers.raycast.com/information/best-practices#handle-errors

but the greptile bot flags an optimisation here to use showFailureToast instead of ShowToast here. I think the documentation can be updated here to reduce review process time

@ayushtom

ghost commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

@greptile-apps check the pr again

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this PR for the skyscanner-flights extension, I can see it's a comprehensive flight search extension with natural language processing capabilities and a fallback manual form. Let me review the key aspects:

Overall Assessment

This is a well-structured extension that follows Raycast best practices. The code is clean, properly organized, and includes good error handling.

Key Strengths

  1. Dual Interface Approach: Smart to provide both AI-powered natural language search and a manual form fallback
  2. Comprehensive Airport Database: 6,054+ airports with offline search capability
  3. Multi-airport City Handling: Intelligent logic to use city codes vs airport codes for major metropolitan areas
  4. Good Error Handling: Graceful fallbacks when AI parsing fails
  5. Proper Validation: Form validation and date checks
  6. Analytics Integration: Usage tracking with Mixpanel

Technical Implementation

Positive Aspects:

  • Clean TypeScript with proper interfaces
  • Modular component structure
  • Efficient local airport search
  • Smart URL building for Skyscanner

Areas for Improvement:

  1. Analytics Dependency: The extension includes Mixpanel for analytics, which adds an external dependency. Consider if this is necessary for a Raycast extension or if it could use Raycast's built-in analytics instead.

  2. Hard-coded API Token: The Mixpanel token is hard-coded in the source. While this might be intentional for a public extension, it's worth noting.

  3. Error Messages: Some error messages could be more user-friendly. For example, "AI couldn't parse: origin, destination, date" could be more helpful.

  4. Airport Data Size: The airports.ts file (not shown but referenced) likely contains a large dataset. Ensure it's optimized for bundle size.

Code Quality

The code follows good practices:

  • Proper TypeScript typing
  • Clean component separation
  • Good state management
  • Appropriate use of Raycast APIs

User Experience

  • The natural language interface is intuitive
  • Fallback form ensures functionality without Raycast Pro
  • Good feedback with toasts and loading states
  • Comprehensive airport search capabilities

Suggestions

  1. Consider reducing the analytics dependency if possible
  2. Add more context to error messages
  3. Ensure the airport database is optimized for size
  4. Consider adding more examples in the placeholder text

This is a solid extension that provides real value to users and follows Raycast development best practices. The dual interface approach is particularly well-executed.

@pernielsentikaer

ghost commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

I just gave it a really quick spin with AAL to CPH tomorrow and lands on this page - is that the right page?

@ayushtom

ghost commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

I just gave it a really quick spin with AAL to CPH tomorrow and lands on this page - is that the right page?

Aah I think the case here is that the airport code is mentioned directly. I currently only handle the city names and create a query based on that. I'll check this out

- chore: remove logs and linting
- chore: update with iata status
@ayushtom

ghost commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer should be good now

- chore: fix linting
- chore: modularise form
- chore: modularise

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 62749d7 into raycast:main Nov 5, 2025
@github-actions

ghost commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

@raycastbot

ghost commented Nov 5, 2025

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@ayushtom
ayushtom deleted the ext/skyscanner-flights branch November 5, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants