Skip to content

[ENG-1960] Prevent node tag menu from stacking on repeated hotkey presses#1187

Merged
trangdoan982 merged 2 commits into
mainfrom
eng-1960-node-tags-menu-opens-multiple-times-when-hotkey-pressed
Jul 8, 2026
Merged

[ENG-1960] Prevent node tag menu from stacking on repeated hotkey presses#1187
trangdoan982 merged 2 commits into
mainfrom
eng-1960-node-tags-menu-opens-multiple-times-when-hotkey-pressed

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Jul 3, 2026

Copy link
Copy Markdown
Member

https://www.loom.com/share/e13d8f61cf924fa199da98f64d758291

Summary

  • Pressing the node-tags hotkey while the menu was already open stacked a new instance on top instead of dismissing the existing one
  • Root cause: setupNodeTagHotkey() used EditorView.domEventHandlers which fires once per open editor pane; each invocation created a fresh popover instance, bypassing the if (this.popover) guard (which only checks the same object instance)
  • Fix: track the active popover in a closure variable inside setupNodeTagHotkey(); on each hotkey press, close the existing popover first (properly cleaning up its DOM element and document-level event listeners), then open a fresh one at the current cursor position

Fixes ENG-1960

Test plan

  • Press the node-tags hotkey once — menu appears
  • Press the hotkey again while the menu is open — existing menu closes, new one opens at cursor position (no stacking)
  • Press Escape, then hotkey again — fresh menu opens normally
  • With multiple editor panes open, pressing the hotkey once opens only one menu

🤖 Generated with Claude Code


Open in Devin Review

… presses

Track the active popover in a closure variable inside setupNodeTagHotkey so
that pressing the hotkey while a menu is already open closes it first and
reopens at the new cursor position, rather than stacking another instance.

Fixes ENG-1960.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 3, 2026

Copy link
Copy Markdown

ENG-1960

@supabase

supabase Bot commented Jul 3, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jul 3, 2026 3:26am

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread apps/obsidian/src/index.ts Outdated
@trangdoan982 trangdoan982 changed the title fix(obsidian): prevent node tag menu from stacking on repeated hotkey presses [ENG-1960] Prevent node tag menu from stacking on repeated hotkey presses Jul 3, 2026
Promote the activePopover tracking variable to a class field so
onunload() can call close() on it, cleaning up the DOM element and
document-level event listeners if the plugin is unloaded while a
NodeTagSuggestPopover or InlineNodeTypePicker is open.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@trangdoan982 trangdoan982 merged commit b1dc3d6 into main Jul 8, 2026
9 checks passed
@trangdoan982 trangdoan982 deleted the eng-1960-node-tags-menu-opens-multiple-times-when-hotkey-pressed branch July 8, 2026 17:38
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