[BUG] 'dg-enable-search: False' Not Hiding Notes In Tag Searches

by Admin 65 views
[BUG] 'dg-enable-search: false' Fails to Hide Notes During Tag Searches in Obsidian Digital Garden

Hey everyone, I've stumbled upon a frustrating bug in Obsidian's Digital Garden, and I wanted to share it with you all. Specifically, the dg-enable-search: false setting, which is supposed to hide notes from search results, isn't behaving as expected when you search by tag. Let's dive in and see what's happening and how we can potentially fix it.

The Expected Behavior

So, the core idea here is pretty straightforward. When you set dg-enable-search: false for a note, you're essentially telling the Digital Garden, "Hey, I don't want this note to show up in search results." This should apply to all types of searches, whether you're using the main search bar or filtering by tags. This is super useful for keeping certain notes private or for excluding them from the main flow of your digital garden. Think of it like a stealth mode for specific notes, allowing you to keep them hidden from the main search index. If you are building a personal knowledge management system, this is a feature you'd rely on.

Why This Matters

This behavior is crucial for maintaining control over the visibility of your notes. You might want to hide certain notes for various reasons, such as:

  • Drafts and Works in Progress: Keep unfinished notes out of the public view.
  • Private Information: Hide notes containing sensitive information.
  • Contextual Notes: Prevent specific notes from appearing in general search results.

The Actual Behavior: A Glitch in the Matrix

Unfortunately, things aren't working as they should. While the dg-enable-search: false setting correctly hides notes from the regular search bar, it fails when you search by tag. This means that notes you've specifically marked to be hidden still pop up when you filter by tags, which is definitely not the desired outcome, guys.

The Problem

The main issue is that the tag search functionality seems to be ignoring the dg-enable-search: false setting. This is a big problem because it undermines the privacy and control you expect when using this feature. It means that notes you intended to keep hidden can still be discovered through tag searches, defeating the purpose of the setting.

What Goes Wrong

  • Inconsistency: The search function behaves differently depending on the search method (general search vs. tag search).
  • Privacy Concerns: Hidden notes can be exposed via tag searches.
  • User Frustration: Users are likely to be confused and frustrated when they expect a note to be hidden but it appears in a tag search.

Real-World Examples

Let's look at a concrete example to illustrate the issue. I've been experimenting with this bug on ricardodecal.com, where I've disabled dg-enable-search on specific pages like "Home" and "Recent Notes." This is what I found:

  • General Search: When I search using the main search bar, the "Home" and "Recent Notes" pages are correctly hidden. This is the expected behavior, and everything works as it should.
  • Tag Search: Now, here's where the problem arises. If I search by tag, the "Home" and "Recent Notes" pages reappear in the search results, even though they have dg-enable-search: false. This is clearly not what I intended, and it's a bug that needs fixing.

Visual Evidence

Here are some screenshots to illustrate the bug:

  • Screenshot 1: Notes hidden in general search

    The pages are hidden when searching normally. This shows the desired effect.

  • Screenshot 2: Pages reappearing in tag search

    The pages reappear when searching by tag, which breaks the expected behavior.

Proposed Solutions and Workarounds

Until the bug is fixed, there are a few potential workarounds you could use. However, these are just temporary measures and don't fully solve the core issue.

  • Manual Tag Management: Carefully manage which tags you use and where. Ensure that tags associated with hidden notes are not overly broad or used in prominent places.
  • Custom CSS: Use custom CSS to manually hide notes that appear in tag searches. This is a bit of a hacky solution, but it can provide some visual concealment.

Developer's Note

To the Obsidian Digital Garden developers, the solution here would be to ensure that the dg-enable-search: false setting is respected during all types of searches, including tag searches. This might involve modifying the search logic to check the setting before including a note in the search results. I hope this helps in resolving the problem, and thanks to the devs for their hard work.

Conclusion

In summary, the bug where dg-enable-search: false doesn't hide notes during tag searches in Obsidian Digital Garden is a significant issue. It undermines the user's control over note visibility and contradicts the intended functionality of the setting. While there are some workarounds, a proper fix is needed to ensure that this feature works as expected. This will help build better personal knowledge management systems. If you've encountered this bug too, please share your experiences and any additional workarounds you've found in the comments. Let's work together to make the Digital Garden even better!