Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60972

Rename the root breadcrumb

    XMLWordPrintable

    Details

    • Similar Issues:
    • Epic Link:
    • Released As:
      Jenkins 2.257

      Description

      One of the items discussed on the UX SIG meetings (https://jenkins.io/sigs/ux/) was renaming the root breadcrumb to "Home". The reason for this is that it can be confusing having Jenkins in 2 consecutive lines.

       

      An example of how it could look:

      The solution probably should take into account i18n capabilities.

        Attachments

          Issue Links

            Activity

            Hide
            sladyn98 Sladyn Nunes added a comment -

            I could get started with this issue. Could you point me to the code ? Félix Queiruga Balado

            Show
            sladyn98 Sladyn Nunes added a comment - I could get started with this issue. Could you point me to the code ? Félix Queiruga Balado
            Hide
            fqueiruga Félix Queiruga Balado added a comment -

            It would be great if you can work on this one!

            TBH there's no good support for breadcrumbs atm in Jenkins. They are just generated iterating through request ancestors, something that I guess is provided by Stapler (https://github.com/jenkinsci/jenkins/blob/07c48b03fb4c651e7314e7adbe3a0ef0fe249586/core/src/main/resources/lib/layout/breadcrumbBar.jelly#L44).

            A hacky way to do it that comes to mind could be to check if the ancestor points to the rootURL, then it could be replaced.

            That said, I'd favour using some Java code to do this. If we get a Breadcrumbs module going on, then we can expand it in the future with some utilities like:

            • Get the last breadcrumb item.
            • Check if a breadcrumb item is the current one (good for styling purposes).
            • Prepend/append items to the breadcrumbs.

             

            Show
            fqueiruga Félix Queiruga Balado added a comment - It would be great if you can work on this one! TBH there's no good support for breadcrumbs atm in Jenkins. They are just generated iterating through request ancestors, something that I guess is provided by Stapler ( https://github.com/jenkinsci/jenkins/blob/07c48b03fb4c651e7314e7adbe3a0ef0fe249586/core/src/main/resources/lib/layout/breadcrumbBar.jelly#L44). A hacky way to do it that comes to mind could be to check if the ancestor points to the rootURL, then it could be replaced. That said, I'd favour using some Java code to do this. If we get a Breadcrumbs module going on, then we can expand it in the future with some utilities like: Get the last breadcrumb item. Check if a breadcrumb item is the current one (good for styling purposes). Prepend/append items to the breadcrumbs.  
            Hide
            sladyn98 Sladyn Nunes added a comment -

            Sounds like a really good plan, so basically we would like the jelly functionality to happen via java code, also where would such a module go in the file hierarchy jenkins/core/src/main/resources/breadcrumb ?

            Show
            sladyn98 Sladyn Nunes added a comment - Sounds like a really good plan, so basically we would like the jelly functionality to happen via java code, also where would such a module go in the file hierarchy jenkins/core/src/main/resources/breadcrumb ?
            Hide
            fqueiruga Félix Queiruga Balado added a comment -

            Something like that indeed. My OG idea was to to have on the Java side 2 models:

            • Breadcrumbs: has the logic to build the whole breadcrumb trail (maybe a getBreadcrumbItems method) and hooked into the jelly view. It would also allow prepending and appending breadcrumbs, and renaming the first one (??)
            • BreadcrumbItem: has logic to determine if it's the last one, get the parent, check if it has a contextual menu, etc.

            Then on the jelly side you would get the breadcrumb model and iterate on the breadcrumb items

            Show
            fqueiruga Félix Queiruga Balado added a comment - Something like that indeed. My OG idea was to to have on the Java side 2 models: Breadcrumbs: has the logic to build the whole breadcrumb trail (maybe a getBreadcrumbItems method) and hooked into the jelly view. It would also allow prepending and appending breadcrumbs, and renaming the first one (??) BreadcrumbItem: has logic to determine if it's the last one, get the parent, check if it has a contextual menu, etc. Then on the jelly side you would get the breadcrumb model and iterate on the breadcrumb items
            Hide
            fqueiruga Félix Queiruga Balado added a comment -

            Levi Williamson Sladyn has already started work on this one, the PR can be found here: https://github.com/jenkinsci/jenkins/pull/4634

            Show
            fqueiruga Félix Queiruga Balado added a comment - Levi Williamson Sladyn has already started work on this one, the PR can be found here: https://github.com/jenkinsci/jenkins/pull/4634
            Hide
            romenrg Romen Rodriguez-Gil added a comment - - edited

            Hi!

            Since this has been hanging for some time, I've proposed a workaround to get the "Home" breadcrumb there with little effort. See: https://github.com/jenkinsci/jenkins/pull/4920

            In future, whenever we have a more robust breadcrumbs module ready, we can replace the workaround I'm proposing; but with this suggestion we get the "Home" breadcrumb already

            Show
            romenrg Romen Rodriguez-Gil added a comment - - edited Hi! Since this has been hanging for some time, I've proposed a workaround to get the "Home" breadcrumb there with little effort. See:  https://github.com/jenkinsci/jenkins/pull/4920 In future, whenever we have a more robust breadcrumbs module ready, we can replace the workaround I'm proposing; but with this suggestion we get the "Home" breadcrumb already
            Hide
            teilo James Nord added a comment - - edited

            this wording choice causes confusion - opened JENKINS-64366

            Show
            teilo James Nord added a comment - - edited this wording choice causes confusion - opened JENKINS-64366

              People

              Assignee:
              sladyn98 Sladyn Nunes
              Reporter:
              fqueiruga Félix Queiruga Balado
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: