Open majoshi1 opened 2 weeks ago
Raised following PR for this change. https://github.com/rapi-doc/RapiDoc/pull/1029
Thanks for the PR !!!
though I like to disagree on "Standardize" part
I think you are trying to keep always only one tag
expanded and others close automatically. I have got mixed reviews about this kind of navigation behavior. For a small spec it may work fine, but for larger spec users like to expand multiple tags at the same time and to compare their paths (navbar can show paths too) or have related API from different tags open to keep them in the context while reading the docs.
Having said that here are my concerns and suggestion
x-tag-expanded
vendor-extention . How is it gonna behave when you use it to open multiple tabs ? on-nav-tag-click
option nav-always-expand-one-tag = true|false
Thanks for the quick response. Below are responses to your comments.
expand multiple tags at the same time
With focused
mode, the idea is that user wants to focus on one tag
at a time.
x-tag-expanded
vendor-extension
With focused
mode, all tags will be closed initially. In fact, this should be default behavior for focused
mode.
on-nav-tag-click
option
This option becomes redundant, as idea is to do both expand/collapse and show description.
expanding a tag automatically closes the other tags.
The focused
mode actually needs this behavior. Also, this is standard behavior for other libraries e.g. see this demo.
Here is the enhancement to standardize toggle behavior on click of left panel.
Params
Current behavior On click of left panel entry, right panel shows details. But to expand the item on left panel, user needs to click on arrow icon on right. Also, that does not collapse other items. This is inconvenient for users.
Proposed behavior On click of left panel entry, do the following: -Show details on right panel. -Expand the item on left panel. -Collapse any other open item/s on left panel.
Live example with proposed behavior: https://majoshi1.github.io/rapidocweb/examples/focused-mode.html
Below are all the changes needed for this proposed behavior.
In src\templates\navbar-template.js:
From:
To:
From:
To: