-
Notifications
You must be signed in to change notification settings - Fork 397
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
Make not-found-version page dynamic #2738
base: master
Are you sure you want to change the base?
Conversation
vmishenev
commented
Nov 4, 2022
64d5aa9
to
72260c7
Compare
appended.onload = function() { | ||
const messageBox = appended.contentWindow.document.querySelector(".sub-title") | ||
messageBox.textContent="The declaration is unavaibaile in " | ||
elem.textContent " version, but this exists in " | ||
let link = appended.contentWindow.document.createElement("a") | ||
link.href = lastVersion.href | ||
link.textContent = lastVersion.textContent | ||
link.target = "_parent" | ||
messageBox.append(link) | ||
}; |
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.
If you have stdlib built locally with these changes, could you please publish it somewhere?
I wanted to check the following cases:
- Does it always lead to the latest version? Case: I have a declaration in 1.1, which was removed in 1.2, and the latest version is 1.3. What happens if I go to version 1.1, choose the removed declaration and select 1.2? Will it tell me it exists in 1.3? If so, there's a bug. Maybe it's better to always propose to switch to the last used version? We could remember it by placing it in local storage
- If you click on the proposed latest version, will it load the whole page or only the main content in the middle? In other words, you will see navigation from which version, initial or proposed? There could be a mismatch here too if navigation doesn't get reloaded
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.
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.
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.
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.
Navigation can also be confusing. You go to 1.8 and click on isISOControl
, then choose version 1.1, it changes the dropdown on top to 1.1, but if you click anywhere in the navigation it will lead to 1.8
I reckon it should either not change the version on top, or re-draw navigation menu to fit the newly selected version
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.
Not sure how the linked docs were built - it it a bug of the versioning plugin or of configuration?
None of them. It can be done in the filter plugin, but now it works like old Dokka: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/decapitalize.html
Anyway, we should display the version of Kotlin for DeprecatedSinceKotlin
.
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.
Also not sure how this happened, but isISOcontrol exists in 1.0 and 1.5 - 1.7 only.
It is a bug in the filter plugin and not relevant to this PR. I will fix it after merging.
absolutePath?.toRelativeString(position) if (!isExistsFile) "?v=" version.urlEncoded() else "" | ||
a( | ||
href = href, | ||
classes = if (!isExistsFile) "unavailable-version" else null |
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 initially thought that the whole version itself was unavailable, when in reality the declaration for this version is unavailable.
So proposing to change it to declaration-unavailable
. I also wonder if it's good UX to highlight such versions red, preventing the user from clicking it
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 also wonder if it's good UX to highlight such versions red, preventing the user from clicking it
The style of top menu should not depend on a page.