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: open preview buttons for context menus #1906

Merged
merged 12 commits into from
Dec 29, 2021

Conversation

SeriousBug
Copy link
Contributor

@SeriousBug SeriousBug commented Dec 16, 2021

  • Adds a "Dendron: Show Preview" button in the context menu when right clicking a markdown file in the explorer, as well as when right clicking a tab in the editor.
  • Extends the Show Preview command to display the note passed in through the context menu for this feature to work.
  • Makes Show Preview fall back to the default preview if a corresponding note is not found.
  • Adds analytics to track when show preview is used from a context menu.

Combined with the following PR, this will replace the default "Show Preview" context menu buttons with Dendron's: microsoft/vscode#139241

@SeriousBug SeriousBug changed the title Feat/open preview buttons for context menus feat: open preview buttons for context menus Dec 16, 2021
@SeriousBug SeriousBug marked this pull request as ready for review December 16, 2021 00:31
@auto-assign auto-assign bot requested a review from kevinslin December 16, 2021 00:31
@SeriousBug SeriousBug force-pushed the feat/open-preview-buttons-for-context-menus branch from ef96e26 to 36381d6 Compare December 16, 2021 21:23
@SeriousBug SeriousBug marked this pull request as draft December 16, 2021 21:47
@SeriousBug SeriousBug marked this pull request as ready for review December 17, 2021 09:21
Copy link
Member

@kevinslin kevinslin left a comment

Choose a reason for hiding this comment

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

When switching between regular preview and dendron preview, this adds complexity to the users:
- when the user navigates from a dendron markdown file to a regular markdown file outside of Dendron, the preview will stop working and it won't be clear that they have to click the preview again
- the same problem happens vice versa except its a little more insidious because the builtin preview will try to render dendron markdown and will fail at dendron specific syntax

Instead of toggling between previews, can we use the Dendron preview for all markdown files?

This will require the following change: [[Dendron Should Show Regular Markdown|dendron://private/task.views.2021.12.16.dendron-should-show-regular-markdown]]

@SeriousBug
Copy link
Contributor Author

This is actually a bit more involved because the preview asks the engine to render the note, but only passes in the id of the note. I'll need to update the API to allow overriding the note body.

@SeriousBug SeriousBug requested a review from kevinslin December 28, 2021 06:41
@SeriousBug SeriousBug marked this pull request as ready for review December 28, 2021 06:41
@kevinslin kevinslin requested review from hikchoi and removed request for hikchoi December 28, 2021 23:05
@kevinslin kevinslin merged commit 8b9160c into master Dec 29, 2021
@kevinslin kevinslin deleted the feat/open-preview-buttons-for-context-menus branch December 29, 2021 01:45
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