Skip to content

ENG-1274: Migrate feature flags#684

Closed
sid597 wants to merge 6 commits intographite-base/684from
eng-1274-add-feature-flags-in-settings
Closed

ENG-1274: Migrate feature flags#684
sid597 wants to merge 6 commits intographite-base/684from
eng-1274-add-feature-flags-in-settings

Conversation

@sid597
Copy link
Collaborator

@sid597 sid597 commented Jan 11, 2026

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

new checkbox component for feature flag get and set in props, migrate to block prop based settings

use getFeatureFlag()

rerender left sidebar on enable/disable


Open with Devin

@linear
Copy link

linear bot commented Jan 11, 2026

@supabase
Copy link

supabase bot commented Jan 11, 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 sid597 changed the title new checkbox component for feature flag get and set in props, migrate to block prop based settings ENG-1274: Migrate feature flags Jan 11, 2026
@sid597 sid597 marked this pull request as ready for review January 11, 2026 19:08
@sid597 sid597 force-pushed the eng-1188-create-a-pull-watch-handler-on-the-settings-page-per-feature-prod branch from f11b47f to 10445e6 Compare January 11, 2026 19:54
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from ea615c9 to 95e291a Compare January 11, 2026 19:54
@sid597 sid597 changed the base branch from eng-1188-create-a-pull-watch-handler-on-the-settings-page-per-feature-prod to graphite-base/684 January 12, 2026 15:26
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from 29817b9 to 9cd0a2c Compare January 12, 2026 15:26
@sid597 sid597 force-pushed the graphite-base/684 branch from 10445e6 to 0fb7fc7 Compare January 12, 2026 15:26
@sid597 sid597 changed the base branch from graphite-base/684 to eng-1190-replace-existing-roam-js-components-with-blockprop-based January 12, 2026 15:26
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from db18fd8 to 23cedec Compare January 17, 2026 18:16
@sid597 sid597 force-pushed the eng-1190-replace-existing-roam-js-components-with-blockprop-based branch from 0fb7fc7 to 62b0359 Compare January 17, 2026 18:16
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from 23cedec to 496a3ba Compare January 18, 2026 05:25
@sid597 sid597 force-pushed the eng-1190-replace-existing-roam-js-components-with-blockprop-based branch from 62b0359 to 40379a1 Compare January 18, 2026 05:25
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from 496a3ba to 0238148 Compare January 19, 2026 04:51
@sid597 sid597 force-pushed the eng-1190-replace-existing-roam-js-components-with-blockprop-based branch from 40379a1 to ac5f761 Compare January 19, 2026 04:51
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from 0238148 to 8dbd24c Compare January 19, 2026 05:01
@sid597 sid597 force-pushed the eng-1190-replace-existing-roam-js-components-with-blockprop-based branch from a671592 to 6e0130f Compare January 20, 2026 16:06
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from 77d1c95 to 0d233ba Compare January 20, 2026 16:06
@sid597 sid597 changed the base branch from eng-1190-replace-existing-roam-js-components-with-blockprop-based to graphite-base/684 January 26, 2026 07:01
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from 0d233ba to cf49c4c Compare January 28, 2026 20:34
@sid597 sid597 force-pushed the graphite-base/684 branch from 6e0130f to 050f93b Compare January 28, 2026 20:34
@sid597 sid597 changed the base branch from graphite-base/684 to eng-1190-replace-existing-roam-js-components-with-blockprop-based January 28, 2026 20:34
Copy link

@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 8 additional flags.

Open in Devin Review

@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from cf49c4c to 122fce8 Compare January 28, 2026 20:55
@sid597 sid597 requested a review from mdroidian January 28, 2026 20:56
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 was under the assumption that we were going to run both the legacy settings and new blockProps at the same time while the migration was happening. It looks like this PR is just migrating to the blockProps. When is the migration supposed to take place? How are we going to test it?

Also, please make sure to save all files with prettier before requesting review.

key: keyof FeatureFlags,
value: boolean,
): void => {
window.dispatchEvent(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a pullWatch and a dispatchEvent? Why don't we go directly to the dispatchEvent and skip the pullWatch? I'm worried that we are adding additional infrastruction that is unnecessary.

editor.updateShapes([{ id: arrow.id, type: target.type }]);
}
if (getSetting<boolean>(USE_REIFIED_RELATIONS, false)) {
if (getFeatureFlag("Reified Relation Triples")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this is only calling blockProp based settings? I was under the assumption that we were going to run both at the same time while the migration was happening.

// "Suggestive Mode Enabled": (newValue) => { ... },
// "Reified Relation Triples": (newValue) => { ... },
// eslint-disable-next-line @typescript-eslint/naming-convention
"Enable Left Sidebar": (newValue) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We've discussed the naming before, should be sentence case. #664 (review)

onCancel={() => setIsInstructionOpen(false)}
confirmButtonText="Reload Graph"
cancelButtonText="Later"
confirmButtonText="Got it"
Copy link
Contributor

Choose a reason for hiding this comment

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

"Ok"

@sid597 sid597 changed the base branch from eng-1190-replace-existing-roam-js-components-with-blockprop-based to graphite-base/684 February 3, 2026 16:51
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from 122fce8 to fcfa83f Compare February 3, 2026 18:56
@sid597 sid597 force-pushed the graphite-base/684 branch from 050f93b to c022156 Compare February 3, 2026 18:56
@sid597 sid597 changed the base branch from graphite-base/684 to eng-1345-modify-existing-roamjs-component-onchange-to-also-change February 3, 2026 18:57
@sid597 sid597 changed the base branch from eng-1345-modify-existing-roamjs-component-onchange-to-also-change to graphite-base/684 February 4, 2026 17:17
@sid597 sid597 force-pushed the graphite-base/684 branch from c022156 to cf56730 Compare February 4, 2026 17:56
@sid597 sid597 force-pushed the eng-1274-add-feature-flags-in-settings branch from fcfa83f to 1adcb4e Compare February 4, 2026 17:56
@sid597 sid597 changed the base branch from graphite-base/684 to eng-1345-modify-existing-roamjs-component-onchange-to-also-change February 4, 2026 17:57
Copy link

@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 found 1 new potential issue.

View issue and 12 additional flags in Devin Review.

Open in Devin Review

Comment on lines 252 to 253
return createCleanupFn(watches);
};

Choose a reason for hiding this comment

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

🔴 Pull watchers for feature flags are never initialized

The setupPullWatchOnSettingsPage function is defined in pullWatchers.ts but is never called anywhere in the codebase. This means the feature flag change handlers will never be triggered.

Click to expand

Impact

When users toggle feature flags via the FeatureFlagPanel component:

  1. setFeatureFlag is called (accessors.ts:277-286)
  2. The block props are updated in Roam
  3. But the pull watcher that should detect this change and call the handlers is never set up
  4. emitFeatureFlagChange is never called
  5. React components using useFeatureFlag hook won't re-render
  6. Side effects like remountLeftSidebar(), unmountLeftSidebar(), initializeSupabaseSync(), and setSyncActivity() will never execute

Actual vs Expected

Actual: The feature flag handlers in pullWatchers.ts:96-121 are defined but never invoked because setupPullWatchOnSettingsPage is never called.

Expected: setupPullWatchOnSettingsPage should be called during plugin initialization (e.g., in index.ts) to set up the pull watchers that trigger the handlers when feature flags change.

Evidence

Searching the codebase shows setupPullWatchOnSettingsPage is only exported, never imported or called:

apps/roam/src/components/settings/utils/pullWatchers.ts:export const setupPullWatchOnSettingsPage = (

(Refers to lines 184-253)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@sid597 sid597 changed the base branch from eng-1345-modify-existing-roamjs-component-onchange-to-also-change to graphite-base/684 February 4, 2026 18:05
@sid597
Copy link
Collaborator Author

sid597 commented Feb 7, 2026

Closing because too many changes that we don't want to merge in main at this point

@sid597 sid597 closed this Feb 7, 2026
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