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

Add plugin: PopKit #3688

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Add plugin: PopKit #3688

merged 1 commit into from
Jul 12, 2024

Conversation

zhouhua
Copy link
Contributor

@zhouhua zhouhua commented Jun 12, 2024

I am submitting a new Community Plugin

Repo URL

Link to my plugin: https://github.com/zhouhua/obsidian-popkit

Release Checklist

  • I have tested the plugin on
    • Windows
    • macOS
    • Linux
    • Android (if applicable)
    • iOS (if applicable)
  • My GitHub release contains all required files
    • main.js
    • manifest.json
    • styles.css (optional)
  • GitHub release name matches the exact version number specified in my manifest.json (Note: Use the exact version number, don't include a prefix v)
  • The id in my manifest.json matches the id in the community-plugins.json file.
  • My README.md describes the plugin's purpose and provides clear usage instructions.
  • I have read the developer policies at https://docs.obsidian.md/Developer+policies, and have assessed my plugins's adherence to these policies.
  • I have read the tips in https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines and have self-reviewed my plugin to avoid these common pitfalls.
  • I have added a license in the LICENSE file.
  • My project respects and is compatible with the original license of any code from other plugins that I'm using.
    I have given proper attribution to these other projects in my README.md.

@github-actions github-actions bot changed the title add plugin: popkit Add plugin: PopKit Jun 12, 2024
@ObsidianReviewBot
Copy link
Collaborator

ObsidianReviewBot commented Jun 13, 2024

Thank you for your submission, an automated scan of your plugin code's revealed the following issues:

Required

(skipped)


Optional

[1]:We recommend against providing a default hotkey when possible. The reason being that it's easy to pick a hotkey that a user already has configured and they could get confused when that key doesn't do what they expect. Also, it's hard choosing a safe default hotkey that's available for all operating systems.


Do NOT open a new PR for re-validation.
Once you have pushed all of the required changes to your repo, the bot will update the labels on this PR within 6 hours.
If you think some of the required changes are incorrect, please comment with /skip and the reason why you think the results are incorrect.

@ObsidianReviewBot ObsidianReviewBot self-assigned this Jun 13, 2024
@ObsidianReviewBot ObsidianReviewBot added Changes requested Additional review required PR needs to be reviewed by another person, after the currently requested changes have been made and removed Ready for review labels Jun 13, 2024
@zhouhua
Copy link
Contributor Author

zhouhua commented Jun 13, 2024

/skip

innerHTML is used in this code, just translating markdown to html. It's unrelated to the content on the Obsidian page and poses no security risks.

const div = createDiv();
await MarkdownRenderer.render(
  app,
  selection,
  div,
  '',
  new MarkdownRenderChild(div),
);
const html = div.innerHTML;
div.remove();

@github-actions github-actions bot added the Skipped code scan Code scanning skipped because submission is not in TS/author believes result is wrong label Jun 13, 2024
@zhouhua
Copy link
Contributor Author

zhouhua commented Jun 13, 2024

Hi @joethei, when I skipped the automatic checks, the GitHub Actions command to assign a reviewer encountered an error, preventing it from automatically requesting your review for this PR.

image

@joethei
Copy link
Collaborator

joethei commented Jun 13, 2024

id: "popkit-open-popover",,
Don't prefix the command id with the plugin id, Obsidian will make sure that there are no conflicts with other plugins.

hotkeys: [{ modifiers: ["Mod"], key: "." }],
We recommend against providing a default hotkey when possible. The reason being that it's easy to pick a hotkey that a user already has configured and they could get confused when that key doesn't do what they expect. Also, it's hard choosing a safe default hotkey that's available for all operating systems & does not conflict with existing plugins.

handlerString: ](https://github.com/zhouhua/obsidian-popkit/blob/8fcfdf3398913161230a57e81cc08b17114e809e/src/actions/clipboard.ts#L9-L12), [handlerString: , handlerString: `, const fn = new AsyncFunction("context", action.handlerString);
This should not be done this way, use actual callbacks and don't use code evaluation.

name: 'copy HTML',
Use sentence case in UI

@joethei joethei added Minor changes requested PR can be merged after some final changes have been requested and removed Additional review required PR needs to be reviewed by another person, after the currently requested changes have been made Skipped code scan Code scanning skipped because submission is not in TS/author believes result is wrong labels Jun 13, 2024
@zhouhua
Copy link
Contributor Author

zhouhua commented Jun 14, 2024

@joethei Thank you for your review comments. I have already fixed those issues.

I have one issue I'd like to discuss. In my code, I've designed something called handlerString that receives a string and executes it as code (I've removed the related references for now). The goal is to enable users of this plugin to freely add their own custom tools in the future, rather than only using the built-in tools I've written or submitting MRs to my repository. This definitely introduces some security risks, but I'm not sure if there's a better approach.

@zhouhua
Copy link
Contributor Author

zhouhua commented Jun 18, 2024

@joethei Could you help review again?

@zhouhua
Copy link
Contributor Author

zhouhua commented Jun 21, 2024

@joethei Could you help review again?

@zhouhua
Copy link
Contributor Author

zhouhua commented Jun 26, 2024

@joethei Could you help review again?

@joethei joethei assigned joethei and unassigned ObsidianReviewBot Jun 28, 2024
@joethei
Copy link
Collaborator

joethei commented Jun 28, 2024

help: 'Open obsidian help',, help: '打开 Obsidian 帮助',
Remove "Obsidian" here.

customTitle: 'Add Custom Action',, plugin: 'Source Plugin: ',
Use sentence case in UI

import dayjs from 'dayjs';
Instead of importing an external library use moment, since that is already bundled with Obsidian: import {moment} from "obsidian"

@zhouhua
Copy link
Contributor Author

zhouhua commented Jun 28, 2024

@joethei Thanks for reviewing the code. I have fixed those issues.

zhouhua/obsidian-popkit@dba64fd

@zhouhua
Copy link
Contributor Author

zhouhua commented Jul 9, 2024

@joethei Could you help review again?

@ObsidianReviewBot ObsidianReviewBot added Ready for review Changes made and removed Minor changes requested PR can be merged after some final changes have been requested labels Jul 12, 2024
@joethei joethei merged commit 828e500 into obsidianmd:master Jul 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants