Skip to content

Conversation

@trangdoan982
Copy link
Collaborator

@trangdoan982 trangdoan982 commented Mar 28, 2025

  • because there's no datacore API yet, we're using obsidian-dataview
image Screenshot 2025-03-28 at 13 51 02 Screenshot 2025-03-28 at 13 51 17 image

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated relationships section to visually manage connections between nodes.
    • Added an interactive interface for creating and editing relationships, offering guided selections and notifications.
    • Launched a customizable search bar with enhanced fuzzy matching for faster, more accurate results.
  • Chores

    • Improved the plugin shutdown process to ensure views are cleanly removed, enhancing overall stability.

@vercel
Copy link

vercel bot commented Mar 28, 2025

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

Name Status Preview Comments Updated (UTC)
discourse-graph ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2025 7:48pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 28, 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 pull request refactors the discourse context view for improved modularity and introduces new features for managing node relationships. It updates import paths in the discourse view, exports a constant directly, and reorganizes the rendering logic to include a separate relationships section. In addition, two new components—RelationshipManager and SearchBar—are added to facilitate relationship management via a debounced, fuzzy search using a new QueryEngine service. An asynchronous unload method is also implemented in the plugin to clean up views, with a new dev dependency added for the Obsidian Dataview API.

Changes

File(s) Summary
apps/.../DiscourseContextView.tsx Updated import paths to relative; integrated RelationshipManager; switched constant export to a direct export; modified render logic using fragments and added a relationships section.
apps/.../RelationshipManager.tsx New React component managing node relationships; handles state, invokes search via QueryEngine, and updates node relationships with bidirectional linking and error handling.
apps/.../SearchBar.tsx New customizable search interface component with debounced fuzzy search; supports various prop configurations and provides styled dropdown results along with associated types.
apps/.../index.ts Added asynchronous onunload method in the plugin to detach discourse context views during plugin unload.
apps/.../QueryEngine.ts New service class for fuzzy searching nodes using the Dataview API, with methods for searching by title and a fuzzy match utility along with a new SearchNodeOptions type.
package.json Added "obsidian-dataview": "^0.5.68" to devDependencies.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant RM as RelationshipManager
    participant SB as SearchBar
    participant QE as QueryEngine

    U->>RM: Click "Add Relationship"
    RM->>SB: Display search input
    U->>SB: Enter query text
    SB->>QE: Invoke debounced fuzzy search
    QE-->>SB: Return matching nodes
    SB-->>RM: Deliver selected node
    RM->>RM: Process selection and update relationships
    RM-->>U: Render updated relationships UI
Loading

Possibly related PRs

Suggested reviewers

  • mdroidian

Poem

I'm a rabbit in the code, hopping with delight,
New components and flows make my world so bright.
I nibble through fragments and search bars in bloom,
Fuzzy queries and relationships chase away the gloom.
With every bug fixed, my heart skips a beat—
A whimsical journey where code and joy meet!


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 28, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🔭 Outside diff range comments (1)
apps/obsidian/src/index.ts (1)

6-6: 💡 Verification agent

🧩 Analysis chain

Double check VIEW_TYPE_DISCOURSE_CONTEXT constant import path

I notice that the VIEW_TYPE_DISCOURSE_CONTEXT constant is now imported from "~/types", but according to the relevant code snippets, it's also exported in DiscourseContextView.tsx. This could potentially lead to multiple source-of-truth issues.


🏁 Script executed:

#!/bin/bash
# Check for multiple declarations of VIEW_TYPE_DISCOURSE_CONTEXT
rg "export const VIEW_TYPE_DISCOURSE_CONTEXT" --type ts

Length of output: 276


Attention: Consolidate Constant Definition

The VIEW_TYPE_DISCOURSE_CONTEXT constant is being exported from both apps/obsidian/src/types.ts and apps/obsidian/src/components/DiscourseContextView.tsx. This duplicate export can lead to multiple source-of-truth issues.

  • Found Duplicates:
    • apps/obsidian/src/types.ts
    • apps/obsidian/src/components/DiscourseContextView.tsx
  • Import in Question: In apps/obsidian/src/index.ts, the constant is imported from "~/types".
  • Recommendation: Verify if both exports are intentional. If not, consolidate the constant into one canonical file (preferably types.ts) and update any imports accordingly.
🧹 Nitpick comments (13)
apps/obsidian/src/services/QueryEngine.ts (1)

51-72: Improve fuzzy search algorithm

The current fuzzy search implementation is simplistic and may not provide optimal search results in all cases. Consider adding more advanced fuzzy matching techniques, such as:

  1. Character skipping with penalties
  2. Using a Levenshtein distance algorithm for better typo tolerance
  3. Prioritizing matches at word boundaries

This would enhance the user experience when searching for nodes.

fuzzySearch(target: string, search: string): boolean {
  if (!search || !target) return false;

  const targetLower = target.toLowerCase();
  const searchLower = search.toLowerCase();

  if (searchLower.length > targetLower.length) return false;

  if (targetLower.includes(searchLower)) return true;

-  let searchIndex = 0;
-  for (
-    let i = 0;
-    i < targetLower.length && searchIndex < searchLower.length;
-    i++
-  ) {
-    if (targetLower[i] === searchLower[searchIndex]) {
-      searchIndex++;
-    }
-  }
-  return searchIndex === searchLower.length;
+  // Character skipping with consecutive matching bonus
+  let searchIndex = 0;
+  let lastMatchIndex = -1;
+  let consecutiveMatches = 0;
+  
+  for (let i = 0; i < targetLower.length && searchIndex < searchLower.length; i++) {
+    if (targetLower[i] === searchLower[searchIndex]) {
+      // Give bonus for matches at word boundaries
+      if (i === 0 || targetLower[i-1] === ' ' || targetLower[i-1] === '-' || targetLower[i-1] === '_') {
+        consecutiveMatches += 2;
+      } 
+      // Give bonus for consecutive matches
+      else if (lastMatchIndex === i - 1) {
+        consecutiveMatches++;
+      }
+      
+      lastMatchIndex = i;
+      searchIndex++;
+    }
+  }
+  
+  // Require at least 80% match quality or full match for short queries
+  const matchQuality = searchIndex / searchLower.length;
+  const matchBonus = consecutiveMatches / searchLower.length;
+  
+  return searchIndex === searchLower.length || 
+         (matchQuality >= 0.8 && matchBonus > 0.5);
}
apps/obsidian/src/components/DiscourseContextView.tsx (2)

3-4: Use consistent import path style

The import paths have been changed from absolute to relative. Ensure this change is consistent with the project's import conventions throughout the codebase.

#!/bin/bash
# Check import styles in the codebase
rg "^import .* from ['\"]~/" --type ts | head -n 10

71-85: Consider abstracting relationship section into a separate component

The relationships section could benefit from being extracted into its own component. This would improve code organization and make it easier to maintain and test each part independently.

const RelationshipsSection = ({ plugin, activeFile }: { plugin: DiscourseGraphPlugin, activeFile: TFile }) => {
  return (
    <div className="relationships-section">
      <h5
        style={{
          marginTop: "1rem",
          marginBottom: "0.75rem",
          borderBottom: "1px solid var(--background-modifier-border)",
          paddingBottom: "0.25rem",
        }}
      >
        Relationships
      </h5>
      <RelationshipManager plugin={plugin} activeFile={activeFile} />
    </div>
  );
};

Then use it in the renderContent function:

return (
  <>
    <div style={{ marginBottom: "1.5rem" }}>
      {/* Node type and content display */}
    </div>

-    <div className="relationships-section">
-      <h5
-        style={{
-          marginTop: "1rem",
-          marginBottom: "0.75rem",
-          borderBottom: "1px solid var(--background-modifier-border)",
-          paddingBottom: "0.25rem",
-        }}
-      >
-        Relationships
-      </h5>
-      {activeFile && (
-        <RelationshipManager plugin={plugin} activeFile={activeFile} />
-      )}
-    </div>
+    {activeFile && <RelationshipsSection plugin={plugin} activeFile={activeFile} />}
  </>
);
apps/obsidian/src/components/RelationshipManager.tsx (5)

27-30: Consider memoizing the activeNodeTypeId computation

This IIFE runs on every render to compute the active node's type ID. Since it depends only on plugin and activeFile which don't change frequently, consider using useMemo to optimize performance.

- const activeNodeTypeId = (() => {
-   const fileCache = plugin.app.metadataCache.getFileCache(activeFile);
-   return fileCache?.frontmatter?.nodeTypeId;
- })();
+ const activeNodeTypeId = useMemo(() => {
+   const fileCache = plugin.app.metadataCache.getFileCache(activeFile);
+   return fileCache?.frontmatter?.nodeTypeId;
+ }, [plugin.app.metadataCache, activeFile]);

32-66: Memoize getAvailableRelationTypes for better performance

The getAvailableRelationTypes function performs complex filtering and mapping operations on every render. Since it depends only on activeNodeTypeId and plugin.settings, consider using useMemo to avoid unnecessary recalculations.

- const getAvailableRelationTypes = () => {
+ const availableRelationTypes = useMemo(() => {
    if (!activeNodeTypeId) return [];

    const options: RelationTypeOption[] = [];

    const relevantRelations = plugin.settings.discourseRelations.filter(
      (relation) =>
        relation.sourceId === activeNodeTypeId ||
        relation.destinationId === activeNodeTypeId,
    );

    relevantRelations.forEach((relation) => {
      const relationType = plugin.settings.relationTypes.find(
        (type) => type.id === relation.relationshipTypeId,
      );

      if (!relationType) return;

      const isSource = relation.sourceId === activeNodeTypeId;

      const existingOption = options.find(
        (opt) => opt.id === relationType.id && opt.isSource === isSource,
      );

      if (!existingOption) {
        options.push({
          id: relationType.id,
          label: isSource ? relationType.label : relationType.complement,
          isSource,
        });
      }
    });

    return options;
-  };
-
-  const availableRelationTypes = getAvailableRelationTypes();
+ }, [activeNodeTypeId, plugin.settings]);

94-101: Simplify the link template string manipulation

The current code adds quotes to the template string and then immediately removes them using regex, which is unnecessary and potentially error-prone. Consider simplifying this logic.

- await appendLinkToFrontmatter(
-   activeFile,
-   `"[[${selectedNode.name}]]"`.replace(/^['"]+|['"]+$/g, ""),
- );
- await appendLinkToFrontmatter(
-   selectedNode,
-   `"[[${activeFile.name}]]"`.replace(/^['"]+|['"]+$/g, ""),
- );
+ await appendLinkToFrontmatter(
+   activeFile,
+   `[[${selectedNode.name}]]`,
+ );
+ await appendLinkToFrontmatter(
+   selectedNode,
+   `[[${activeFile.name}]]`,
+ );

25-25: Memoize QueryEngine instance

A new QueryEngine instance is created on every render. This is inefficient since the engine only depends on the plugin app which does not change during the component's lifetime.

- const queryEngine = new QueryEngine(plugin.app);
+ const queryEngine = useMemo(() => new QueryEngine(plugin.app), [plugin.app]);

130-139: Extract inline styles to a separate styles object

The component uses multiple inline styles spread throughout the render logic. Consider extracting these to a separate styles object at the top of the component for better maintainability.

// Near the top of the component function
+ const styles = {
+   button: {
+     width: "100%",
+     padding: "8px 12px",
+     backgroundColor: "var(--interactive-accent)",
+     color: "var(--text-on-accent)",
+     border: "none",
+     borderRadius: "4px",
+     cursor: "pointer",
+     marginTop: "1rem",
+   },
+   // Add other style objects here
+ };

// Then in your JSX
- style={{
-   width: "100%",
-   padding: "8px 12px",
-   backgroundColor: "var(--interactive-accent)",
-   color: "var(--text-on-accent)",
-   border: "none",
-   borderRadius: "4px",
-   cursor: "pointer",
-   marginTop: "1rem",
- }}
+ style={styles.button}
apps/obsidian/src/components/SearchBar.tsx (5)

57-63: Memoize QueryEngine instance and default search function

A new QueryEngine instance is created on every render. Additionally, the defaultFuzzySearch function is recreated on every render. Memoize both for better performance.

- const queryEngine = new QueryEngine(app);
- const defaultFuzzySearch = (query: string) => {
-   if (!options) return [];
-   return options.filter((item) =>
-     queryEngine.fuzzySearch(getItemText(item), query),
-   );
- };
+ const queryEngine = useMemo(() => new QueryEngine(app), [app]);
+ const defaultFuzzySearch = useMemo(() => (query: string) => {
+   if (!options) return [];
+   return options.filter((item) =>
+     queryEngine.fuzzySearch(getItemText(item), query),
+   );
+ }, [options, queryEngine, getItemText]);

118-120: Add keyboard navigation support for accessibility

The current implementation doesn't support keyboard navigation through search results. Add keyboard handlers to navigate and select items using arrow keys and Enter.

+ // Add this near other state variables
+ const handleKeyDown = (e: React.KeyboardEvent) => {
+   if (!shouldShowResults || searchResults.length === 0) return;
+   
+   if (e.key === 'ArrowDown') {
+     e.preventDefault();
+     setHoverIndex(prev => {
+       if (prev === null || prev >= searchResults.length - 1) return 0;
+       return prev + 1;
+     });
+   } else if (e.key === 'ArrowUp') {
+     e.preventDefault();
+     setHoverIndex(prev => {
+       if (prev === null || prev <= 0) return searchResults.length - 1;
+       return prev - 1;
+     });
+   } else if (e.key === 'Enter') {
+     e.preventDefault();
+     if (hoverIndex !== null) {
+       handleItemSelect(searchResults[hoverIndex]);
+     }
+   } else if (e.key === 'Escape') {
+     e.preventDefault();
+     setIsInputFocused(false);
+   }
+ };

// Add this to the input element
+ onKeyDown={handleKeyDown}

134-141: Use useCallback for event handlers

The onChange event handler is recreated on every render. Use useCallback to memoize it for better performance.

+ const handleInputChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
+   setSearchQuery(e.target.value);
+   if (!isSearching) {
+     setIsSearching(true);
+     setSelectedItem(null);
+     onNodeSelect(null);
+   }
+ }, [isSearching, onNodeSelect]);

// Then in your JSX
- onChange={(e) => {
-   setSearchQuery(e.target.value);
-   if (!isSearching) {
-     setIsSearching(true);
-     setSelectedItem(null);
-     onNodeSelect(null);
-   }
- }}
+ onChange={handleInputChange}

159-177: Add proper error handling for search failures

Currently, there's no explicit error handling for when the search function fails. Wrap the search function call in a try-catch block to handle potential errors gracefully.

Add proper error handling to the debouncedSearch function:

const debouncedSearch = useMemo(
  () =>
    debounce(async (query: string) => {
      if (!effectiveSearchFunction) return;

      if (!query || query.length < minQueryLength) {
        setSearchResults(options || []);
        return;
      }

+     try {
        const results = await effectiveSearchFunction(query);
        setSearchResults(results);
+     } catch (error) {
+       console.error("Search failed:", error);
+       setSearchResults([]);
+       // Optionally show an error message to the user
+     }
    }, debounceMs),
  [effectiveSearchFunction, minQueryLength, debounceMs, options],
);

183-190: Make maxHeight configurable for search results

The search results container has a fixed maxHeight of 200px, which might not be appropriate for all use cases. Make this configurable through props.

// Add to SearchBarBaseProps
+ maxResultsHeight?: string | number;

// Set default in component parameters
+ maxResultsHeight = "200px",

// Update the style in the render function
-           maxHeight: "200px",
+           maxHeight: maxResultsHeight,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cd6119 and 170dd50.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • apps/obsidian/src/components/DiscourseContextView.tsx (2 hunks)
  • apps/obsidian/src/components/RelationshipManager.tsx (1 hunks)
  • apps/obsidian/src/components/SearchBar.tsx (1 hunks)
  • apps/obsidian/src/index.ts (1 hunks)
  • apps/obsidian/src/services/QueryEngine.ts (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🧬 Code Definitions (4)
apps/obsidian/src/components/RelationshipManager.tsx (3)
apps/obsidian/src/index.ts (1)
  • DiscourseGraphPlugin (14-74)
apps/obsidian/src/services/QueryEngine.ts (1)
  • QueryEngine (9-73)
apps/obsidian/src/components/SearchBar.tsx (1)
  • SearchBar (34-224)
apps/obsidian/src/index.ts (2)
apps/obsidian/src/components/DiscourseContextView.tsx (1)
  • VIEW_TYPE_DISCOURSE_CONTEXT (6-6)
apps/obsidian/src/types.ts (1)
  • VIEW_TYPE_DISCOURSE_CONTEXT (27-27)
apps/obsidian/src/components/SearchBar.tsx (1)
apps/obsidian/src/services/QueryEngine.ts (1)
  • QueryEngine (9-73)
apps/obsidian/src/components/DiscourseContextView.tsx (2)
apps/obsidian/src/types.ts (1)
  • VIEW_TYPE_DISCOURSE_CONTEXT (27-27)
apps/obsidian/src/components/RelationshipManager.tsx (1)
  • RelationshipManager (18-234)
🔇 Additional comments (2)
apps/obsidian/src/index.ts (1)

71-73: Good implementation of cleanup functionality

Adding the onunload method is a good practice for properly cleaning up resources when the plugin is unloaded. This prevents memory leaks and ensures that UI elements are correctly detached from the workspace.

apps/obsidian/src/components/DiscourseContextView.tsx (1)

51-87: Good refactoring of the render function

The rendering structure has been improved by:

  1. Using React fragments to avoid unnecessary div nesting
  2. Creating a dedicated relationships section with proper styling
  3. Conditionally rendering the RelationshipManager component

This enhances the component's readability and maintainability.

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.

I couldn't get it to work on my end (noted below) so didn't do a complete review. I think we should move QueryEngine to a util function and look at it again after. Also, we should be looking for Obsidian native function/class/components when possible (for SearchBar in this case). The latter we can discuss in our next meeting.

@trangdoan982
Copy link
Collaborator Author

@mdroidian fix a few issues:

  • the search now only shows nodes compatible types (defined from the discourseRelations)
  • i also added a small UI to show users what node types are compatible with the active file's node type
  • fixed a few display issues

@trangdoan982
Copy link
Collaborator Author

@mdroidian i fixed a few issues since you last review:

  • search allows only compatible node types, defined in the discourseRelations now
  • i added a little UI signal to show them what node types are compatible
  • fix a few display issues
Screenshot 2025-03-31 at 15 17 38

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.

Good stuff! A few changes requested.

Comment on lines 5 to 12
plugins: {
plugins: {
[key: string]: {
api: any;
};
};
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this temporary? Stated differently, will this in the official docs/types?
Or could this be removed?

This would be a good place to make a comment explaining why we are adding type definitions to the Obsidian API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes this would be temporary. once we use npm we can remove this.
for now i see that the hacky way on discord is people accessing datacore with: appWithPlugins.plugins?.plugins?.["datacore"]?.api;
but typescript won't recognize this, hence the type. I will add a comment.

* Returns true if the search term is found within the target string
* with tolerance for typos and partial matches
*/
fuzzySearch(target: string, search: string): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

consider using Obsidian's prepareFuzzySearch. This can be marked out of scope.

@mdroidian mdroidian self-requested a review April 7, 2025 20:56
@linear
Copy link

linear bot commented Apr 7, 2025

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.

🔥

Comment on lines +34 to +44
options.forEach((option) => {
const text = getItemText(option);
dropdown.addOption(text, text);
});

if (
currentValue &&
options.some((opt) => getItemText(opt) === currentValue)
) {
dropdown.setValue(currentValue);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: getItemText is running on all options three times in this component. This could be optimized.
Not a big problem for now as we are just doing option.label.

@mdroidian mdroidian merged commit a3c388c into main Apr 10, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this to Done in General Apr 10, 2025
@mdroidian mdroidian deleted the eng-96-new-relation branch April 10, 2025 19:48
mdroidian pushed a commit that referenced this pull request May 16, 2025
author Trang Doan <44855874+trangdoan982@users.noreply.github.com> 1744314525 -0400
committer Michael Gartner <mclicks@gmail.com> 1747354088 -0600

ENG-96 Create new relationship between nodes (#115)

* instantiate new relationship worked

* fix

* address PR comments

* fix bi-directional update issues

* show only compatible node type options

* small fix

* breakdown the components. use datacore

* working

* address PR comments

* improve search by only allowing compatible node results

* .

* rm dataview

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Move llm-api endpoints to vercel serverless (#102)

* testing gemini

* move endgoint to website

* open ai endpoint

* added anthropic endpoint

* pass env vars

* add cors handdling and options

* .

* using centralised cors middleware

* only adding bypass cookie

* use right key

* remove the bypass token requirement

* sanitize, fix routes

* remove server action config

* DRY

* remove unused

* address review

* adress review

Roam: Add feedback toggle (#118)

* add settings to hide or show button, also works when disabled or enabled midway

* review

* .

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

[ENG-197] Fix creating link with invalid chars (#121)

* fix creating link with invalid chars

* placeholder update

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam:  Add feedback button to settings menu - ENG-147 (#122)

* add button to bottom right, don't hide sdk css, tested

* remove intent not working
git

* remove ts-ignore and use a better type def

* remove styling

Update NodeConfig to use new UIDs for DiscourseNodeIndex and DiscourseNodeSpecification components (#126)

Roam: Add PostHog user identification for enhanced analytics tracking using user's roam UID as the unique identifier - ENG-177 (#123)

* add posthog identify

* remove username and email to keep it anonymus

* double userUid and best practice for js

Roam: Discourse Context Overlay - remove queue and arbitrary delay (#127)

* Refactor getOverlayInfo to use async/await and improve error handling. Update cache key from title to tag and remove overlayQueue logic for cleaner implementation.

* Remove experimental getOverlayInfo function

* Remove unused refreshUi logic

[ENG-44] Display relations (#116)

* instantiate new relationship worked

* add display relations

* remove dv

* sm fix

[ENG-198] Filtered out related file in search (#125)

* filtered out related file

* fix some naming

[ENG-97] Use TailwindCSS in obsidian app (#128)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

[ENG-192] Change all existing styles to using tw (#129)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam: Bug-fix: Don't let user create discourse nodes with empty text using node context menu - ENG-171 (#130)

* functional covering all three cases tested locally

* apply coderabbit review suggestion

* better approach one that I understand and can reason about

* accidental removal of onClose

Update Roam app version to 0.13.0 in package.json and package-lock.json (#134)

[ENG-204] Move from localStorage to extensionAPI.settings (#133)

* cur progress

* address PR comments

* kinda works. need to test more

* small fix

* address PR comments

.

Create publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Enhance DiscourseContextOverlay: Update button styles to include loading state and improve score/ref display during loading. Use placeholders for score and refs when loading. (#136)

.

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Refactor ExportDialog: Remove discourseGraphEnabled state and simplify FormGroup visibility logic. Set includeDiscourseContext to false by default. (#139)

Enhance LabelDialog: Add confirmText to return object for improved button text handling based on action type. (#141)

Additional styles / cursor rules (#142)

* Update STYLE_GUIDE.md and main.mdc: Add guideline for utilizing utility functions for reusable logic and common operations.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer arrow functions over regular function declarations.

* Update main.mdc: Add guideline to prefer Tailwind classes when refactoring inline styles.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer early returns over nested conditionals for improved readability.

Roam: When a user deletes a node also delete all the corresponding relations to the node - ENG-26 (#149)

* ask user for confirmation, delete corresponding relations

* address review

* address review

* address comments

[ENG-301] Create node in right-click menu (#152)

* create node in right-click menu

* small fix

* address PR comments

* address PR comments

add readme and remove sample commands

remove sample editor command

rm space

minor fixes

Roam: Bug fix - Insert Discourse Node after creation (#154)

* remove focus after menu select to allow updateBlock to work

* add clarifying comment

[ENG-308] Add command to open DG settings (#158)

* add command to open DG settings

* edit comment

ENG-322 - Switch from MIT to Apache 2.0 license (#156)

* Switch from MIT to Apache 2.0 license

* copyright discourse graphs

* rm liscense from apps/roam

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

initial port

[ENG-207] Move Github sync setting to individual nodes (#124)

* current progress

* improve in UI: if sync is turned off then also turn off the comments configuration

* address PR comments

* revert graphOverviewUid bug

* revert graphOverviewUid bug - getDiscourseNodes

* avoid racing conditions for github sync

* nested settings

* temp fix to race condition

* remove unecessary DOM and match existing styles

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.

Refactor Export components to use getSetting for consistent settings retrieval

- Updated ExportDialog and ExportGithub components to replace localStorageGet with getSetting for fetching GitHub OAuth and repository settings.
- Modified extensionSettings utility functions to use arrow functions and provide a default value for getSetting.
- Improved code readability and maintainability by standardizing the method of accessing settings.

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.
mdroidian pushed a commit that referenced this pull request May 16, 2025
author Trang Doan <44855874+trangdoan982@users.noreply.github.com> 1744314525 -0400
committer Michael Gartner <mclicks@gmail.com> 1747354088 -0600

ENG-96 Create new relationship between nodes (#115)

* instantiate new relationship worked

* fix

* address PR comments

* fix bi-directional update issues

* show only compatible node type options

* small fix

* breakdown the components. use datacore

* working

* address PR comments

* improve search by only allowing compatible node results

* .

* rm dataview

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Move llm-api endpoints to vercel serverless (#102)

* testing gemini

* move endgoint to website

* open ai endpoint

* added anthropic endpoint

* pass env vars

* add cors handdling and options

* .

* using centralised cors middleware

* only adding bypass cookie

* use right key

* remove the bypass token requirement

* sanitize, fix routes

* remove server action config

* DRY

* remove unused

* address review

* adress review

Roam: Add feedback toggle (#118)

* add settings to hide or show button, also works when disabled or enabled midway

* review

* .

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

[ENG-197] Fix creating link with invalid chars (#121)

* fix creating link with invalid chars

* placeholder update

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam:  Add feedback button to settings menu - ENG-147 (#122)

* add button to bottom right, don't hide sdk css, tested

* remove intent not working
git

* remove ts-ignore and use a better type def

* remove styling

Update NodeConfig to use new UIDs for DiscourseNodeIndex and DiscourseNodeSpecification components (#126)

Roam: Add PostHog user identification for enhanced analytics tracking using user's roam UID as the unique identifier - ENG-177 (#123)

* add posthog identify

* remove username and email to keep it anonymus

* double userUid and best practice for js

Roam: Discourse Context Overlay - remove queue and arbitrary delay (#127)

* Refactor getOverlayInfo to use async/await and improve error handling. Update cache key from title to tag and remove overlayQueue logic for cleaner implementation.

* Remove experimental getOverlayInfo function

* Remove unused refreshUi logic

[ENG-44] Display relations (#116)

* instantiate new relationship worked

* add display relations

* remove dv

* sm fix

[ENG-198] Filtered out related file in search (#125)

* filtered out related file

* fix some naming

[ENG-97] Use TailwindCSS in obsidian app (#128)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

[ENG-192] Change all existing styles to using tw (#129)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam: Bug-fix: Don't let user create discourse nodes with empty text using node context menu - ENG-171 (#130)

* functional covering all three cases tested locally

* apply coderabbit review suggestion

* better approach one that I understand and can reason about

* accidental removal of onClose

Update Roam app version to 0.13.0 in package.json and package-lock.json (#134)

[ENG-204] Move from localStorage to extensionAPI.settings (#133)

* cur progress

* address PR comments

* kinda works. need to test more

* small fix

* address PR comments

.

Create publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Enhance DiscourseContextOverlay: Update button styles to include loading state and improve score/ref display during loading. Use placeholders for score and refs when loading. (#136)

.

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Refactor ExportDialog: Remove discourseGraphEnabled state and simplify FormGroup visibility logic. Set includeDiscourseContext to false by default. (#139)

Enhance LabelDialog: Add confirmText to return object for improved button text handling based on action type. (#141)

Additional styles / cursor rules (#142)

* Update STYLE_GUIDE.md and main.mdc: Add guideline for utilizing utility functions for reusable logic and common operations.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer arrow functions over regular function declarations.

* Update main.mdc: Add guideline to prefer Tailwind classes when refactoring inline styles.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer early returns over nested conditionals for improved readability.

Roam: When a user deletes a node also delete all the corresponding relations to the node - ENG-26 (#149)

* ask user for confirmation, delete corresponding relations

* address review

* address review

* address comments

[ENG-301] Create node in right-click menu (#152)

* create node in right-click menu

* small fix

* address PR comments

* address PR comments

add readme and remove sample commands

remove sample editor command

rm space

minor fixes

Roam: Bug fix - Insert Discourse Node after creation (#154)

* remove focus after menu select to allow updateBlock to work

* add clarifying comment

[ENG-308] Add command to open DG settings (#158)

* add command to open DG settings

* edit comment

ENG-322 - Switch from MIT to Apache 2.0 license (#156)

* Switch from MIT to Apache 2.0 license

* copyright discourse graphs

* rm liscense from apps/roam

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

initial port

[ENG-207] Move Github sync setting to individual nodes (#124)

* current progress

* improve in UI: if sync is turned off then also turn off the comments configuration

* address PR comments

* revert graphOverviewUid bug

* revert graphOverviewUid bug - getDiscourseNodes

* avoid racing conditions for github sync

* nested settings

* temp fix to race condition

* remove unecessary DOM and match existing styles

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.

Refactor Export components to use getSetting for consistent settings retrieval

- Updated ExportDialog and ExportGithub components to replace localStorageGet with getSetting for fetching GitHub OAuth and repository settings.
- Modified extensionSettings utility functions to use arrow functions and provide a default value for getSetting.
- Improved code readability and maintainability by standardizing the method of accessing settings.

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.
mdroidian pushed a commit that referenced this pull request Jun 3, 2025
author Trang Doan <44855874+trangdoan982@users.noreply.github.com> 1744314525 -0400
committer Michael Gartner <mclicks@gmail.com> 1747354088 -0600

ENG-96 Create new relationship between nodes (#115)

* instantiate new relationship worked

* fix

* address PR comments

* fix bi-directional update issues

* show only compatible node type options

* small fix

* breakdown the components. use datacore

* working

* address PR comments

* improve search by only allowing compatible node results

* .

* rm dataview

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Move llm-api endpoints to vercel serverless (#102)

* testing gemini

* move endgoint to website

* open ai endpoint

* added anthropic endpoint

* pass env vars

* add cors handdling and options

* .

* using centralised cors middleware

* only adding bypass cookie

* use right key

* remove the bypass token requirement

* sanitize, fix routes

* remove server action config

* DRY

* remove unused

* address review

* adress review

Roam: Add feedback toggle (#118)

* add settings to hide or show button, also works when disabled or enabled midway

* review

* .

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

[ENG-197] Fix creating link with invalid chars (#121)

* fix creating link with invalid chars

* placeholder update

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam:  Add feedback button to settings menu - ENG-147 (#122)

* add button to bottom right, don't hide sdk css, tested

* remove intent not working
git

* remove ts-ignore and use a better type def

* remove styling

Update NodeConfig to use new UIDs for DiscourseNodeIndex and DiscourseNodeSpecification components (#126)

Roam: Add PostHog user identification for enhanced analytics tracking using user's roam UID as the unique identifier - ENG-177 (#123)

* add posthog identify

* remove username and email to keep it anonymus

* double userUid and best practice for js

Roam: Discourse Context Overlay - remove queue and arbitrary delay (#127)

* Refactor getOverlayInfo to use async/await and improve error handling. Update cache key from title to tag and remove overlayQueue logic for cleaner implementation.

* Remove experimental getOverlayInfo function

* Remove unused refreshUi logic

[ENG-44] Display relations (#116)

* instantiate new relationship worked

* add display relations

* remove dv

* sm fix

[ENG-198] Filtered out related file in search (#125)

* filtered out related file

* fix some naming

[ENG-97] Use TailwindCSS in obsidian app (#128)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

[ENG-192] Change all existing styles to using tw (#129)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam: Bug-fix: Don't let user create discourse nodes with empty text using node context menu - ENG-171 (#130)

* functional covering all three cases tested locally

* apply coderabbit review suggestion

* better approach one that I understand and can reason about

* accidental removal of onClose

Update Roam app version to 0.13.0 in package.json and package-lock.json (#134)

[ENG-204] Move from localStorage to extensionAPI.settings (#133)

* cur progress

* address PR comments

* kinda works. need to test more

* small fix

* address PR comments

.

Create publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Enhance DiscourseContextOverlay: Update button styles to include loading state and improve score/ref display during loading. Use placeholders for score and refs when loading. (#136)

.

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Refactor ExportDialog: Remove discourseGraphEnabled state and simplify FormGroup visibility logic. Set includeDiscourseContext to false by default. (#139)

Enhance LabelDialog: Add confirmText to return object for improved button text handling based on action type. (#141)

Additional styles / cursor rules (#142)

* Update STYLE_GUIDE.md and main.mdc: Add guideline for utilizing utility functions for reusable logic and common operations.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer arrow functions over regular function declarations.

* Update main.mdc: Add guideline to prefer Tailwind classes when refactoring inline styles.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer early returns over nested conditionals for improved readability.

Roam: When a user deletes a node also delete all the corresponding relations to the node - ENG-26 (#149)

* ask user for confirmation, delete corresponding relations

* address review

* address review

* address comments

[ENG-301] Create node in right-click menu (#152)

* create node in right-click menu

* small fix

* address PR comments

* address PR comments

add readme and remove sample commands

remove sample editor command

rm space

minor fixes

Roam: Bug fix - Insert Discourse Node after creation (#154)

* remove focus after menu select to allow updateBlock to work

* add clarifying comment

[ENG-308] Add command to open DG settings (#158)

* add command to open DG settings

* edit comment

ENG-322 - Switch from MIT to Apache 2.0 license (#156)

* Switch from MIT to Apache 2.0 license

* copyright discourse graphs

* rm liscense from apps/roam

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

initial port

[ENG-207] Move Github sync setting to individual nodes (#124)

* current progress

* improve in UI: if sync is turned off then also turn off the comments configuration

* address PR comments

* revert graphOverviewUid bug

* revert graphOverviewUid bug - getDiscourseNodes

* avoid racing conditions for github sync

* nested settings

* temp fix to race condition

* remove unecessary DOM and match existing styles

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.

Refactor Export components to use getSetting for consistent settings retrieval

- Updated ExportDialog and ExportGithub components to replace localStorageGet with getSetting for fetching GitHub OAuth and repository settings.
- Modified extensionSettings utility functions to use arrow functions and provide a default value for getSetting.
- Improved code readability and maintainability by standardizing the method of accessing settings.

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.
mdroidian pushed a commit that referenced this pull request Jun 9, 2025
author Trang Doan <44855874+trangdoan982@users.noreply.github.com> 1744314525 -0400
committer Michael Gartner <mclicks@gmail.com> 1747354088 -0600

ENG-96 Create new relationship between nodes (#115)

* instantiate new relationship worked

* fix

* address PR comments

* fix bi-directional update issues

* show only compatible node type options

* small fix

* breakdown the components. use datacore

* working

* address PR comments

* improve search by only allowing compatible node results

* .

* rm dataview

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Move llm-api endpoints to vercel serverless (#102)

* testing gemini

* move endgoint to website

* open ai endpoint

* added anthropic endpoint

* pass env vars

* add cors handdling and options

* .

* using centralised cors middleware

* only adding bypass cookie

* use right key

* remove the bypass token requirement

* sanitize, fix routes

* remove server action config

* DRY

* remove unused

* address review

* adress review

Roam: Add feedback toggle (#118)

* add settings to hide or show button, also works when disabled or enabled midway

* review

* .

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

[ENG-197] Fix creating link with invalid chars (#121)

* fix creating link with invalid chars

* placeholder update

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam:  Add feedback button to settings menu - ENG-147 (#122)

* add button to bottom right, don't hide sdk css, tested

* remove intent not working
git

* remove ts-ignore and use a better type def

* remove styling

Update NodeConfig to use new UIDs for DiscourseNodeIndex and DiscourseNodeSpecification components (#126)

Roam: Add PostHog user identification for enhanced analytics tracking using user's roam UID as the unique identifier - ENG-177 (#123)

* add posthog identify

* remove username and email to keep it anonymus

* double userUid and best practice for js

Roam: Discourse Context Overlay - remove queue and arbitrary delay (#127)

* Refactor getOverlayInfo to use async/await and improve error handling. Update cache key from title to tag and remove overlayQueue logic for cleaner implementation.

* Remove experimental getOverlayInfo function

* Remove unused refreshUi logic

[ENG-44] Display relations (#116)

* instantiate new relationship worked

* add display relations

* remove dv

* sm fix

[ENG-198] Filtered out related file in search (#125)

* filtered out related file

* fix some naming

[ENG-97] Use TailwindCSS in obsidian app (#128)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

[ENG-192] Change all existing styles to using tw (#129)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam: Bug-fix: Don't let user create discourse nodes with empty text using node context menu - ENG-171 (#130)

* functional covering all three cases tested locally

* apply coderabbit review suggestion

* better approach one that I understand and can reason about

* accidental removal of onClose

Update Roam app version to 0.13.0 in package.json and package-lock.json (#134)

[ENG-204] Move from localStorage to extensionAPI.settings (#133)

* cur progress

* address PR comments

* kinda works. need to test more

* small fix

* address PR comments

.

Create publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Enhance DiscourseContextOverlay: Update button styles to include loading state and improve score/ref display during loading. Use placeholders for score and refs when loading. (#136)

.

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Refactor ExportDialog: Remove discourseGraphEnabled state and simplify FormGroup visibility logic. Set includeDiscourseContext to false by default. (#139)

Enhance LabelDialog: Add confirmText to return object for improved button text handling based on action type. (#141)

Additional styles / cursor rules (#142)

* Update STYLE_GUIDE.md and main.mdc: Add guideline for utilizing utility functions for reusable logic and common operations.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer arrow functions over regular function declarations.

* Update main.mdc: Add guideline to prefer Tailwind classes when refactoring inline styles.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer early returns over nested conditionals for improved readability.

Roam: When a user deletes a node also delete all the corresponding relations to the node - ENG-26 (#149)

* ask user for confirmation, delete corresponding relations

* address review

* address review

* address comments

[ENG-301] Create node in right-click menu (#152)

* create node in right-click menu

* small fix

* address PR comments

* address PR comments

add readme and remove sample commands

remove sample editor command

rm space

minor fixes

Roam: Bug fix - Insert Discourse Node after creation (#154)

* remove focus after menu select to allow updateBlock to work

* add clarifying comment

[ENG-308] Add command to open DG settings (#158)

* add command to open DG settings

* edit comment

ENG-322 - Switch from MIT to Apache 2.0 license (#156)

* Switch from MIT to Apache 2.0 license

* copyright discourse graphs

* rm liscense from apps/roam

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

initial port

[ENG-207] Move Github sync setting to individual nodes (#124)

* current progress

* improve in UI: if sync is turned off then also turn off the comments configuration

* address PR comments

* revert graphOverviewUid bug

* revert graphOverviewUid bug - getDiscourseNodes

* avoid racing conditions for github sync

* nested settings

* temp fix to race condition

* remove unecessary DOM and match existing styles

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.

Refactor Export components to use getSetting for consistent settings retrieval

- Updated ExportDialog and ExportGithub components to replace localStorageGet with getSetting for fetching GitHub OAuth and repository settings.
- Modified extensionSettings utility functions to use arrow functions and provide a default value for getSetting.
- Improved code readability and maintainability by standardizing the method of accessing settings.

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.
mdroidian pushed a commit that referenced this pull request Jun 14, 2025
author Trang Doan <44855874+trangdoan982@users.noreply.github.com> 1744314525 -0400
committer Michael Gartner <mclicks@gmail.com> 1747354088 -0600

ENG-96 Create new relationship between nodes (#115)

* instantiate new relationship worked

* fix

* address PR comments

* fix bi-directional update issues

* show only compatible node type options

* small fix

* breakdown the components. use datacore

* working

* address PR comments

* improve search by only allowing compatible node results

* .

* rm dataview

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Move llm-api endpoints to vercel serverless (#102)

* testing gemini

* move endgoint to website

* open ai endpoint

* added anthropic endpoint

* pass env vars

* add cors handdling and options

* .

* using centralised cors middleware

* only adding bypass cookie

* use right key

* remove the bypass token requirement

* sanitize, fix routes

* remove server action config

* DRY

* remove unused

* address review

* adress review

Roam: Add feedback toggle (#118)

* add settings to hide or show button, also works when disabled or enabled midway

* review

* .

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

[ENG-197] Fix creating link with invalid chars (#121)

* fix creating link with invalid chars

* placeholder update

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam:  Add feedback button to settings menu - ENG-147 (#122)

* add button to bottom right, don't hide sdk css, tested

* remove intent not working
git

* remove ts-ignore and use a better type def

* remove styling

Update NodeConfig to use new UIDs for DiscourseNodeIndex and DiscourseNodeSpecification components (#126)

Roam: Add PostHog user identification for enhanced analytics tracking using user's roam UID as the unique identifier - ENG-177 (#123)

* add posthog identify

* remove username and email to keep it anonymus

* double userUid and best practice for js

Roam: Discourse Context Overlay - remove queue and arbitrary delay (#127)

* Refactor getOverlayInfo to use async/await and improve error handling. Update cache key from title to tag and remove overlayQueue logic for cleaner implementation.

* Remove experimental getOverlayInfo function

* Remove unused refreshUi logic

[ENG-44] Display relations (#116)

* instantiate new relationship worked

* add display relations

* remove dv

* sm fix

[ENG-198] Filtered out related file in search (#125)

* filtered out related file

* fix some naming

[ENG-97] Use TailwindCSS in obsidian app (#128)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

[ENG-192] Change all existing styles to using tw (#129)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam: Bug-fix: Don't let user create discourse nodes with empty text using node context menu - ENG-171 (#130)

* functional covering all three cases tested locally

* apply coderabbit review suggestion

* better approach one that I understand and can reason about

* accidental removal of onClose

Update Roam app version to 0.13.0 in package.json and package-lock.json (#134)

[ENG-204] Move from localStorage to extensionAPI.settings (#133)

* cur progress

* address PR comments

* kinda works. need to test more

* small fix

* address PR comments

.

Create publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Enhance DiscourseContextOverlay: Update button styles to include loading state and improve score/ref display during loading. Use placeholders for score and refs when loading. (#136)

.

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Refactor ExportDialog: Remove discourseGraphEnabled state and simplify FormGroup visibility logic. Set includeDiscourseContext to false by default. (#139)

Enhance LabelDialog: Add confirmText to return object for improved button text handling based on action type. (#141)

Additional styles / cursor rules (#142)

* Update STYLE_GUIDE.md and main.mdc: Add guideline for utilizing utility functions for reusable logic and common operations.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer arrow functions over regular function declarations.

* Update main.mdc: Add guideline to prefer Tailwind classes when refactoring inline styles.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer early returns over nested conditionals for improved readability.

Roam: When a user deletes a node also delete all the corresponding relations to the node - ENG-26 (#149)

* ask user for confirmation, delete corresponding relations

* address review

* address review

* address comments

[ENG-301] Create node in right-click menu (#152)

* create node in right-click menu

* small fix

* address PR comments

* address PR comments

add readme and remove sample commands

remove sample editor command

rm space

minor fixes

Roam: Bug fix - Insert Discourse Node after creation (#154)

* remove focus after menu select to allow updateBlock to work

* add clarifying comment

[ENG-308] Add command to open DG settings (#158)

* add command to open DG settings

* edit comment

ENG-322 - Switch from MIT to Apache 2.0 license (#156)

* Switch from MIT to Apache 2.0 license

* copyright discourse graphs

* rm liscense from apps/roam

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

initial port

[ENG-207] Move Github sync setting to individual nodes (#124)

* current progress

* improve in UI: if sync is turned off then also turn off the comments configuration

* address PR comments

* revert graphOverviewUid bug

* revert graphOverviewUid bug - getDiscourseNodes

* avoid racing conditions for github sync

* nested settings

* temp fix to race condition

* remove unecessary DOM and match existing styles

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.

Refactor Export components to use getSetting for consistent settings retrieval

- Updated ExportDialog and ExportGithub components to replace localStorageGet with getSetting for fetching GitHub OAuth and repository settings.
- Modified extensionSettings utility functions to use arrow functions and provide a default value for getSetting.
- Improved code readability and maintainability by standardizing the method of accessing settings.

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.
mdroidian pushed a commit that referenced this pull request Jun 16, 2025
author Trang Doan <44855874+trangdoan982@users.noreply.github.com> 1744314525 -0400
committer Michael Gartner <mclicks@gmail.com> 1747354088 -0600

ENG-96 Create new relationship between nodes (#115)

* instantiate new relationship worked

* fix

* address PR comments

* fix bi-directional update issues

* show only compatible node type options

* small fix

* breakdown the components. use datacore

* working

* address PR comments

* improve search by only allowing compatible node results

* .

* rm dataview

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Move llm-api endpoints to vercel serverless (#102)

* testing gemini

* move endgoint to website

* open ai endpoint

* added anthropic endpoint

* pass env vars

* add cors handdling and options

* .

* using centralised cors middleware

* only adding bypass cookie

* use right key

* remove the bypass token requirement

* sanitize, fix routes

* remove server action config

* DRY

* remove unused

* address review

* adress review

Roam: Add feedback toggle (#118)

* add settings to hide or show button, also works when disabled or enabled midway

* review

* .

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

[ENG-197] Fix creating link with invalid chars (#121)

* fix creating link with invalid chars

* placeholder update

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam:  Add feedback button to settings menu - ENG-147 (#122)

* add button to bottom right, don't hide sdk css, tested

* remove intent not working
git

* remove ts-ignore and use a better type def

* remove styling

Update NodeConfig to use new UIDs for DiscourseNodeIndex and DiscourseNodeSpecification components (#126)

Roam: Add PostHog user identification for enhanced analytics tracking using user's roam UID as the unique identifier - ENG-177 (#123)

* add posthog identify

* remove username and email to keep it anonymus

* double userUid and best practice for js

Roam: Discourse Context Overlay - remove queue and arbitrary delay (#127)

* Refactor getOverlayInfo to use async/await and improve error handling. Update cache key from title to tag and remove overlayQueue logic for cleaner implementation.

* Remove experimental getOverlayInfo function

* Remove unused refreshUi logic

[ENG-44] Display relations (#116)

* instantiate new relationship worked

* add display relations

* remove dv

* sm fix

[ENG-198] Filtered out related file in search (#125)

* filtered out related file

* fix some naming

[ENG-97] Use TailwindCSS in obsidian app (#128)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

[ENG-192] Change all existing styles to using tw (#129)

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

* Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support

- Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies
- Configured styles.css to include Tailwind directives
- Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer

* delete irrelevant package

* changing all styles to tailwindcss

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Roam: Bug-fix: Don't let user create discourse nodes with empty text using node context menu - ENG-171 (#130)

* functional covering all three cases tested locally

* apply coderabbit review suggestion

* better approach one that I understand and can reason about

* accidental removal of onClose

Update Roam app version to 0.13.0 in package.json and package-lock.json (#134)

[ENG-204] Move from localStorage to extensionAPI.settings (#133)

* cur progress

* address PR comments

* kinda works. need to test more

* small fix

* address PR comments

.

Create publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Enhance DiscourseContextOverlay: Update button styles to include loading state and improve score/ref display during loading. Use placeholders for score and refs when loading. (#136)

.

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Update publish-obsidian.yml

Refactor ExportDialog: Remove discourseGraphEnabled state and simplify FormGroup visibility logic. Set includeDiscourseContext to false by default. (#139)

Enhance LabelDialog: Add confirmText to return object for improved button text handling based on action type. (#141)

Additional styles / cursor rules (#142)

* Update STYLE_GUIDE.md and main.mdc: Add guideline for utilizing utility functions for reusable logic and common operations.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer arrow functions over regular function declarations.

* Update main.mdc: Add guideline to prefer Tailwind classes when refactoring inline styles.

* Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer early returns over nested conditionals for improved readability.

Roam: When a user deletes a node also delete all the corresponding relations to the node - ENG-26 (#149)

* ask user for confirmation, delete corresponding relations

* address review

* address review

* address comments

[ENG-301] Create node in right-click menu (#152)

* create node in right-click menu

* small fix

* address PR comments

* address PR comments

add readme and remove sample commands

remove sample editor command

rm space

minor fixes

Roam: Bug fix - Insert Discourse Node after creation (#154)

* remove focus after menu select to allow updateBlock to work

* add clarifying comment

[ENG-308] Add command to open DG settings (#158)

* add command to open DG settings

* edit comment

ENG-322 - Switch from MIT to Apache 2.0 license (#156)

* Switch from MIT to Apache 2.0 license

* copyright discourse graphs

* rm liscense from apps/roam

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

initial port

[ENG-207] Move Github sync setting to individual nodes (#124)

* current progress

* improve in UI: if sync is turned off then also turn off the comments configuration

* address PR comments

* revert graphOverviewUid bug

* revert graphOverviewUid bug - getDiscourseNodes

* avoid racing conditions for github sync

* nested settings

* temp fix to race condition

* remove unecessary DOM and match existing styles

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.

Refactor Export components to use getSetting for consistent settings retrieval

- Updated ExportDialog and ExportGithub components to replace localStorageGet with getSetting for fetching GitHub OAuth and repository settings.
- Modified extensionSettings utility functions to use arrow functions and provide a default value for getSetting.
- Improved code readability and maintainability by standardizing the method of accessing settings.

Eng 286 show when GitHub sync is disabled globally (#143)

* Refactor GitHub Sync settings in NodeConfig and GeneralSettings components

- Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree.
- Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration.
- Passed setMainTab prop to NodeConfig for better navigation control.

This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled.

* matchingNode fix

.
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