I am going to check the project files to understand its layout and available dependencies.
I will read package.json to see which icon libraries and packages are installed.
I will install lucide-react for UI icons and canvas-confetti for celebration effects when sampling and downloading CSV files.
I will read index.html to inspect the current title and styling hooks.
I will update the title in index.html to reflect our application: "RandLinker — Random URL Sampler & CSV Exporter (200-300 Links)".
I will read src/index.css to see how styles are configured.
I will read src/utils/cn.ts.
I will enhance src/index.css with font families and utility styles for smooth scrolling and clean table styling.
I will create src/types/index.ts to define the TypeScript interfaces for links, sampling options, and export configurations.
I will create src/utils/sampleData.ts with over 1,000 realistic demo URLs across multiple categories (Tech & Dev, E-Commerce Products, News & Blogs, SEO Sitemap URLs) so users can test sampling immediately without needing a file ready.
I will create src/utils/linkParser.ts to parse URLs from various formats (lines, CSV, sitemaps, HTML bookmarks, or raw text regex), normalize them, validate syntax, and remove duplicates.
I will create src/utils/sampler.ts implementing the random sampler (Fisher-Yates shuffle) that randomly picks between 200 and 300 URLs and assigns them blank id values as required by the specification.
I will create src/utils/csvExporter.ts to generate the CSV with headers id,url and blank id column, format strings safely, and provide browser download and clipboard copy functions.
I will create src/components/Header.tsx to provide the top navigation bar with brand logo, quick status badges, and a Guide modal button.
I will fix the unused imports in src/components/Header.tsx.
I will create src/components/GuideModal.tsx to display an interactive explanation of the random sampling algorithm, CSV formatting rules, and features.
I will remove the unused imports Shuffle and FileSpreadsheet from src/components/GuideModal.tsx.
I will create src/components/StatsBanner.tsx to display real-time statistics of imported links, unique URLs, selected sample size, and estimated CSV file size.
I will create src/components/InputSection.tsx with tabs for Textarea Input, File Upload (Drag & Drop), and Demo Presets, along with parser toggles.
I will fix the unused imports and use totalInputCount in src/components/InputSection.tsx.
I will display totalInputCount in the input header of src/components/InputSection.tsx.
I will create src/components/SamplingControls.tsx to control the sampling range (defaulting to 200–300), allow instant rerolling of the random selection, and support custom exact counts.
I will create src/components/PreviewTable.tsx to render the paginated preview table showing the blank id column and the sampled url column, with search filtering and row-swapping capabilities.
I will create src/components/ExportBar.tsx to handle downloading the CSV file, copying to clipboard, viewing the raw CSV preview, and customizing the output filename.
I will remove the unused Sparkles import from src/components/ExportBar.tsx.
I will read src/App.tsx before replacing it with our implementation.
I will replace src/App.tsx with the complete RandLinker application, integrating all components, state management, random sampler, and CSV exporter.
I will test and verify the project build using build_project to ensure all imports, types, and components compile without any errors.
I have created RandLinker, a random link sampling and CSV exporter web application that takes a list of URLs and exports a random selection of 200 to 300 of them in a CSV file with an empty id column and the selected URLs in the url column (id,url).
Key Features Built:
-
Link Import & Demo Presets:
- Paste / Type URLs: Paste any list of URLs (one per line, comma-separated, or raw text with regex URL extraction).
- Drag & Drop File Upload: Upload
.txt, .csv, .json, .html, or sitemap.xml files.
- 1,000-Link Demo Presets: Preloaded with realistic tech, developer docs, e-commerce products, news articles, and sitemap URLs so you can test sampling instantly with a single click.
- Parser Options: Remove duplicate links automatically, validate HTTP/HTTPS syntax, and strip trailing slashes.
-
Random Sampling (200–300 Links):
- Random Count between 200–300: Generates a random target count between 200 and 300 inclusive and selects links using an unbiased Fisher-Yates shuffle algorithm.
- Reroll / Resample Button (
🎲): Instantly shuffles and samples a fresh random subset of 200–300 links from your input pool.
- Row Swapping: Inspect individual rows in the preview table and click Swap to replace any selected URL with a random link from the remaining unselected pool.
-
CSV Export (id,url with blank id column):
- Exact Output Format: Generates CSV files matching the specification:
id,url
,https://github.com/facebook/react/issues-101
,https://developer.mozilla.org/en-US/docs/Web/JavaScript
,https://news.ycombinator.com/item?id=39182
- Export Options:
- 1-Click Download CSV button with customizable filename.
- Copy CSV to Clipboard or Copy Selected URLs Only.
- Preview Raw CSV Modal to inspect the literal text before saving.
Files built: index.html, src/index.css, src/types/index.ts, src/utils/sampleData.ts, src/utils/linkParser.ts, src/utils/sampler.ts, src/utils/csvExporter.ts, src/components/Header.tsx, src/components/GuideModal.tsx, src/components/StatsBanner.tsx, src/components/InputSection.tsx, src/components/SamplingControls.tsx, src/components/PreviewTable.tsx, src/components/ExportBar.tsx, src/App.tsx