website icon indicating copy to clipboard operation
website copied to clipboard

✨ Enhancement: DocsHelp component option to hide Edit This on GitHub

Open DarhkVoyd opened this issue 1 year ago • 18 comments

Is your feature request related to a problem? Please describe

The pages using DocsHelp component, have a link "Edit this page on GitHub". In case of /tools it goes to https://github.com/json-schema-org/website/blob/main/pages/%2Ftools/index.page.tsx, which seems to just be the layout of the page, not the content itself. As discussed most of the time people would want to add or edit entries for their own tool.

Describe the solution you'd like

We can add an option to feedback component (DocsHelp) to disable/hide the Edit this page on GitHub or an option to pass a custom link, in this case the tooling data.

Describe alternatives you've considered

No response

Additional context

No response

Are you working on this?

No

DarhkVoyd avatar Nov 09 '24 08:11 DarhkVoyd

@DarhkVoyd May I work on this issue

techmannih avatar Nov 09 '24 13:11 techmannih

@techmannih Thank you for your enthusiasm and for all the work you’re doing! I noticed you’re already working on a few issues. Would it be okay to prioritize completing the pending PRs and wrapping up any remaining issues you’ve started before we assign this new one to you?

DarhkVoyd avatar Nov 09 '24 14:11 DarhkVoyd

@DarhkVoyd can you please assign this to me?

arpitkuriyal avatar Nov 10 '24 18:11 arpitkuriyal

@arpitkuriyal Yes, please go ahead.

DarhkVoyd avatar Nov 11 '24 14:11 DarhkVoyd

@DarhkVoyd i have make a prop to hide the "edit this page in the github" . Can you tell me in which pages i should hide it and on which pages i should show it? In part where the prop is passed with false value the page will look like this Screenshot 2024-11-13 at 6 27 15 PM is it fine?

arpitkuriyal avatar Nov 13 '24 13:11 arpitkuriyal

@arpitkuriyal Good work on your progress. Let's not hide the entire section instead just hiding the button would be better. The default behavior for the DocsHelp component should be to show the button, that way we will only have to manually handle cases when we want to hide it. For now, we only want to hide the button on the /tools page.

DarhkVoyd avatar Nov 13 '24 13:11 DarhkVoyd

@DarhkVoyd Okay okay I got it

arpitkuriyal avatar Nov 13 '24 13:11 arpitkuriyal

Is there not an option to specify the link in the button? It seems to me like the button is quite nice to have, and it would be better if we can just get it to point to the right file in GitHub depending on which page you're on.

gregsdennis avatar Nov 14 '24 11:11 gregsdennis

@gregsdennis Yes, there's a prop that allows specifying a custom redirect link in the DocsHelp component. However, based on the issue's requirements, it doesn't need to be included on the tooling page . please let me know if you have more suggestions.

arpitkuriyal avatar Nov 14 '24 11:11 arpitkuriyal

I'm suggesting the issue's requirements might be the wrong thing to do. This is merely a proposal. The issue is for discussion. Issues aren't just to-dos.

@benjagm, please weigh in here.

gregsdennis avatar Nov 14 '24 11:11 gregsdennis

@DarhkVoyd the opening comment says "as discussed" but doesn't link to where anything was discussed.

gregsdennis avatar Nov 14 '24 11:11 gregsdennis

@gregsdennis sorry but i am just a beginner learning things i see this is a good first issue so i picked it. i didn't see that it is discuss or not or just a proposal to be discussed.

arpitkuriyal avatar Nov 14 '24 12:11 arpitkuriyal

@DarhkVoyd the opening comment says "as discussed" but doesn't link to where anything was discussed.

Discussed here in slack.

benjagm avatar Nov 14 '24 12:11 benjagm

@gregsdennis The current behavior of the “Edit this page on GitHub” button is to navigate to the file that contains the page’s content. This is specified by a prop, which accepts the file type to construct the GitHub path. For instance, “_index” (referring to “_index.md”) or by default, it points to “index.page.tsx” for that path. However, for the “/tools” page, all the content is from a data file rather than a markdown file, so by default, it points to “index.page.tsx,” which primarily consists of the layout and logic. Currently, there’s no logic in place to use a custom link.

DarhkVoyd avatar Nov 14 '24 13:11 DarhkVoyd

@DarhkVoyd so now can i write test case for code that i added?

arpitkuriyal avatar Nov 14 '24 17:11 arpitkuriyal

Thanks, Benja.

@DarhkVoyd I understood the problem. What I was missing was the context that provided the solution. Just looking at this issue, it seems like a decision was just made without discussion. Let's be sure to provide as much context as possible in the future, okay?

gregsdennis avatar Nov 14 '24 17:11 gregsdennis

Understood, I’ll make sure to include more context moving forward. Thanks for the feedback!

DarhkVoyd avatar Nov 14 '24 18:11 DarhkVoyd

Hello! :wave:

This issue has been automatically marked as stale due to inactivity :sleeping:

It will be closed in 180 days if no further activity occurs. To keep it active, please add a comment with more details.

There can be many reasons why a specific issue has no activity. The most probable cause is a lack of time, not a lack of interest.

Let us figure out together how to push this issue forward. Connect with us through our slack channel : https://json-schema.org/slack

Thank you for your patience :heart:

github-actions[bot] avatar Sep 07 '25 02:09 github-actions[bot]