steven-tey / novel

Notion-style WYSIWYG editor with AI-powered autocompletion.
https://novel.sh
Apache License 2.0
13.22k stars 1.08k forks source link

bug: slash command tunnel is shared between editor instances #304

Closed miikebar closed 9 months ago

miikebar commented 9 months ago

Provide environment information

  System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 5.51 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.local/share/mise/installs/node/20/bin/node
    Yarn: 1.22.19 - ~/.local/share/mise/installs/yarn/1/bin/yarn
    npm: 10.2.4 - ~/.local/share/mise/installs/node/20/bin/npm
    pnpm: 8.15.1 - ~/.local/share/mise/installs/pnpm/8/bin/pnpm

Describe the bug

When using multiple instances of the editor on the same page, all the slash command popovers open at once when "/" is typed. This is caused by the fact that all the instances utilise one tunnel instance.

I'll soon follow with a PR to fix this issue.

https://github.com/steven-tey/novel/assets/9134970/90f73014-355b-497a-83f5-76c93b0f889d

Link to reproduction

-

To reproduce

Create 2 instances of the editor.

<div className="flex">
  <TailwindEditor />
  <TailwindEditor />
</div>

Additional information

No response