Skip to content

fix: support both frontmatter.tags and inline tags checking - #62

Open
RobertttBS wants to merge 9 commits into
Quorafind:masterfrom
RobertttBS:master
Open

fix: support both frontmatter.tags and inline tags checking#62
RobertttBS wants to merge 9 commits into
Quorafind:masterfrom
RobertttBS:master

Conversation

@RobertttBS

Copy link
Copy Markdown

It supports both frontmatter tags and hashtags when calling fetchTaggedFiles().

Major performance and stability update:
1. Stability: implemented debounce mechanisms for both note unloading (2s) and visibility toggling (500ms) to reduce flickering and DOM thrashing during scrolling.
2. Build: configured Vite to automatically remove console logs and debugger statements in production builds.
3. UX: fixed editor focus handling and improved infinite scroll pre-loading.
4. Debug: added internal logging for leaf/workspace tracking to diagnose state issues.
- Skip inview:false events when leaf itself is not visible (height 0)
  to prevent IntersectionObserver from false-triggering unloads during
  Obsidian's internal layout adjustments

- Set parent Daily Notes View as active before detaching editor leaves
  to prevent Obsidian from jumping to a random leaf when unloading
  editors that currently have focus
@RobertttBS

Copy link
Copy Markdown
Author

In the commit "fix: prevent unexpected tab switch when scrolling Daily Notes View", I think I solve the issue completely.

Summary of Fix Fixed an issue where the Daily Notes View would unexpectedly switch to a different tab while scrolling. This behavior was caused by two interacting bugs: the IntersectionObserver incorrectly unloading editors during layout updates, and Obsidian automatically shifting focus to a random tab when those editors were detached. The solution involves ignoring invalid visibility events and explicitly maintaining focus on the parent leaf before unloading editors, which stabilizes the scrolling experience.

claude and others added 6 commits July 6, 2026 02:56
Code review follow-up to the scroll/tab-switch fixes:

- Remove [DEBUG] console.log blocks from leafView.ts,
  dailyNoteViewIndex.ts and DailyNote.svelte; three of them referenced
  the untyped leaf.id and broke 'npm run build' (svelte-check), along
  with a @ts-ignore that Prettier had separated from its expression
- Use Date.now() instead of the stale hardcoded activeTime so the
  Daily Notes leaf is genuinely the most recent leaf, keeping
  mostRecentLeaf() from picking another tab when editors detach
- DailyNoteEditorView: extract isLeafVisible() helper shared by the
  inview guard and the debounce double-check; always clear the
  debounce map entry when its timeout fires; stop the viewport-fill
  interval once all files are rendered; clean up interval and pending
  timeouts in onDestroy
- DailyNote: track and clear the height-measure timeout on destroy
- DailyNoteView: register vault create/delete handlers via
  registerEvent so they are detached when the view closes
- FileManager: return copies from getFilteredFiles()/getAllFiles() so
  the view's splice-based lazy rendering cannot mutate internal state
- vite config: strip console only in production and keep
  console.error/warn (previously all console calls, including errors,
  were dropped in every build mode, which also defeated the debug logs
  in dev)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016vQsTGZjXNwLuEk5xeFMtb
…ew-gzacv2

Fix memory leaks and improve cleanup in Daily Note View
Trigger the workspace hover-link event when hovering a daily note
title, so the core Page Preview plugin (and plugins hooking into it,
such as Hover Editor) can show a popover for the note. The plugin
registers its own hover link source, letting users toggle the
behavior from the Page Preview settings.

Deleting a note from the popover already re-renders the editor via
the existing vault delete event handler.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rd6rYhyqSSm7oPx1mpDpKS
…-m3hlpi

Enable hover preview support for daily note titles
Use `declare` on the settings field so the class property doesn't
reinitialize to undefined after loadSettings(). Also regenerate
styles.css to match the svelte scope hashes already shipped in main.js
(previous commit left it stale).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Delete unused exports/fields: openTagView, isEmebeddedLeaf,
  getEditorView, getAllFiles, lastActiveFile, and hover-editor
  leftovers in leafView (forLeaf, iteratePopoverLeaves, detect,
  7 dead fields); inline genId as crypto.randomUUID and drop utils.ts
- Unify daily note ordering in a single sortDailyNotes (date in
  filename, newest first) shared by fetch and insertion paths;
  shrink fetchDailyNotes and merge duplicate fileDelete branches
- Match files by path instead of basename when deleting/deduping,
  so same-named notes in different folders are not evicted together
- Replace hand-rolled formatDate with moment, dedupe refresh block
  into refreshView()
- vite: drop terser (esbuild already minifies), node-resolve and
  replace plugins (native resolution + define cover them); remove
  4 unused devDependencies and resync pnpm-lock.yaml

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants