···33import { SEARCH_CONFIG } from "../constants/platforms";
44import type { SearchResult, SearchProgress, AtprotoSession } from "../types";
5566-function sortSearchResults(results: SearchResult[]): SearchResult[] {
77- return [...results].sort((a, b) => {
88- // 1. Users with matches first
99- const aHasMatches = a.atprotoMatches.length > 0 ? 0 : 1;
1010- const bHasMatches = b.atprotoMatches.length > 0 ? 0 : 1;
1111- if (aHasMatches !== bHasMatches) return aHasMatches - bHasMatches;
1212-1313- // 2. For matched users, sort by highest posts count of their top match
1414- if (a.atprotoMatches.length > 0 && b.atprotoMatches.length > 0) {
1515- const aTopPosts = a.atprotoMatches[0]?.postCount || 0;
1616- const bTopPosts = b.atprotoMatches[0]?.postCount || 0;
1717- if (aTopPosts !== bTopPosts) return bTopPosts - aTopPosts;
1818-1919- // 3. Then by followers count
2020- const aTopFollowers = a.atprotoMatches[0]?.followerCount || 0;
2121- const bTopFollowers = b.atprotoMatches[0]?.followerCount || 0;
2222- if (aTopFollowers !== bTopFollowers) return bTopFollowers - aTopFollowers;
2323- }
2424-2525- // 4. Username as tiebreaker
2626- return a.sourceUser.username.localeCompare(b.sourceUser.username);
2727- });
2828-}
2929-306export function useSearch(session: AtprotoSession | null) {
317 const [searchResults, setSearchResults] = useState<SearchResult[]>([]);
328 const [isSearchingAll, setIsSearchingAll] = useState(false);
-6
src/lib/apiClient/realApiClient.ts
···121121 return data;
122122 },
123123124124- async getProfile(): Promise<AtprotoSession> {
125125- // This is now redundant - getSession returns profile data
126126- // Keeping for backwards compatibility but it just calls getSession
127127- return this.getSession();
128128- },
129129-130124 async logout(): Promise<void> {
131125 const res = await fetch("/.netlify/functions/logout", {
132126 method: "POST",
+1-5
src/lib/fileExtractor.ts
···11import JSZip from "jszip";
22-import {
33- ParseRule,
44- getRulesForPlatform,
55- FileFormat,
66-} from "./platformDefinitions";
22+import { ParseRule, getRulesForPlatform } from "./platformDefinitions";
73import { parseContent } from "./parserLogic";
8495// Type for the final aggregated results
+1-1
src/lib/parserLogic.ts
···11-import { ParseRule, FileFormat } from "./platformDefinitions";
11+import { ParseRule } from "./platformDefinitions";
2233/**
44 * Parses content using a regular expression.
-1
src/pages/Loading.tsx
···11-import { Search, Sparkles } from "lucide-react";
21import AppHeader from "../components/AppHeader";
32import { PLATFORMS } from "../constants/platforms";
43
+1-1
src/pages/Login.tsx
···11import { useState } from "react";
22-import { Heart, Upload, Search, ArrowRight, Sparkles } from "lucide-react";
22+import { Heart, Upload, Search, ArrowRight } from "lucide-react";
33import FireflyLogo from "../assets/at-firefly-logo.svg?react";
4455interface LoginPageProps {