Refactor popup, add error boundary, linting, and UX improvements#1
Open
ndcorder wants to merge 6 commits intoMaskyS:mainfrom
Open
Refactor popup, add error boundary, linting, and UX improvements#1ndcorder wants to merge 6 commits intoMaskyS:mainfrom
ndcorder wants to merge 6 commits intoMaskyS:mainfrom
Conversation
- Extract styles, hook, and utilities from 1887-line index.tsx into separate files - Create ScrapeView, CrawlView, ScrapeOptions, ResultCard, ApiKeyEditor, Toast components - Reduce index.tsx to ~570 lines of orchestration and effects
- Catch render errors with a styled fallback UI and "Try again" button - Wrap QueryClientProvider with ErrorBoundary in the root component - Log errors to console for debugging
- Configure ESLint v9 flat config with typescript-eslint and react-hooks plugin - Add Prettier config and format all source files - Fix unused imports (R in download.ts, status in firecrawl.ts) and regex escape - Add typecheck, lint, lint:fix, format, and format:check scripts
- Validate key against Firecrawl credits endpoint before persisting
- Show loading state ("Validating...") and error feedback inline
- Only save to storage if validation succeeds
- Cmd/Ctrl+Enter triggers scrape or crawl depending on active tab - Escape closes API key editor or options panel - Show shortcut hint below action buttons
- Display pages crawled count in crawl status area - Show total pages from API response when available - Add total/completed fields to FirecrawlCrawlStatus type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves code quality, developer experience, and end-user UX across six changes:
Code quality
popup/index.tsxinto 9 focused modules: separate components (ScrapeView,CrawlView,ScrapeOptions,ResultCard,ApiKeyEditor,Toast), a shared hook (usePopupLogic), utilities, and stylestypescript-eslintandreact-hooksplugin, plus Prettier. New scripts:lint,lint:fix,format,format:check,typecheck. Fixed all existing lint errors (unused imports, regex escape)Features
Cmd/Ctrl+Entertriggers scrape or crawl (depending on active tab),Escapecloses the options panel or API key editor. Shortcut hints shown below action buttonsTest plan
npm run buildproduces a working Chrome extensionnpx plasmo package --target=firefox-mv3produces a working Firefox extensionnpm run lintpasses with 0 errors