Skip to content

ENG-1484: reactive settings for triggers and suggestive mode overlay#861

Merged
sid597 merged 9 commits intomigration-block-init-staging-branchfrom
eng-1484-reactive-settings-some-settings-require-reloading-the-graph
Mar 13, 2026
Merged

ENG-1484: reactive settings for triggers and suggestive mode overlay#861
sid597 merged 9 commits intomigration-block-init-staging-branchfrom
eng-1484-reactive-settings-some-settings-require-reloading-the-graph

Conversation

@sid597
Copy link
Collaborator

@sid597 sid597 commented Mar 5, 2026

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


Open with Devin

Summary by CodeRabbit

  • New Features

    • New dynamic settings: global trigger, personal node menu trigger, node search trigger, and suggestive-mode overlay; settings update live without reloading.
  • UI

    • Admin settings tab for Suggestive mode now reacts to changes.
    • Shortened, clearer descriptions for personal/node search trigger settings.
    • Suggestive-mode enablement no longer forces a page reload.
  • Bug Fixes

    • Improved cleanup/removal of suggestive overlays to avoid leftover UI artifacts.

@linear
Copy link

linear bot commented Mar 5, 2026

@supabase
Copy link

supabase bot commented Mar 5, 2026

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 ↗︎.

@sid597
Copy link
Collaborator Author

sid597 commented Mar 5, 2026

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

✅ Actions performed

Full review triggered.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

Adds new setting keys and handlers for global/personal triggers and suggestive overlays, wires them into observer initialization with dynamic listeners and cleanup functions, updates AdminPanel to react to suggestive-mode changes, and generalizes overlay removal logic for suggestive overlays.

Changes

Cohort / File(s) Summary
Settings emitter & watchers
apps/roam/src/components/settings/utils/settingsEmitter.ts, apps/roam/src/components/settings/utils/pullWatchers.ts
Added new settingKeys: globalTrigger, personalNodeMenuTrigger, nodeSearchMenuTrigger, personalSuggestiveModeOverlay. Added corresponding pull-watcher handlers that call emitSettingChange for each new key.
Observer initialization & cleanup
apps/roam/src/utils/initializeObserversAndListeners.ts, apps/roam/src/index.ts
initObservers now returns cleanups array; added onSettingChange wiring to update mutable trigger/overlay bindings at runtime and registered unsubscribers into cleanups; entry point destructures and invokes cleanups on unload.
Overlay handling
apps/roam/src/utils/pageRefObserverHandlers.ts
Refactored overlay removal into removeOverlayElements helper; added removeSuggestiveOverlaysFromExistingPageRefs and integrated suggestive-overlay cleanup into deactivation flow.
UI: Admin & Personal settings
apps/roam/src/components/settings/AdminPanel.tsx, apps/roam/src/components/settings/HomePersonalSettings.tsx
AdminPanel now subscribes to settingKeys.suggestiveModeEnabled via onSettingChange and uses reactive state to show the tab; HomePersonalSettings text descriptions shortened.

Sequence Diagram(s)

sequenceDiagram
    participant Admin as AdminPanel UI
    participant Settings as Settings System
    participant Init as initObservers
    participant PageRef as PageRef Observers
    participant Cleanup as Unsubscribe/Cleanup

    Admin->>Settings: user toggles feature flag / updates setting
    Settings->>Init: onSettingChange callback invoked
    Init->>Init: update mutable bindings (globalTrigger, personalNodeMenuTrigger, nodeSearchMenuTrigger, suggestiveOverlay)
    Init->>PageRef: adjust handlers or toggle overlay state
    PageRef->>PageRef: add/remove overlays based on current bindings

    Note over Cleanup: On unload
    Cleanup->>Init: invoke collected cleanup functions
    Init->>Settings: unregister onSettingChange listeners
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main objective of the PR: making settings for triggers and suggestive mode overlay reactive rather than static.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@sid597 sid597 requested a review from mdroidian March 6, 2026 10:51
@mdroidian
Copy link
Contributor

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

✅ Actions performed

Full review triggered.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@sid597 sid597 changed the base branch from eng-1478-port-both-global-and-personal-left-sidebar-to-dual-readers-v2 to migration-block-init-staging-branch March 9, 2026 06: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 small changes, but send it back my way when they are done, it should be approved quickly.

devin-ai-integration[bot]

This comment was marked as resolved.

@sid597 sid597 requested a review from mdroidian March 11, 2026 11:22
…nch' into eng-1484-reactive-settings-some-settings-require-reloading-the-graph

# Conflicts:
#	apps/roam/src/index.ts
#	apps/roam/src/utils/initializeObserversAndListeners.ts
@sid597 sid597 merged commit 4877527 into migration-block-init-staging-branch Mar 13, 2026
8 checks passed
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.

2 participants