Skip to content

Conversation

@trangdoan982
Copy link
Collaborator

@trangdoan982 trangdoan982 commented Jun 5, 2025

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

Summary by CodeRabbit

  • New Features

    • Added a setting allowing users to specify the folder path where new Discourse nodes will be created.
    • Updated the settings interface with an input field for customizing the nodes folder location.
  • Bug Fixes

    • Improved file creation logic to ensure new nodes are placed in the specified folder, creating the folder if it does not exist.
  • Other Improvements

    • Enhanced internal consistency by updating various dialogs and commands to use the plugin context for node creation.

@linear
Copy link

linear bot commented Jun 5, 2025

@vercel
Copy link

vercel bot commented Jun 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
discourse-graph ⬜️ Skipped (Inspect) Jun 10, 2025 10:09pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This update introduces a configurable folder path setting for Discourse nodes, modifies relevant UI and logic to support this feature, and refactors several utility and modal functions to accept the plugin instance instead of the app instance. It also updates type definitions and default settings to accommodate the new folder path property.

Changes

File(s) Change Summary
apps/obsidian/src/components/GeneralSettings.tsx Added state, handler, and UI for nodesFolderPath setting; updated save logic to persist the new setting.
apps/obsidian/src/components/NodeTypeModal.tsx Changed constructor to accept plugin instead of app; updated usage of plugin context in methods.
apps/obsidian/src/constants.ts Added nodesFolderPath property to DEFAULT_SETTINGS.
apps/obsidian/src/types.ts Added nodesFolderPath property to Settings type.
apps/obsidian/src/index.ts Updated context menu handler to pass plugin instead of app to node creation utility.
apps/obsidian/src/utils/createNodeFromSelectedText.ts Refactored functions to accept plugin; updated file existence check and folder creation logic.
apps/obsidian/src/utils/registerCommands.ts Updated NodeTypeModal instantiation to match new constructor signature and argument order.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GeneralSettings
    participant Plugin
    participant FileSystem

    User->>GeneralSettings: Update nodesFolderPath input
    GeneralSettings->>GeneralSettings: handleFolderPathChange()
    User->>GeneralSettings: Click Save
    GeneralSettings->>Plugin: Save nodesFolderPath to settings
    Plugin->>FileSystem: Use nodesFolderPath for node creation
Loading
sequenceDiagram
    participant User
    participant Editor
    participant NodeTypeModal
    participant Plugin
    participant Utils

    User->>Editor: Trigger Node Creation Command
    Editor->>NodeTypeModal: Open modal (with plugin)
    NodeTypeModal->>Utils: processTextToDiscourseNode({plugin, ...})
    Utils->>Plugin: Access settings.nodesFolderPath
    Utils->>FileSystem: Create node file in specified folder
Loading

Possibly related PRs

  • DiscourseGraphs/discourse-graph#105: Adds a new React component and view for displaying discourse context, and methods for creating discourse node files within a modal, which relates to the changes in node creation logic and modal behavior in this PR.

Suggested reviewers

  • mdroidian

Poem

A folder for nodes, so tidy and neat,
Now settings can guide where ideas retreat.
With plugin in hand and a modal anew,
Files find their place, as rabbits would do.
Hop, hop, hooray—organization complete!
🗂️🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@trangdoan982 trangdoan982 changed the base branch from main to eng-347-toggle-frontmatter June 5, 2025 21:48
@trangdoan982
Copy link
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

✅ Actions performed

Full review triggered.

@trangdoan982 trangdoan982 marked this pull request as ready for review June 5, 2025 21:55
Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

🔥 just one change required ("Discourse Nodes")

</div>
</div>
<div className="setting-item-control">
<input
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to have this autocomplete their existing folders. Could probably use getAllFolders. This can definitely be deferred.

Base automatically changed from eng-347-toggle-frontmatter to main June 10, 2025 20:43
@trangdoan982 trangdoan982 merged commit 6232e21 into main Jun 10, 2025
3 checks passed
@trangdoan982 trangdoan982 deleted the eng-409-choose-folder branch June 10, 2025 22:09
@github-project-automation github-project-automation bot moved this to Done in General Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants