canonical / canonicalwebteam.discourse

GNU Lesser General Public License v3.0
11 stars 16 forks source link

Deeply nested pages not showing as active in side navigation #149

Open bartaz opened 2 years ago

bartaz commented 2 years ago

Issue reported by @tmihoc

Some documentation needs deeper nesting than side navigation allows (4 or more levels). It's fine for these items not to appear in the side navigation itself, but currently, when navigating to such pages the context of the hierarchy is lost, because such pages don't appear in side nav, and they don't keep the active/expanded parents in side navigation.

For example a page: https://juju.is/docs/sdk/config-changed-event It's meant to be under Reference > Event > List of events > config-changed But when going to this page, side navigation doesn't reflect that.

image

Expected:

If the page is deeply nested, it should still keep the "last known" parent page expanded and shown in the side navigation:

image
bartaz commented 2 years ago

@tmihoc Feel free to provide any more details to this if you think it's needed, thanks!

bartaz commented 1 year ago

@nottrobin could this be given some priority, docs team is waiting for that

tmihoc commented 1 year ago

Thanks, @bartaz ! I think what we discussed was along the lines of:

  1. In the Navigation table: Make it possible to have level 4 and 5. (If I use them now I get an error, I think. Which is why I list such titles at the end with an empty level.)

  2. On the website: Continue rendering only levels 1-3 but, for any links to level 4 or 5 docs, keep the Navigation view at the parent level 3, for context.

tmihoc commented 1 year ago

@bartaz @nottrobin Are there any updates on this?

nottrobin commented 1 year ago

@tmihoc: Are there any updates on this?

We hadn't planned this in yet. I've just added it to our board. I'll hope to squeeze it into this iteration or next, so hopefully by March 10th.

@tmihoc: Thanks, @bartaz ! I think what we discussed was along the lines of:

  • In the Navigation table: Make it possible to have level 4 and 5. (If I use them now I get an error, I think. Which is why I list such titles at the end with an empty level.)
  • On the website: Continue rendering only levels 1-3 but, for any links to level 4 or 5 docs, keep the Navigation view at the parent level 3, for context.

I see a couple of drawbacks with this implementation:

Would it be better to introduce a new item in the metadata, something like "nav_parent", and then put the URL of the parent in there (in this case /docs/sdk/list-of-events)?

tmihoc commented 1 year ago

I cannot advise on the implementation. That was just a suggestion. My main point is (1) I and others often need to use level 4 and sometimes also 5 and (2) if we do that currently using a null level, the Navigation just shows the default, giving no clue as to the parent level 3 page.

nottrobin commented 1 year ago

I and others often need to use level 4 and sometimes also 5

If the nevigation levels 4 and 5 never show up at all, and all it means is that their level 3 parent is highlighted, why would you ever need 2 additional levels? What's the use of level 5, if all it means is that level 3 is highlighted in the nav?

tmihoc commented 1 year ago

It just shows the logical relation between the docs. Right now I just have to keep it in mind, or add more null-level rows in the Navigation above a set of null-level level 4/5 rows to clarify what they're about. Which I can continue doing, so if think it would reduce the amount of work you need to do to just making sure that the parent level 3 stays highlighted.

nottrobin commented 1 year ago

I dropped the ball on this last cycle, sorry. I've moved this into this JIRA task and I'll see when I can schedule it in, although it's a challenge this cycle with PS5 migration etc.

tmihoc commented 1 year ago

@nottrobin any updates on this?

tmihoc commented 1 year ago

@nottrobin

bartaz commented 1 year ago

@tmihoc Robin left Canonical recently unfortunately.

I don't know who could be able to prioritise those discourse tasks now. Our systems squad shrunk down to a single person (@samhotep) who is focused on infrastructure and PS5 migration now.

Do you have any suggestions @anthonydillon ?

pengwyn commented 1 year ago

I noticed that this seems to have been enabled on the Ubuntu Server discourse: https://discourse.ubuntu.com/t/ubuntu-server-documentation/11322, for example https://ubuntu.com/server/docs/security-smart-cards-ssh.

Maybe the configuration can be borrowed from there?

tmihoc commented 1 year ago

Any updates on this?