Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vmishenev
Copy link
Member

image

Comment on lines 26 to 35
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)
};
Copy link
Member

@IgnatBeresnev IgnatBeresnev Nov 10, 2022

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:

  1. 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
  2. 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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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?

decapitalize was not deprecated in 1.0

2022-11-26_06-12-19

Copy link
Member

@IgnatBeresnev IgnatBeresnev Nov 26, 2022

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.

If you open it for 1.8, then choose 1.4, it'll say that it exists in 1.0, which is true, but I'd say it's less useful then if it pointed to the latest version

2022-11-26_07-18-09

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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
Copy link
Member

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

Something like this, but prettier
2022-11-26_07-31-05

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants