GithubHelp home page GithubHelp logo

brumm / tako Goto Github PK

View Code? Open in Web Editor NEW
201.0 5.0 12.0 1.22 MB

Tako replaces the default Github repository file list with an expandable file tree and file preview for rapid exploration of repositories.

License: MIT License

JavaScript 98.85% EJS 1.15%
chrome-extension file-tree github prefetch react react-query firefox-extension file-preview

tako's Issues

Images in MD preview won't render

Looks like a bug. Not critical though. And it might be reasonable to replace images with some fixed size placeholders (for the preview pane is of fixed dimensions) provided there is a way to open the file in the native mode.

image

Can't save

I can't save the token I generated, does not work in any repository :/
image

Default file structure view on private repos gets replaced with "Something went boom"

Kudos to the plugin author. It's a great, really convenient alternative for browsing repo content.

I believe the below might be linked to #1 .

When in private repository the progress spinner runs for a while and finally resolves to an error.
image

It is most likely to happen due to incompatibility of a token with current repo (for it is private).

Update 2020-04-02 10:55 UTC: there are no issues with private repos of mine. This affects repos in one of the organizations I am a member to. There are no public repos in that particular organization, so cannot tell how it behaves there. In yet another organization I am a member to public repos are treated as expected (no private repos there though).

Possible solution might be to fallback to the default (native) view of file list + optionally offer to add a token. The latter might also require multiple tokens support.

Besides one may not want to grant plugin a permission to read a repo due to organization info security policy requirements, so it might be even better to expose default view while plugin is busy with reading the repo. Still it is important to know it is working.

Please consider the following approach.

  1. When there is no token in place (or no any tokens when multiple tokens supported), inject a prompt to add a token (no change in current implementation)
  2. When there are any tokens:
    (a) expose default view + inject progress bar while plugin reads a repo (possibly trying a matching token)
    (b) on success remove the progress bar and replace the view, otherwise replace the progress bar with a warning (smth like "Failed to read a repo due to token expiration or access restrictions") and a prompt to add a token

styled-components support

When previewing a file in the collapsible tree view, my styled-components code:

const ActionText = styled.button`
  ${props => props.theme.ActionText(props.theme)[props.variant]};
`;

displays like this:

const ActionText = styled.button`
  ___CSS_0___;
`;

Can't save new token format

Related to #45. I tried to work around it by:

  1. Inspect element and removing the disabled attribute from the Save button
  2. The input has attribute pattern="[\da-f]{40}" which doesn't match the new token format โ€” should be pattern="[\da-zA-Z_]{40}"

"Save" still doesn't work tho :\\

Selected code looks blurry

Selected code has some sort of backdrop, which causes it to appear twice when selected and makes it harder to read.

image

Doesn't work on forked repos

Tako is great thing, but unfortunately it doesn't work on forked repos, as far as I know. It would be great to have support for forked repos as well ๐Ÿ‘๐Ÿฝ

When your token expires, Tako doesn't accept the new one

image

Regenerating a token at the provided link, pasting it into the box, then when you click "Save" nothing happens. It seems to save the token, because refreshing the page then works.

Github is now strongly encouraging users to set expiration dates for the tokens (it's 30 days by default) so this is going to hit and confuse a lot of people. You could probably just do a full page refresh once the token is persisted without too much impact

Future improvements

I really like the idea of this project but I do have some things I'd like to propose:

  • Add a license e.g. the GNU GPL 3.0
  • Convert the current project to typescript and restructure the files for better maintainability
  • Automate build and release process with Github Actions to further improve collaborative development

Can't save renewed personal Github token.

After experiencing this a few times:
image

I reinstalled Tako. But when I tried saving the renewed personal token (regenerating token within Personal Access Tokens github settings), the save button is greyed out for some reason.
image

image

Dark mode support

I realize this is super early and expected, but wanted to create an issue to track it.

GitHub is working on dark mode. I think you can enable it if you opt into beta features, but I got a toggle on the GitHub homepage. You can also enable it by adding the data-color-mode="dark" attribute to the root html element. This extension does not work properly with dark mode enabled:

image

Without the extension:

image

Some differences at first glance:

  • Folder icon
  • Line separator
  • Hover color
  • Code preview (when clicking on a file)

It looks like GitHub is using css variables for the colours:

image

GitHub Design & Repository Refresh

Github has a new Design and Repository Refresh in feature preview. To support it, making the following change works:

export const MOUNT_SELECTOR = 'table.files'

-  export const MOUNT_SELECTOR = 'table.files'
+  export const MOUNT_SELECTOR = '.Details [role="grid"]'

It seems like GitHub has done away with the table and now uses plain divs. Unfortunately, there isn't a clear selector that we can use to target the files list, and I'm not sure how reliable the solution above is. Possibly, aria-labelledby="files" can also be used or a selector with .parentElement, but this needs to be investigated.

Also, the design refresh has updated the icons, so those will have to be updated as well.

Refresh Refresh + Tako
Screenshot of GitHub design and repository refresh. Screen Shot of GitHub design and repository refresh with Tako

Display File Sizes

There is this extension I was using before Tako: https://github.com/harshjv/github-repo-size. It shows Repository and file sizes in the file list, but since this list gets replaced by tako it doesn't show up anymore. Would be great to have this feature in Tako aswell!

Also side note: You could make use of GitHub Actions which is free for public repositories to automate your build and deploy process.

Edit: I could look into this myself and send you a pr if you're open to the idea.

Development

I am trying to help fix some of the already open issues e.g. #8 but I'm running into trouble getting the extension running. What I did:

  • Cloned the repo
  • yarn install && yarn run build
  • Added the unpacked-extension folder in Chrome

I haven't changed any files yet and get this error: Error handling response: TypeError: Object(...) is not a function I honestly can't make much of it, hoping you might now what's happening here.

Update token validation logic for GitHub's new auth token format

See: https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/

The regexes in the following locations have to be updated:

const validToken = /[\da-f]{40}/.test(token)

pattern="[\da-f]{40}"

The updated regex can range from \w{40} to gh[a-z]_[\da-zA-Z]{36} or ghp_[\da-zA-Z]{36} depending on how strong you want the validation to be.

Support GitHub Enterprise

Great extension team, I'd like to use it on an enterprise instance of GitHub, it has a unique URL that doesn't end in *.github.com.

As an engineer,
I would like Tako to work on a custom GitHub domain,
So that I can use it with an enterprise instance of GitHub.

Wider text-preview

Any chance to make it wider? The text-preview pane is quite narrow that requires horizontal scroll most of the time.

Add a control to open a file in native mode explicitly

@brumm great tool with a UX that feels natural. Kudos!

At v.0.0.3 in order to open a file in "traditional" mode to be able to edit it employing GitHub WebUI one has to right/middle-click a file/directory entry and open the file/directory in a different tab from the context menu.

It would be great to have an explicit control to open a file/directory in native mode.

One of the approaches might be adding a control (e.g. an icon with a tooltip "Open in a new tab") to each entry. Possible issue: when a file preview is open the control may become obscured by the preview pane as the file listing "sidebar" is of fixed width.

Another approach might be to add a sticky top bar in the preview pane with a link to open in a new tab. Bonus: add other controls there, like "close preview". Possible issue: controls to open directories must be somewhere else for preview pane doesn't fire on directory entry click.

Rate limit

At first let me thank you for this awesome extension! Really levels up the GitHub experience.

I'm a bit concerned about the rate limit. It seems to send a request for every file that is viewed. Is this a limitation of the github API or is it possible to fetch files in batches (e.g. by directory) instead of fetching each file?

Minimum Node.js version to develop

Hi there, this is a really nice project! I was setting this up locally and noticed you have the minimum Node.js version set in package.json. Just curious, is there any particular reason this has been set? If not, I think it will be easier for others to develop locally if this is less restrictive.

(Yarn wasn't allowing me to install the node_modules without switching the Node.js version.)

tako/package.json

Lines 7 to 9 in e981f78

"engines": {
"node": ">=12.14.1"
},

Prompt For New Token

If I manually remove the access token from my GitHub account, Tako does not prompt for a new token, instead it just throws an error (never letting me update the token)..

I am close to having this ported over to Firefox - this issue is something I noticed during my testing, which I verified is an issue with the existing Chrome extension as well.

I should have a PR tomorrow sometime that fixes this issue + provides Firefox support.

Collapse nested single directory paths

Here's how it looks now:

Screenshot 2020-12-02 at 01 59 10

It would be nice to see the part starting from main as one node in the tree, so it can be toggled with a single click and the innermost content is indented only by 1 extra level, i.e. something like this:

โŒ„ enumeratum/
  โŒ„ src/
    โŒ„ main/scala/com/monovore/decline/enumeratum/
        package.scala
        ValueEnumArgument.scala
  หƒ test/

I think this is a common feature in editors that have a tree view interface.

Doesn't work with github submodules

On a repo using submodules Tako shows an error when clicking on the submodule itself:

image

Also, when ctrl-clicking (to open in a new tab), it browses to https://github.com/<user>/<repo>/blob/main/<submodule-name>, when it should actually browse to the submodules repo

This can be tested by adding a submodule to a repo with git submodule add <github-url> and then browsing that repo's page and clicking on the submodule

(I'm on firefox)

Github File edit button is not visible anymore

Go to any repo and open README.md file on github.com, earlier there was an option to directly edit that file inside github.com. With this extension installed that file edit icon is not visible anymore.

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.