Code Monkey home page Code Monkey logo

github-diff-explorer's Introduction

The GitHub Diff Explorer is a minimalist browser add-on which generates a seamless file explorer in GitHub pull requests. Currently the add-on is available in both Chrome and Firefox.

A big thanks to Andela Denaro for the logo and banner design!

Features

  • More screen real estate with a full width view and a re-sizable explorer
  • Improved review management and organization with collapsible folder views
  • Deep links to line references and review comments

Install

This extension requires:

  • Node (>v8)
  • NPM (>v5)

To test this locally in Chrome:

  • Pull this repository locally
  • npm install
  • npm start will run a local development copy, un-minified, with logging enabled
  • Navigate to chrome://extensions/
  • Enable developer mode
  • Load unpacked extension from dist/chrome
  • Go to a GitHub Files Changed tab in any repo.
  • Enjoy!

Release

To build a full released version for both Chrome and Firefox:

  • npm install
  • npm run release

Bundled .zip files and production assets will be in dist/chrome and dist/firefox respectively.

github-diff-explorer's People

Contributors

andeladenaro avatar dependabot[bot] avatar mvanbommel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

github-diff-explorer's Issues

Bug: GitHub actions files break explorer rendering

Overview

Noticed while reviewing PRs with GitHub actions related notifications, that those particular files break or hinder the rendering flow. More investigation required.

These sections should be added to the explorer as well, or could potentially be layered as a second explorer. The goal here being that they still need visibility, and should be distinct from file references.

Task: Improve Explorer Visibility

Currently the folders are lighter in colour and it's not entirely clear the a file is part of a folder.

  • Implement style changes to improve colour difference and visibility between files and folders
  • Add more indentation and a small indicator that a file is a part of a folder

Bug: Fix Broken Structure

Looks like the UI in the Files Changed section has been updated and the UI no longer renders. Will need to track down and add some additional changes. As an aside should try using Puppeteer to pull the UI and determine if the structure has changed in a way that would break things.

Why does this extension need permission for *.google.com and my browsing history?

Hi,

I'm very interested in using this lightweight file explorer, but the required permissions put me off a bit:

    "permissions": [
        "tabs",
        "http://*.google.com/"
    ],

When I install it from the Chrome WebStore it tells me it needs permissions for github.com (which is clear), but also for *.google.com and my browsing history. Why?

(Octotree on the other hand only requires permission for github.com.)

Improvement: Enable explorer column to be resizable

Allowing the explorer column to be resizable by the user will cover any cases where a pull request is becoming hard to read with smaller-width displays

Thoughts on this @alexmdodge ?

(Added for tracking on the issue)

  • Make explorer resizeable
  • Add buttons to quickly collapse and expand the width of the explorer

Task: Add horizontal scroll bar automatically

When the width of the tree pane is shorter than the actual tree content, a user should be able to scroll the tree horizontally, but it seems like there's neither a horizontal scroll bar nor scrollability, at least in Firefox version of this addon. It'd be nice to have a horizontal scroll bar until #72 is resolved.

Task-06: Webpack Setup

Setup build paths and proper output, as well as scaffold Google chrome extension requirements.

Task: Jest with CI

Need to implement some base Jest tests as well as continuous integration testing on the PR merges.

Task: General UI Updates

In general there are some useful UI updates to additionally aid developers while reviewing pull requests:

  • Add a simple checkbox in the file header which can be clicked to indicate review of that file is complete No longer required since the viewed feature was added
  • Note when the viewed box has been selected and cross out a menu item accordingly
  • Add accompanying state within the file explorer to display review files
  • Add ability to distinguish whether a file was deleted or not to help in reviews
  • Add comment icons which update the count dynamically through pull request reviews

Task: Simplify demo application to base html

Overview

Currently the demo pages are more complex than they need to be. For ease of path related issues, and to prevent additional dependency related issues, move everything into simple html files.

Enhancement: Support Dark Mode Rendering

Overview

Across Firefox and Chrome, dark mode is now a feature supported by GitHub. In is current state the extension works, but key visual elements aren't working correctly.

This task is to do the following:

  • Invert and provide binary colour switching for icon elements and font colours
  • Invert the main GDE icon in the header

To do this, it appears across both Chrome and Firefox, GitHub exposes the same data elements for tracking:

document.getElementsByTagName('html')[0].dataset
// DOMStringMap(3)​
// colorMode: "dark"​
// darkTheme: "dark"​
// lightTheme: "light"

Task: Refactor Polling to use Mutation Observers

The polling is working to determine when a specific page is loaded, but leaves a bit to be desired when responding to DOM change while loading content. Some ideas around improving this,

  • Use mutation observers where appropriate to detect DOM changes and respond
  • Load the explorer container first, while keeping the other file explorer views loading. This allows for better user experience and loading indication

Task: Update Extension Popup

Currently the extension popup could use a facelift. Some improvements could be,

  • Adding a clearly defined header using the logo
  • Add a small controls section which could be the start of adding more configuration at a later date. For now it could be a simple on/off toggle
  • Style the acknowledgements better

Bug: Unable to Open Line References

When referencing lines from a file diff, and then opening that link, it simply opens the file explorer to the default file.

Probably need to check the URL for a commit line hash and ensure that file opens.

Task: Add Loading Animation

For PRs with particularly large diffs, adding a loading animation would be useful to indicate something is happening, as it can take a while to process the diffs. At the same time should look into optimizing the seek and seeing if performance can be improved.

  • Add loading animation with logo included
  • Investigate performance improvements involving caching
  • Migrate away from timeouts and attempt another method of detecting load completion

Bug: PRs With Many Diffs May not Load Properly

For PRs that have many many changes the page may load triggering the script but all of the diffs may not be visible. This either results in some files missing from the explorer or the explorer not loading.

Task: Build a Deb Page and Improve Unit Testing

Need to build a simple dev page with mock content to more easily simulate DOM traversal and switching between contexts.

  • Build a dev page that simple loads the extensions JavaScript similar to how the extension would
  • Add more extensive unit tests that check the higher levels function for DOM composition which can be then tested for completely during the continuous integration steps

Task: Fix Vulnerable NPM Dependency

A dependency was flagged. The library should be identified and either substituted or removed. If it's a build related process it can be left as it does not represent client facing code.

Task: Ability to compact nested directories

In a Java project repository (or some complex project with deep directory structure), I see a tree like this:
image
It'd be nice if this extension detects such cases and compress the tree like this:

+- moduleA/src/main/java/com/....
   +- FooBar.java
+- moduleB/src
   +- main/java/...
      +- AliceBob.java
   +- test/java/...
      +- CharlieDelta.java

.. so that the left side of the pane is not wasted.

Bug: For Large PRs GitHub Loading Structure has Changed

Overview

Still need to investigate but it appears that for large PRs, GitHub has changed the structure of the loading elements. Now the explorer renders immediately instead of waiting for the loading to complete.

Fix

Most likely will need to check new elements and update the load / render operation.

Enhancement: support the file filter on GitHub's PR page

New to this extension but really love it. It brings at least one of the features I prefer about Azure DevOps PRs to GitHub. It would be nice, however, if you also supported GitHub's filter filter, which also allows you to filter files based on what you own via .github/CODEOWNERS.

image

When I filter to files (via extension or CODEOWNERS) it would be great if you filtered the file explorer view as well. For smaller PRs, the existing behavior is not so bad. I can still see the files. But on larger PRs it would help reduce potential noise (say, filtering out machine-generated files) and let me focus on the files that need to be reviewed.

Thanks for considering.

Docs: Update description to be browser agnostic

Overview

Initial issues during review for enabling the extension in Firefox related to having Chrome specific terminology in the descriptions of the extension / add-on. Should add a specific section in each of the manifests for each browser.

Bug: Support Storage Persistence for Page Refresh

When navigating back to a file change diff with the explorer the active state is no longer existent but the DOM is still in place. Need logic to rebuild the state based on the local state persisted through storage or DOM structure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.