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: AiSparkHub #4923

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

TengleDeng
Copy link

Add [AiSparkHub] plugin

Repo URL

Link to my plugin:https://github.com/TengleDeng/AiSparkHub

Release Checklist

  • I have tested the plugin on
    • Windows
    • macOS
    • Linux
    • Android (if applicable)
    • iOS (if applicable)
  • My GitHub release contains all required files (as individual files, not just in the source.zip / source.tar.gz)
    • 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 [AiSparkHub] plugin Add plugin: AiSparkHub Dec 19, 2024
@ObsidianReviewBot
Copy link
Collaborator

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

Required

[1]:Please remove the main.js file from the repo and add it to your .gitignore. Compiled release files shouldn't get mixed with source code in your commits and should go to the releases files instead.


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 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 Dec 20, 2024
@TengleDeng
Copy link
Author

main.js is the source code not compiled release files, I use Javascript write the plugin and didn't split to serveral files, so main.js is the source code.

@ObsidianReviewBot ObsidianReviewBot added Ready for review and removed Changes requested Additional review required PR needs to be reviewed by another person, after the currently requested changes have been made labels Dec 20, 2024
@ObsidianReviewBot ObsidianReviewBot removed their assignment Dec 20, 2024
@ObsidianReviewBot
Copy link
Collaborator

Changes requested by bot have been made, ready for additional review by human.

@joethei
Copy link
Collaborator

joethei commented Jan 3, 2025

Remove the data.json file from the repo, it serves no purpose.

console.log('开始精确搜索:', query);, console.log('搜索功能已禁用');, console.log('开始模糊搜索:', query);, console.log('提取的关键词:', keywords);, console.log('Smart Connections raw results:', results);, console.log('Command triggered via hotkey');, console.log('Sending text:', text); // 输出发送的文本, console.log('图表库加载成功');, console.log('Loaded settings:', this.settings);, console.log('Opening MultiAI view with URLs:', urls);, console.log('Received send-to-all request:', args[0]);, console.log('Generating main window HTML with settings:', this.settings);, console.log('搜索功能已禁用,使用原文');, console.log('处理搜索结果:', searchResult.title);, console.log('未找到搜索结果,使用原文');, console.log('搜索超时,使用原始文本发送');, console.log('Search results:', {, console.log('搜索功能已禁用');, console.log('未找到Vault搜索结果');, console.log('Smart search results length:', searchResults.smart?.length);, console.log('Smart search formatted result:', smartResult);, console.log('未找到任何搜索结果');, console.log('No main window available');, console.log('Starting sendToAllAI...');, console.log('2. Validating window state...');, console.log('Window state valid');, console.log('3. Searching for relevant content...');, console.log('Search completed, enriched text:', enrichedText);, console.log('Webview details:', JSON.stringify(webviewDetails, null, 2));, console.log('6. Starting to send messages to platforms in parallel...');, console.log(Found platform ${platform.displayName} for URL: ${webview.url});, console.log(Send result:, result);, console.log('7. Recording prompt...');, console.log('8. All operations completed successfully');, console.log(Starting sendToAI for platform: ${platform});, console.log(Using selectors for ${platform}:, selectors);, console.log('处理后的消息:', safeMessage);, console.log('Executing script in main window...');, console.log(Script execution result for ${platform}:, result);, console.log(Getting response for platform: ${platform});, console.log(Using selectors for ${platform}:, selectors);, console.log(Got response from ${platform}:, response);, console.log('Dialog record saved successfully');, console.log('提示词历史功能已禁用');, console.log('提示词记录已保存');, console.log('Opening multiple webviews from history');, console.log('PromptHistoryData constructor called');, console.log('Loading prompt history data...');, console.log('Loaded and processed prompts:', this.prompts.length);, console.log('Saving prompt history data...');, console.log('Adding new prompt:', { content, webviews });, console.log('Removing prompt:', id);, console.log('Toggling favorite for prompt:', id);, console.log('开始生成词云...');, console.log('词云容器尺寸:', width, height);, console.log('词云数据:', words);, console.log('开始绘制词云...');, console.log('词云绘制完成');
Please avoid unnecessary logging. If you need it for debugging purposes, add a check to only log during development.

[hotkeys:
You should not provide a default hotkey. 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.

if (!window.Chart) {
External resources need to be bundled with the plugin, not loaded from external sources.

await this.mainWindow.webContents.executeJavaScript(](https://github.com/TengleDeng/AiSparkHub/blob/223118f6e3f5ad1dc2a6ee81bb72a7a407e474aa/main.js#L804-L837), [await this.mainWindow.webContents.executeJavaScript(, const webviewDetails = await this.mainWindow.webContents.executeJavaScript(](https://github.com/TengleDeng/AiSparkHub/blob/223118f6e3f5ad1dc2a6ee81bb72a7a407e474aa/main.js#L1786-L1801), [const webviews = await this.mainWindow.webContents.executeJavaScript(, const script = ](https://github.com/TengleDeng/AiSparkHub/blob/223118f6e3f5ad1dc2a6ee81bb72a7a407e474aa/main.js#L1902-L1999), [const script =
Build UI's the proper way, as described in the Obsidian docs, and don't just inject HTML and JS, this can be very dangerous.
Use the API's provided by the AI tools, that will lead to a much more consistent UI too.
And it won't break if the website of a AI tool changes.

containerEl.createEl('h2', { text: '多AI对话设置' });
Don't add a top-level heading in the settings tab, such as "General", "Settings", or the name of your plugin.

containerEl.createEl('h3', { text: 'AI窗口设置' });, containerEl.createEl('h3', { text: '对话记录设置' });, containerEl.createEl('h3', { text: '提示词历史记录设置' });, containerEl.createEl('h3', { text: 'AI列表(拖动调整顺序)' });
For section headings in settings use:

new Setting(containerEl).setName('name here').setHeading();

containerEl.createEl('h3', { text: 'AI窗口设置' });, containerEl.createEl('h3', { text: '对话记录设置' });, containerEl.createEl('h3', { text: '提示词历史记录设置' });
Avoid "settings" in settings headings

const styleEl = document.createElement('style');
This should be in the styles.css, not inject into the DOM here.

@joethei joethei self-assigned this Jan 3, 2025
@joethei joethei added Changes requested Installation not recommended Submission does not conform to developer policies, or includes potentially dangerous code. Minor changes requested PR can be merged after some final changes have been requested and removed Ready for review labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes requested Installation not recommended Submission does not conform to developer policies, or includes potentially dangerous code. Minor changes requested PR can be merged after some final changes have been requested plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants