Skip to content

Conversation

@sid597
Copy link
Collaborator

@sid597 sid597 commented Dec 6, 2025

image

Summary by CodeRabbit

  • New Features

    • Added Suggestive Mode configuration UI in AdminPanel with a dedicated settings tab.
  • Revert

    • Removed Suggestive Mode option from GeneralSettings, HomePersonalSettings, and SettingsDialog.

✏️ Tip: You can customize this high-level summary in your review settings.

@linear
Copy link

linear bot commented Dec 6, 2025

@supabase
Copy link

supabase bot commented Dec 6, 2025

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Collaborator Author

sid597 commented Dec 6, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sid597 sid597 changed the title add suggestive mode to admin panel ENG-1112: add suggestive mode flag and settings to admin panel Dec 6, 2025
@sid597 sid597 marked this pull request as ready for review December 6, 2025 18:40
Copy link
Collaborator Author

sid597 commented Dec 6, 2025

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

📝 Walkthrough

Walkthrough

This PR consolidates Suggestive Mode UI configuration into AdminPanel by adding it as a new tab with memoized config retrieval, while removing the Suggestive Mode UI panels from GeneralSettings, HomePersonalSettings, and Settings components.

Changes

Cohort / File(s) Summary
AdminPanel UI Enhancement
apps/roam/src/components/settings/AdminPanel.tsx
Adds Suggestive Mode tab to AdminPanel with memoized config tree formatting; imports useMemo, FlagPanel, SuggestiveModeSettings, getFormattedConfigTree, and refreshConfigTree
Suggestive Mode UI Removal
apps/roam/src/components/settings/GeneralSettings.tsx, apps/roam/src/components/settings/HomePersonalSettings.tsx, apps/roam/src/components/settings/Settings.tsx
Removes Suggestive Mode FlagPanel and tabs from GeneralSettings and Settings; comments out Suggestive Mode Overlay Checkbox in HomePersonalSettings; removes SuggestiveModeSettings import from Settings

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify memoization logic in AdminPanel correctly retrieves and formats config tree
  • Confirm all Suggestive Mode UI removals don't break external references or cause orphaned imports
  • Ensure AdminPanel's new FlagPanel receives correct uid, parentUid, and value properties from refreshed config

Possibly related PRs

  • #532: Directly modifies AdminPanel.tsx for component UI and imports
  • #514: Modifies SuggestiveModeSettings component implementation
  • #104: Changes getFormattedConfigTree function that is now memoized in AdminPanel

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title is only partially related to the changeset. It claims to 'add suggestive mode flag and settings to admin panel,' but the changes also include removing suggestive mode from other settings areas (GeneralSettings, HomePersonalSettings, Settings.tsx), which is the primary objective of the PR. Consider revising the title to reflect the full scope: 'Move suggestive mode flag behind admin panel' or similar, since removing it from general settings is the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 0

🧹 Nitpick comments (1)
apps/roam/src/components/settings/AdminPanel.tsx (1)

333-337: Config-driven Suggestive Mode FlagPanel wiring looks correct; consider small ergonomics tweaks

Deriving settings via refreshConfigTree() + getFormattedConfigTree() and feeding settings.suggestiveModeEnabled into FlagPanel is a good fit for using the Roam config page as the single source of truth. This should keep the admin UI in sync with the underlying config bullets.

Two small, optional follow-ups:

  • If refreshConfigTree ever becomes asynchronous or more expensive, consider moving this into useEffect plus a useState-backed settings value instead of doing a side effect inside useMemo.
  • You could use value={settings.suggestiveModeEnabled.value ?? false} to be explicit about treating undefined as the only “fallback-to-false” case.

Please double-check refreshConfigTree’s implementation to ensure it is safe to call synchronously on render and that it doesn’t rely on side effects that must be awaited before reading from configTreeRef.

Also applies to: 340-347

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79af2b7 and 1963c10.

📒 Files selected for processing (4)
  • apps/roam/src/components/settings/AdminPanel.tsx (4 hunks)
  • apps/roam/src/components/settings/GeneralSettings.tsx (0 hunks)
  • apps/roam/src/components/settings/HomePersonalSettings.tsx (2 hunks)
  • apps/roam/src/components/settings/Settings.tsx (0 hunks)
💤 Files with no reviewable changes (2)
  • apps/roam/src/components/settings/GeneralSettings.tsx
  • apps/roam/src/components/settings/Settings.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/main.mdc)

**/*.{ts,tsx}: Use Tailwind CSS for styling where possible
When refactoring inline styles, use tailwind classes
Prefer type over interface in TypeScript
Use explicit return types for functions
Avoid any types when possible
Prefer arrow functions over regular function declarations
Use named parameters (object destructuring) when a function has more than 2 parameters
Use PascalCase for components and types
Use camelCase for variables and functions
Use UPPERCASE for constants
Function names should describe their purpose clearly
Prefer early returns over nested conditionals for better readability

Files:

  • apps/roam/src/components/settings/AdminPanel.tsx
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
apps/roam/**/*.{js,ts,tsx,jsx,json}

📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)

Prefer existing dependencies from package.json when working on the Roam Research extension

Files:

  • apps/roam/src/components/settings/AdminPanel.tsx
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
apps/roam/**/*.{ts,tsx,jsx,js,css,scss}

📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)

Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension

Files:

  • apps/roam/src/components/settings/AdminPanel.tsx
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
apps/roam/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)

apps/roam/**/*.{ts,tsx,js,jsx}: Use the roamAlphaApi docs from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj when implementing Roam functionality
Use Roam Depot/Extension API docs from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU when implementing extension functionality

Files:

  • apps/roam/src/components/settings/AdminPanel.tsx
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
apps/roam/**

📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)

Implement the Discourse Graph protocol in the Roam Research extension

Files:

  • apps/roam/src/components/settings/AdminPanel.tsx
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
🧠 Learnings (4)
📚 Learning: 2025-08-27T02:23:45.696Z
Learnt from: maparent
Repo: DiscourseGraphs/discourse-graph PR: 377
File: packages/ui/tsconfig.json:5-7
Timestamp: 2025-08-27T02:23:45.696Z
Learning: When reviewing TypeScript configuration changes, check if settings like "declaration" are inherited from base configs before suggesting to add them explicitly. Many monorepo packages extend base configurations that already include necessary compiler options.

Applied to files:

  • apps/roam/src/components/settings/AdminPanel.tsx
📚 Learning: 2025-11-25T00:52:41.934Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-11-25T00:52:41.934Z
Learning: Applies to apps/roam/**/*.{ts,tsx,jsx,js,css,scss} : Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension

Applied to files:

  • apps/roam/src/components/settings/AdminPanel.tsx
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
📚 Learning: 2025-06-19T19:43:43.380Z
Learnt from: sid597
Repo: DiscourseGraphs/discourse-graph PR: 226
File: apps/roam/src/components/settings/HomePersonalSettings.tsx:123-149
Timestamp: 2025-06-19T19:43:43.380Z
Learning: The "Fetch Embeddings for nodes" button in HomePersonalSettings.tsx is for testing purposes only, so it doesn't require production-level error handling or user feedback improvements.

Applied to files:

  • apps/roam/src/components/settings/HomePersonalSettings.tsx
📚 Learning: 2025-11-25T00:52:41.934Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-11-25T00:52:41.934Z
Learning: Applies to apps/roam/**/*.{ts,tsx,js,jsx} : Use the roamAlphaApi docs from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj when implementing Roam functionality

Applied to files:

  • apps/roam/src/components/settings/HomePersonalSettings.tsx
🧬 Code graph analysis (1)
apps/roam/src/components/settings/AdminPanel.tsx (1)
apps/roam/src/utils/discourseConfigRef.ts (1)
  • getFormattedConfigTree (51-86)
🔇 Additional comments (3)
apps/roam/src/components/settings/HomePersonalSettings.tsx (1)

83-110: Commented-out Suggestive Mode Overlay control matches the new admin-only flow

Wrapping this Checkbox in a JSX block comment cleanly hides the per-user Suggestive Mode overlay toggle while preserving the implementation and adding a clear TODO for reintroduction later. No functional or structural issues here.

apps/roam/src/components/settings/AdminPanel.tsx (2)

1-2: New Suggestive Mode imports are consistent and fully utilized

All five imports—useMemo, FlagPanel, SuggestiveModeSettings, getFormattedConfigTree, and refreshConfigTree—are present and actively used in the file. FlagPanel usage is consistent with patterns across the codebase (multiple components use it with the same title/description/value prop structure), and SuggestiveModeSettings is properly imported and rendered as a component at line 424.


420-425: New "Suggestive Mode" admin tab is wired correctly and properly isolated

The Tab component in AdminPanel.tsx correctly follows the existing Tabs pattern. Verification confirms that SuggestiveModeSettings is now exclusively imported and used in AdminPanel.tsx (lines 33, 424), with no competing references in Settings.tsx or other settings entry points. The refactoring successfully makes Suggestive Mode configuration admin-only. The overflow-y-auto class appropriately handles potentially tall content.

@sid597 sid597 requested a review from mdroidian December 6, 2025 18:47
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.

A few changes.

Also: the "suggestive mode" in the nodes tab should only show up if the suggestive mode flag is on.

Image


return (
<div className="flex flex-col gap-4 p-4">
<FlagPanel
Copy link
Contributor

Choose a reason for hiding this comment

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

There needs to be an explicit toast when this is turned on that notifies them that their data (nodes) will be sent to our servers and open ai servers

add confirmation that you are sending data to our server

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we need this now? I thought this will be enabled in pilots meetings with someone present from our side

Copy link
Contributor

Choose a reason for hiding this comment

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

It is possible for any user to inspect the code and access this. So yes, let's add it. It is a small effort and high reward and will be useful long term.

</div>
}
/>
<Tab
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only show up if the flag is on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants