-
-
Notifications
You must be signed in to change notification settings - Fork 184
feat: documentation page deep linking and UI cleanup #2289
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
base: master
Are you sure you want to change the base?
Conversation
Auto-close sidebar on mount, suppress container padding for /documentation routes, and sync iframe navigation bidirectionally with browser URL (including anchor fragments via hashchange listener). Closes SignalK#2282 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detect iframe context via inline script, toggle CSS classes to show Signal K logo in standalone mode and a home icon when embedded in the Admin UI. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Is it back again that once you accidentally clicked it on the sidebar that there is no human understandably easy way back as before 2.20.0 and you wish the entire product to hell and burn there till infinity? |
The useEffect that hides the sidebar on mount now cleans up on unmount, ensuring the sidebar reappears when the user leaves via back button, sidebar link, or any route change. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
This is covered by the acceptance criteria: Given I am on the Documentation page with the sidebar auto-closed
When I navigate away via any mechanism (browser back button, clicking a sidebar link, or any route change)
Then the Admin UI sidebar MUST be restored to its visible state |
|
So trapped again as before 😢. Not that your code is bad or tht you went to help, but this usabillity is horrible. |
|
Here is more background to this. https://discord.com/channels/1170433917761892493/1170434656877948928/1458996432123199694 |
|
What about just not collapsing the sidebar? |
Seems like you're confused. Checkout this branch and test it. Then provide feedback |
|
Fair enough - I looked at your provided screenshot where only documentation is in full screen and overlays everything is visible. |
tkurki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, this eliminates nicely the "double sidebar" problem but still allows navigation back to the main app via hamburger menu, SK logo and back button.
Url stays in sync and back button works 👏
The home button did not work for me, double SK logo is still there?
|
I don't agree with the user getting "trapped" with this. But collapsing the sidebar, that otherwise is not something I ever tuse, could be even a better option to save & eat the case. @bkeepers thoughts? The switch / contrast with the main Admin UI and docs is still pretty jarring, but than can be addressed separately by adjusting the docs styling. |
When you load the docs independent of the admin the logo becomes full sk instead of home icon. I think the home is just icon and not linked. I can change behavior though. Also we can include white style in this pr or I can work on it for the next pr. Will change based on if in iframe to white, otherwise keep it the same dark mode. ...or change based on consensus |
|
Ah my mistake, just rebuilt the admin ui 🤦 . Forget that… |
bkeepers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not sure I understand the goal of moving the docs into an iframe. Especially in this iteration where almost everything is hidden.
Can you help me understand?
Is there any way those goals can be achieved by just improving the typedoc theme?
| '/documentation', | ||
| '' | ||
| ) || '/' | ||
| history.replace('/documentation' + currentSubPath + newHash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't pulled this down and tested it compard to the gist I shared the other day, but there are a lot of issues with this hashchange approach. Sometimes the back/forward button doesn't work. Sometimes it gets out of sync (especially on embedded pages that include ahash, like the is common in documentation).
|
|
@turki I still don't understand how an iframe is the solution to those issues.
The docs are always served from a server instance, so adding a "Home" icon to take the user back to
They already were deep linkable in their current form. e.g. https://demo.signalk.org/documentation/Developing/REST_APIs/History_API.html#query-parameters
The docs will be side-by-side with other parts of the UI? What I see in this PR is that they take up the entire screeen like before, but now they have a Home button and are in an iframe. Sorry if I'm misunderstanding something. Maybe I need a cup of coffee. I just never saw rational in #2248 for this change and am still confused what problems were tyring to be solved by moving it into an iframe that couldn't be solved by updating the TypeDoc theme. |
"Keep docs within admin ui, under the familiar header and admin ui navigation readily accessible"
Sure, if you know that you can do that. "Make docs deep linkable by just navigating to a doc page and simply copypasting the url "
They are embedded within the Admin UI, creating a much less yanky "i took you someplace else to see the documenation" experience. Here's a picture of what I see as a reasonable short term goal: This differs from the PR:
For some reason the docs icon in sidebar is blue? In my testing I did not see any problems with the url being out of sync with where I was. |
|
I'm not really fan of this embedding. With this PR you are either on documents or server, both are not possible like old tab approach. Of cource you can open document in a new tab, but then it opens second instance of SK too. How complicated it is that you have multiple tabs open in web browser? Jumping between specific doc and server pages becomes more difficult. This is not making things easier. Might look nice but usability is poor. |



Summary
Standalone — Signal K logo
Embedded in Admin UI — home icon
Test plan
/admin/#/documentation— sidebar closes, no excess margins/documentation/— Signal K logo displayedCloses #2282
🤖 Generated with Claude Code