1
0
Fork 0
mirror of https://github.com/imjasonh/gitscrub synced 2026-07-06 18:42:21 +00:00
No description
Find a file
Jason Hall e8af117c1e
Fix file history state retention bug when navigating between files
- Clear all state when path changes in FileViewerWithHistory
- Reset versions array, currentIndex, and error state
- Clear content cache to prevent showing wrong file content
- Reset pagination state

This fixes the issue where navigating to index.html (or any file)
would sometimes show the history of the previously viewed file.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 16:48:36 -04:00
docs Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
netlify/functions Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
public Replace default favicon with GitHub logo 2025-06-16 16:17:12 -04:00
scripts Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
src Fix file history state retention bug when navigating between files 2025-06-16 16:48:36 -04:00
tests Clean up obsolete files 2025-06-16 16:29:34 -04:00
.env.example Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
.gitignore Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
CLAUDE.md Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
eslint.config.js Initial commit: GitScrub - GitHub repository history explorer 2025-06-16 13:24:51 -04:00
index.html Replace default favicon with GitHub logo 2025-06-16 16:17:12 -04:00
LICENSE Initial commit: GitScrub - GitHub repository history explorer 2025-06-16 13:24:51 -04:00
netlify.toml Replace PAT authentication with OAuth device flow via Netlify 2025-06-16 15:35:58 -04:00
package-lock.json Initial commit: GitScrub - GitHub repository history explorer 2025-06-16 13:24:51 -04:00
package.json Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
playwright.config.ts Switch from OAuth device flow to standard OAuth2 web flow 2025-06-16 16:05:06 -04:00
README.md Improve repository input UX and clarify public repo limitation 2025-06-16 16:24:32 -04:00
tsconfig.app.json Initial commit: GitScrub - GitHub repository history explorer 2025-06-16 13:24:51 -04:00
tsconfig.json Initial commit: GitScrub - GitHub repository history explorer 2025-06-16 13:24:51 -04:00
tsconfig.node.json Initial commit: GitScrub - GitHub repository history explorer 2025-06-16 13:24:51 -04:00
vite.config.ts Fix GitHub Pages deployment build script 2025-06-16 13:31:44 -04:00

GitScrub

A web application for exploring GitHub repository history with an intuitive timeline interface.

Features

  • 🔍 Browse public GitHub repositories
  • 📁 Navigate repository file structure
  • 📜 View file history with timeline slider
  • 🎯 Click anywhere on the timeline to jump to specific commits
  • ⌨️ Use arrow keys for precise commit navigation
  • 🔄 Load more commits for extensive history
  • 🎨 Syntax highlighting and diff visualization
  • 🔐 Secure authentication with GitHub OAuth

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/imjasonh/gitscrub.git
cd gitscrub

# Install dependencies
npm install

# Start development server
npm run dev

Deployment

GitScrub is designed to be deployed on Netlify for the best user experience:

  • See Netlify Deployment Guide for detailed instructions
  • OAuth web flow authentication - no tokens to manage
  • Users authenticate directly with GitHub

Local Development

For local development with OAuth support:

# Install Netlify CLI
npm install -g netlify-cli

# Create .env file with your GitHub OAuth App credentials
cp .env.example .env
# Edit .env and add your GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET

# Start development server with Netlify Functions
netlify dev

Running Tests

# Create .env.test with test configuration
echo "GITHUB_CLIENT_ID=your_test_client_id" > .env.test

# Run all tests
npm test

# Run tests with UI
npm run test:ui

Usage

  1. Navigate to a Repository: Enter a GitHub URL or use the example buttons
  2. Browse Files: Click on any file in the tree view
  3. Explore History:
    • Use the timeline slider at the bottom
    • Click anywhere on the timeline to jump to that point in time
    • Use ← → arrow keys for precise navigation
    • Toggle diff view to see changes between commits

Tech Stack

  • Frontend: React, TypeScript, Vite
  • Routing: React Router
  • API: GitHub REST API v3
  • Testing: Playwright
  • Styling: CSS

Architecture

The app uses Netlify Functions for OAuth authentication and communicates directly with GitHub's API. Authentication is handled via GitHub's OAuth web flow for a seamless user experience.

Key components:

  • FileTree: Repository file browser
  • FileViewerWithHistory: File content viewer with timeline
  • HistorySlider: Interactive timeline for commit navigation

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is open source and available under the Apache License 2.0.