7 months ago
9b93d47Wire the existing backend OAuth flow to the frontend. The auth bar in the top-left shows "Sign in with GitHub" when logged out, and the user's avatar + login when authenticated, with a dropdown menu for "Visualize a repo" and "Sign out". The repo selector is a Cmd+K-style overlay that lists the user's GitHub repos (fetched from /api/repos), supports fuzzy search, and accepts arbitrary owner/repo input. Selecting a repo triggers /api/parse which clones it server-side, parses imports with es-module-lexer, and returns a graph JSON. reloadGraph() hot-swaps the graph data, rebuilds adjacency/clusters/legend/labels, and flies the camera to overview position — all without a page reload. A parse progress overlay with a spinner provides feedback during the clone+parse cycle. The #authenticated hash from the OAuth callback is detected in loadFromHash() to trigger a checkAuth() refresh. This is the right integration point because the auth state naturally gates access to the GitHub API for repo listing and cloning, and the overlay pattern matches the existing search palette UX.
Parent43a230b