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

feat(explorer): highlight current path in explorer #1800

Open
wants to merge 2 commits into
base: v4
Choose a base branch
from

Conversation

saberzero1
Copy link
Collaborator

Closes #1799

@saberzero1 saberzero1 requested a review from Copilot March 1, 2025 14:10

Choose a reason for hiding this comment

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

PR Overview

This PR implements a feature to highlight the current path in the explorer interface.

  • Adds DOM logic in the inline script to assign a highlight CSS class to the current path element.
  • Extends Explorer components and options to support a new highlightCurrentPath property.
  • Updates documentation to detail the new behavior.

Reviewed Changes

File Description
quartz/components/scripts/explorer.inline.ts Adds logic to retrieve the current path and apply a highlight class if enabled.
quartz/components/Explorer.tsx Updates default options and embeds the highlightCurrentPath option into data attributes.
docs/features/explorer.md Documents the new highlightCurrentPath feature.
quartz/components/ExplorerNode.tsx Extends the options interface to include highlightCurrentPath.

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

@saberzero1
Copy link
Collaborator Author

Good bot.

Copy link
Owner

@jackyzha0 jackyzha0 left a comment

Choose a reason for hiding this comment

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

i believe we can do this purely via css

Copy link
Owner

@jackyzha0 jackyzha0 left a comment

Choose a reason for hiding this comment

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

jk but instead we should just compare data-for on the a tag and data-slug on the body

@saberzero1
Copy link
Collaborator Author

jk but instead we should just compare data-for on the a tag and data-slug on the body

Alright, but do we still want it to be configurable through the Explorer component options? Or just enabled by default? (And then effectively be able to be disabled by overriding the CSS)

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.

Add a custom color/style for the current page in the explorer
2 participants