Skip to content

Redesign GitHub Rate Limit Display#88

Merged
simonw merged 1 commit intomainfrom
claude/redesign-github-ratelimit-011CUScxJd4BzaGRFR4gK4Lz
Oct 24, 2025
Merged

Redesign GitHub Rate Limit Display#88
simonw merged 1 commit intomainfrom
claude/redesign-github-ratelimit-011CUScxJd4BzaGRFR4gK4Lz

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Oct 24, 2025

  • Redesigned github-ratelimit.html with clean table layout

    • Removed green-on-black terminal styling
    • Switched to modern GitHub-style design with professional colors
    • Implemented ditto marks (″) for repeated "resets at" and "resets in" values
    • Better mobile responsiveness
  • Standardized GitHub token localStorage key to GITHUB_TOKEN across all tools:

    • github-ratelimit.html (changed from github_token)
    • github-issue.html (changed from githubToken)
    • terminal-to-html.html (changed from github_token)
    • openai-audio-output.html (changed from github_token)

All tools now use consistent GITHUB_TOKEN key for better maintainability.

🤖 Generated with Claude Code

Prompt was:

Redesign github-ratelimit to not use the green-on-black style. Have it show the results in a table, and if a row has the same values for resets at and resets in as the previous row it should show ditto marks instead.

Also take a look at any other tools that store a github token in localStorage and make sure that ALL of them use the same key for it, which should be GITHUB_TOKEN (including this tool)

- Redesigned github-ratelimit.html with clean table layout
  - Removed green-on-black terminal styling
  - Switched to modern GitHub-style design with professional colors
  - Implemented ditto marks (″) for repeated "resets at" and "resets in" values
  - Better mobile responsiveness

- Standardized GitHub token localStorage key to GITHUB_TOKEN across all tools:
  - github-ratelimit.html (changed from github_token)
  - github-issue.html (changed from githubToken)
  - terminal-to-html.html (changed from github_token)
  - openai-audio-output.html (changed from github_token)

All tools now use consistent GITHUB_TOKEN key for better maintainability.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@claude
Copy link
Contributor

claude bot commented Oct 24, 2025

Claude finished @simonw's task —— View job


Code Review Complete

Reviewing PR #88: Redesign GitHub Rate Limit Display

Todo List:

  • Read and analyze all 4 changed files
  • Review code quality and best practices
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security concerns
  • Examine test coverage needs
  • Provide comprehensive feedback

Review Feedback

🎯 Overall Assessment

This PR successfully achieves its goals of redesigning the GitHub rate limit tool with a clean, modern interface and standardizing localStorage keys across tools. The code quality is good with thoughtful UX improvements.

Strengths

UI/UX Improvements

  • Excellent visual redesign: The move from terminal green-on-black to GitHub's design system (github-ratelimit.html:12-20) creates a much more professional appearance
  • Smart ditto mark implementation: The logic for showing for repeated reset times (github-ratelimit.html:348-350) reduces visual clutter effectively
  • Good responsive design: Mobile breakpoints at 768px (github-ratelimit.html:179-195) ensure usability across devices
  • Improved accessibility: Proper color contrast and readable typography

Code Quality

  • Consistent localStorage standardization: All tools now use GITHUB_TOKEN key consistently across:
    • github-ratelimit.html:224
    • github-issue.html:122
    • openai-audio-output.html:219
    • terminal-to-html.html:447
  • Clean table structure: Well-organized HTML table with proper semantic headers and styling
  • Good error handling: Authentication failure cases properly handled (github-ratelimit.html:372-375)

⚠️ Areas for Improvement

Security Considerations

  • Token exposure risk: While using localStorage is common for client-side apps, consider adding a warning about token security in public/shared computers
  • Missing token validation: No client-side validation that the stored token format matches GitHub's ghp_ pattern

Performance & UX

  • No loading states for ditto calculation: The ditto mark logic could benefit from loading indicators for slow API responses
  • Missing rate limit status indicators: Consider adding visual warnings (colors/icons) when rate limits are critically low
  • Hard-coded polling interval: 1-second auth polling (github-ratelimit.html:241) could be configurable

Code Structure

  • Repeated auth logic: The GitHub authentication pattern is duplicated across files - consider extracting to a shared module
  • Magic numbers: Color thresholds (10%, 25%) at github-ratelimit.html:273-276 could be constants
  • Missing JSDoc: Complex functions like formatTimeRemaining could benefit from documentation

🐛 Potential Issues

Minor Bugs

  1. Timezone assumptions: formatTimestamp() uses toLocaleString() which may cause inconsistencies across timezones
  2. Memory leaks: URL.createObjectURL() in openai-audio-output.html:390 should be cleaned up with URL.revokeObjectURL()
  3. Race conditions: Auth polling intervals could stack if triggered multiple times

Edge Cases

  • API rate limit edge case: No handling for when reset time is in the past
  • Large numbers: toLocaleString() formatting might break with extremely large API limits

🧪 Testing Considerations

  • No automated tests: Consider adding unit tests for:
    • Ditto mark logic
    • Time formatting functions
    • Auth state management
  • Manual testing scenarios:
    • Test with invalid tokens
    • Test mobile responsiveness
    • Test with various rate limit states

🔒 Security Review

  • Client-side token storage: Acceptable for this use case but users should be warned
  • XSS prevention: Good use of proper DOM methods vs innerHTML in critical paths
  • API calls: Properly using HTTPS endpoints

📊 Performance Assessment

  • Lightweight implementation: No heavy dependencies, good performance characteristics
  • Efficient DOM updates: Minimal DOM manipulation, good for responsiveness
  • Network efficiency: Single API call pattern is optimal

🎨 Design System Consistency

  • Excellent GitHub design adoption: Colors, spacing, and typography match GitHub's design language
  • Consistent component patterns: Button states, form styling, and layout follow established patterns

Recommendations

  1. Add token format validation to provide better user feedback
  2. Extract shared auth logic into a reusable module
  3. Add visual indicators for critical rate limit states
  4. Consider adding tests for the ditto mark and time formatting logic
  5. Document the security implications of localStorage token storage

This is a solid improvement that enhances both functionality and user experience. The standardization of localStorage keys is particularly valuable for maintainability.


@simonw
Copy link
Owner Author

simonw commented Oct 24, 2025

Much nicer:

CleanShot 2025-10-24 at 13 11 51@2x

@simonw simonw marked this pull request as ready for review October 24, 2025 20:12
@simonw simonw merged commit fdfb6f1 into main Oct 24, 2025
4 checks passed
@simonw simonw deleted the claude/redesign-github-ratelimit-011CUScxJd4BzaGRFR4gK4Lz branch October 24, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants