Skip to content

feat: added skip to main content links to toc #4078

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

Merged
merged 5 commits into from
Apr 17, 2025

Conversation

berezinant
Copy link
Contributor

No description provided.

@berezinant berezinant requested a review from Copilot April 1, 2025 18:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces navigation improvements by adding skip-to-main-content links and updating the active table of contents scrolling behavior.

  • Added a new constant and logic to handle skip-to-main-content links in the navigation loader.
  • Changed the scrolling target in the navbar button to the toc link within an active toc part.

Reviewed Changes

Copilot reviewed 3 out of 8 changed files in this pull request and generated no comments.

File Description
dokka-subprojects/plugin-base/src/main/resources/dokka/scripts/navigation-loader.js Adds new skip link functionality by introducing the TOC_SKIP_LINK_CLASS and applying event listeners to the corresponding elements.
dokka-subprojects/plugin-base-frontend/src/main/ui-kit/navbar-button/index.ts Updates the scroll behavior to target the active toc link rather than the overall active toc part.
Files not reviewed (5)
  • dokka-subprojects/plugin-base-frontend/src/main/ui-kit/toc-tree/styles.scss: Language not supported
  • dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/renderers/html/NavigationPage.kt: Language not supported
  • dokka-subprojects/plugin-base/src/main/resources/dokka/templates/base.ftl: Language not supported
  • dokka-subprojects/plugin-base/src/main/resources/dokka/ui-kit/ui-kit.css: Language not supported
  • dokka-subprojects/plugin-base/src/main/resources/dokka/ui-kit/ui-kit.min.css: Language not supported
Comments suppressed due to low confidence (1)

dokka-subprojects/plugin-base-frontend/src/main/ui-kit/navbar-button/index.ts:42

  • Scrolling the inner '.toc--link' element instead of the parent '.toc--part' may lead to unexpected positioning; please confirm that this change aligns with the intended behavior.
const activePart = document.querySelector('.toc--part[data-active="true"]')?.querySelector('.toc--link');

@berezinant berezinant marked this pull request as ready for review April 17, 2025 14:25
@berezinant berezinant merged commit 93375f5 into ktl-2085-ui-fixes Apr 17, 2025
11 of 14 checks passed
@berezinant berezinant deleted the ktl-2085-toc-skip branch April 17, 2025 14:25
berezinant added a commit that referenced this pull request Apr 17, 2025
* fix: prevent unwanted dropdown list scroll

* fix: include dropdown toggle into focus trap

* fix: smooth keyboard navigation for toc and dropdowns

* feat: added skip to main content links to toc (#4078)

* fix: proper scroll into view in the toc modal

* feat: implemented skip to main content link

* fix: accessibility for toc and navbar

* fix: footer button outline

* fix: improved accessibility in header and toc

* refactor: review fixes
berezinant added a commit that referenced this pull request Apr 17, 2025
* feat: preserve toc scroll position

* test: updated html output tests

* UI fixes for table of contents (#4077)

* fix: prevent unwanted dropdown list scroll

* fix: include dropdown toggle into focus trap

* fix: smooth keyboard navigation for toc and dropdowns

* feat: added skip to main content links to toc (#4078)

* fix: proper scroll into view in the toc modal

* feat: implemented skip to main content link

* fix: accessibility for toc and navbar

* fix: footer button outline

* fix: improved accessibility in header and toc

* refactor: review fixes
berezinant added a commit that referenced this pull request Apr 17, 2025
* feat: preserve toc scroll position

* test: updated html output tests

* UI fixes for table of contents (#4077)

* fix: prevent unwanted dropdown list scroll

* fix: include dropdown toggle into focus trap

* fix: smooth keyboard navigation for toc and dropdowns

* feat: added skip to main content links to toc (#4078)

* fix: proper scroll into view in the toc modal

* feat: implemented skip to main content link

* fix: accessibility for toc and navbar

* fix: footer button outline

* fix: improved accessibility in header and toc

* refactor: review fixes
berezinant added a commit that referenced this pull request Apr 23, 2025
* feat: preserve toc scroll position

* test: updated html output tests

* UI fixes for table of contents (#4077)

* fix: prevent unwanted dropdown list scroll

* fix: include dropdown toggle into focus trap

* fix: smooth keyboard navigation for toc and dropdowns

* feat: added skip to main content links to toc (#4078)

* fix: proper scroll into view in the toc modal

* feat: implemented skip to main content link

* fix: accessibility for toc and navbar

* fix: footer button outline

* fix: improved accessibility in header and toc

* refactor: review fixes
berezinant added a commit that referenced this pull request Apr 24, 2025
* fix: version button layout

* fix: not active tag style in firefox

* fix: removed unused assets copies

* fix: proper hover for platform tags

* fix: outline position for header elements

* fix: dropdown list edge cases

* fix: selected option style in dropdown

* fix: misc outline and focus fixes

* fix: toc icons positioning

* feat: added sidebar resize (#4031)

* fix: search modal positioning

* chore: updated deps

* fix: fix scroll for left column and main area

* chore: enable strict mode for react and fix warnings

* fix: controls states

* feat: preserve toc expanded/collapsed state (#4063)

* feat: preserve toc scroll position

* test: updated html output tests

* UI fixes for table of contents (#4077)

* fix: prevent unwanted dropdown list scroll

* fix: include dropdown toggle into focus trap

* fix: smooth keyboard navigation for toc and dropdowns

* feat: added skip to main content links to toc (#4078)

* fix: proper scroll into view in the toc modal

* feat: implemented skip to main content link

* fix: accessibility for toc and navbar

* fix: footer button outline

* fix: improved accessibility in header and toc

* refactor: review fixes

* fix: proper background

* chore: fix tests and linting errors

* feat: added collapse search button,improved search

* chore: updated tests snapshots

* fix: returned fix for navigation loading in safari
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.

1 participant