Skip to content

DEVELOP-692: Add copy link for branch on github extension#14

Merged
jemmyw merged 2 commits intomainfrom
DEVELOP-692-add-copy-link-branch-github-extension
May 27, 2021
Merged

DEVELOP-692: Add copy link for branch on github extension#14
jemmyw merged 2 commits intomainfrom
DEVELOP-692-add-copy-link-branch-github-extension

Conversation

@jemmyw
Copy link
Collaborator

@jemmyw jemmyw commented May 24, 2021

Add a copy link to github branches in the attribute to make it easier to switch to that branch https://github.com/aha-develop/github/pull/14/files#diff-a8a1f4ed71f557f835fbb57d479877141b86cbb25a9e330abf7cdfd1b383bcc0R8

To make it work better I've also updated the linking so that when a PR is linked it's branch is also linked https://github.com/aha-develop/github/pull/14/files?diff=split&w=1#diff-28e5f92f2fbcf6ab1be7afe60b1c7fe70c742c37b9e4fc1def7762fd4b32d0a7R99 as often the branch name does not match the Aha! reference when the PR does.

copy-2021-05-24_17.36.27.webm.mp4

I've also refactored the code a little by pulling the attribute and page components in their own folders. While I was doing that I made the way components are exported the same (named) so there wasn't a confusing mix of default and named exports.

Copy link
Contributor

@cornu-ammonis cornu-ammonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice refactors! a few questions/comments

import { useGithubApi } from "../lib/useGithubApi";
import { usePopperAlerter } from "../lib/usePopperAlerter";
import ExternalLink from "./ExternalLink";
import { ExternalLink } from "./ExternalLink";
Copy link
Contributor

@cornu-ammonis cornu-ammonis May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why to change this from default export? just a style preference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had some one way, some the other. I just normalized them all to be one way and chose the majority as consensus. Named exports have an advantage imo in that you must refer to their name in the import, making them more greppable. I've run across a couple in aha-app where the component/file had one name and the import referenced it with another.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, it does bug me when the import differs from the filename for a default export.

<aha-icon icon="fa-regular fa-code-branch type-icon" />
</span>
<ExternalLink href={branch.url}>{branch.name}</ExternalLink>
<a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be more accessible as a button rather than <a, but maybe that would introduce some other difficulties?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it looks a bit crappy as a button. I did try that out. As a link it looks pretty good

@jemmyw jemmyw requested a review from cornu-ammonis May 24, 2021 22:46
@jemmyw jemmyw merged commit a049cbd into main May 27, 2021
@jemmyw jemmyw deleted the DEVELOP-692-add-copy-link-branch-github-extension branch May 27, 2021 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants