Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

feat: add 'Edit this page on GitHub' link #708

Merged
merged 2 commits into from
Jun 14, 2022

Conversation

samuliasmala
Copy link
Contributor

📝 Description

Add a link to the end of each page (except changelog) to edit the page on GitHub.

⛳️ Current behavior (updates)

No link from document page to directly edit it

🚀 New behavior

Link added to the end of each page to provide easy way to access and edit the documentation

💣 Is this a breaking change (Yes/No):

No

Add a link to the end of each page (except changelog) to edit the page
in GitHub.
@vercel
Copy link

vercel bot commented Jun 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
chakra-ui-docs ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 6:04AM (UTC)

@nikolovlazar
Copy link
Contributor

nikolovlazar commented Jun 13, 2022

This is great, @samuliasmala! Thanks for opening this PR 💖 A few things that I've noticed:

  • Since I have write access to the repo, I'm taken directly into the Edit Mode, which is fine I guess
  • If I'm not logged in, I'm taken to the GitHub Login page and I'd need to log in first to see what the page is
  • If I'm logged in, but I don't have write access to the repo but a fork on my account, I'll still see the editor, but I'll be met with an alert:
    You're making changes in a project you don't have write access to. Submitting a change will write it to a new branch in your fork, so you can send a pull request.
  • A different scenario happens if I'm logged in, don't have write access, but also don't have a fork on my account.

To provide a consistent experience, I think leading the user to just the page without the Edit Mode will be better. The users will then chose if they want to fork it, open Visual Studio Code on that page, or use the GitHub editor right there on the spot.

If user is taken directly to the GitHub edit page user must log in
before seeing the file. After authentication the page shown differs
depending whether user has write access or fork of the repository.
@samuliasmala
Copy link
Contributor Author

Thanks for the comments! You're correct, the link behavior will indeed vary from user to user so it's better to open the file in reading mode. I've updated the PR accordingly.

@nikolovlazar nikolovlazar merged commit e1ca99c into chakra-ui:main Jun 14, 2022
@nikolovlazar
Copy link
Contributor

Looking good! Thanks @samuliasmala 💖

@nikolovlazar
Copy link
Contributor

@allcontributors please add @samuliasmala for code

@allcontributors
Copy link
Contributor

@nikolovlazar

I've put up a pull request to add @samuliasmala! 🎉

@samuliasmala samuliasmala deleted the add-edit-link branch June 14, 2022 06:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants