Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slight bug #13

Open
bibiki opened this issue Oct 19, 2017 · 4 comments
Open

slight bug #13

bibiki opened this issue Oct 19, 2017 · 4 comments

Comments

@bibiki
Copy link
Contributor

bibiki commented Oct 19, 2017

Hi there,
not much of a big deal, but I thought I'd let you know.
bug

Every time I click on the path link, the link is added another time. I guess it's not supposed to.

If my explanation is not clear, please feel free to contact me and I'll explain.

@SethRobertson
Copy link
Owner

Hah, breadcrumb tracking gone wrong.

This feature is showing you how to got to the page you were on, to help you figure out what state you were in. In your case you are clicking on a link to the current page so it adds the current page to the list of links.

Technically correct and matching what the back button would show, but perhaps not entirely expected. If you submit a patch, I'll apply it.

@bibiki
Copy link
Contributor Author

bibiki commented Dec 6, 2020

yes, sure. I can submit a patch. Let's just make sure we have the same understanding of how this should work. I have two things in mind right now:

  1. if user clicks a link that leads to the page user is currently in, it should not be added to the breadcrumb
  2. when a user clicks on a link, we pop all items in the breadcrumb between top and the first occurrence of the item that stands for the target of the click, and then add an item for the target.
    example: start with one -> two -> three -> four. If use clicks two, then new state of breadcrumb would be one -> two instead of one -> two -> three -> four -> two
  3. if you have some other idea, please describe it and I'll do that.

@SethRobertson SethRobertson reopened this Dec 7, 2020
@SethRobertson
Copy link
Owner

The purpose of the breadcrumbs (to me) was for a third party to understand what the person looking at the document said went wrong or which bad paths they went down.

I'd say that there are currently two problems with clicking on the last page link.

  • Problem one, that page is added to the list. If you are already there it should not be re-added. This is your first idea.
  • Problem two, you do not scroll back to the location of the anchor due to how anchors work. (I think you can capture the clicks and if it isn't going to a new anchor then re-scroll, but this might be too painful to fix)

In my view, your second idea isn't a good idea since you lose track of where the user went before.

Thanks for offering to do this! I really appreciate it. I'm not any sort of javascript expert.

@bibiki
Copy link
Contributor Author

bibiki commented Dec 10, 2020

hey @SethRobertson
we do capture the clicks with the onclick event handlers in tags. If someone clicks on a link already visited, the user will be taken to the anchor, but the anchor will only be added in breadcrumb if it is different than the last item in the breadcrumb.
I put an if in crumbListAdd() function to do this.
However, pretty much the same problem persists. Breadcrumb grows pretty much the same as before. Short of cropping breadcrumb to a predetermined number of items to show, and providing an additional facility to show the entire history of clicks, I have no idea.
I am pushing the small change, and you see if you want to keep it.
Since I initiated this conversation then it's only right that I offer to implement the cropping and the additional facility. If you would like to have it, please let me know and I'd gladly do it. (I'm asking for permission not because I'd rather not do it but because I do not want to push my ideas onto your page and I do not want to bother you with something you might deem useless).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants