File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import deleteBlock from "roamjs-components/writes/deleteBlock";
3939import { USE_REIFIED_RELATIONS } from "~/data/userSettings" ;
4040import posthog from "posthog-js" ;
4141import { setFeatureFlag } from "~/components/settings/utils/accessors" ;
42+ import { FeatureFlagPanel } from "./components/BlockPropSettingPanels" ;
4243
4344const NodeRow = ( { node } : { node : PConceptFull } ) => {
4445 return (
@@ -467,6 +468,12 @@ const FeatureFlagsTab = (): React.ReactElement => {
467468 }
468469 />
469470
471+ < FeatureFlagPanel
472+ title = "Enable dual read"
473+ description = "When enabled, accessor getters read from block props instead of the old system. Surfaces dual-write gaps during development."
474+ featureKey = "Enable dual read"
475+ />
476+
470477 < Button
471478 className = "w-96"
472479 icon = "send-message"
Original file line number Diff line number Diff line change @@ -90,10 +90,13 @@ export const featureFlagHandlers: Partial<
9090 ( newValue : boolean , oldValue : boolean , allFlags : FeatureFlags ) => void
9191 >
9292> = {
93- // Add handlers as needed:
94- // "Enable Left Sidebar": (newValue) => { ... },
95- // "Suggestive Mode Enabled": (newValue) => { ... },
96- // "Reified Relation Triples": (newValue) => { ... },
93+ /* eslint-disable @typescript-eslint/naming-convention */
94+ "Enable dual read" : ( newValue , oldValue ) => {
95+ console . log (
96+ `[DG] Enable dual read: ${ String ( oldValue ) } → ${ String ( newValue ) } ` ,
97+ ) ;
98+ } ,
99+ /* eslint-enable @typescript-eslint/naming-convention */
97100} ;
98101
99102type GlobalSettingsHandlers = {
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ export const FeatureFlagsSchema = z.object({
151151 "Enable left sidebar" : z . boolean ( ) . default ( false ) ,
152152 "Suggestive mode enabled" : z . boolean ( ) . default ( false ) ,
153153 "Reified relation triples" : z . boolean ( ) . default ( false ) ,
154+ "Enable dual read" : z . boolean ( ) . default ( false ) ,
154155} ) ;
155156
156157export const ExportSettingsSchema = z . object ( {
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ import {
4242 DISALLOW_DIAGNOSTICS ,
4343} from "./data/userSettings" ;
4444import { initSchema } from "./components/settings/utils/init" ;
45+ import { setupPullWatchOnSettingsPage } from "./components/settings/utils/pullWatchers" ;
4546export const DEFAULT_CANVAS_PAGE_FORMAT = "Canvas/*" ;
4647
4748export default runExtension ( async ( onloadArgs ) => {
@@ -154,7 +155,8 @@ export default runExtension(async (onloadArgs) => {
154155 } ) ;
155156 }
156157
157- await initSchema ( ) ;
158+ const { blockUids } = await initSchema ( ) ;
159+ const cleanupPullWatchers = setupPullWatchOnSettingsPage ( blockUids ) ;
158160
159161 return {
160162 elements : [
@@ -166,6 +168,7 @@ export default runExtension(async (onloadArgs) => {
166168 ] ,
167169 observers : observers ,
168170 unload : ( ) => {
171+ cleanupPullWatchers ( ) ;
169172 setSyncActivity ( false ) ;
170173 window . roamjs . extension ?. smartblocks ?. unregisterCommand ( "QUERYBUILDER" ) ;
171174 // @ts -expect-error - tldraw throws a warning on multiple loads
You can’t perform that action at this time.
0 commit comments