Skip to content

ENG-1456: Migrate personal boolean flag consumers (getSetting → getPersonalSetting)#814

Merged
sid597 merged 2 commits intoeng-1472-refactor-blockpropsettingpanels-to-add-accessor-backedfrom
eng-1456-migrate-personal-boolean-flag-consumers-getsetting
Mar 2, 2026
Merged

ENG-1456: Migrate personal boolean flag consumers (getSetting → getPersonalSetting)#814
sid597 merged 2 commits intoeng-1472-refactor-blockpropsettingpanels-to-add-accessor-backedfrom
eng-1456-migrate-personal-boolean-flag-consumers-getsetting

Conversation

@sid597
Copy link
Copy Markdown
Collaborator

@sid597 sid597 commented Feb 22, 2026

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


Open with Devin

Summary by CodeRabbit

  • Refactor
    • Migrated all user-configurable settings from global application storage to per-user personal settings. Individual preferences for feedback visibility, canvas overlays, keyboard shortcuts, diagnostic tracking, sidebar behavior, query metadata display, and styling options are now preserved uniquely for each user rather than being shared globally.

@linear
Copy link
Copy Markdown

linear Bot commented Feb 22, 2026

@supabase
Copy link
Copy Markdown

supabase Bot commented Feb 22, 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
Copy Markdown
Collaborator Author

sid597 commented Feb 22, 2026

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 22, 2026

✅ Actions performed

Full review triggered.

devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

This PR migrates feature flag and preference retrievals from global extension settings (via getSetting) to personal per-user settings (via getPersonalSetting). The changes affect 12 files across components, utilities, and settings UI, establishing personal settings as the single source of truth for user preferences.

Changes

Cohort / File(s) Summary
Canvas & UI Components
apps/roam/src/components/DiscourseFloatingMenu.tsx, apps/roam/src/components/canvas/DiscourseNodeUtil.tsx, apps/roam/src/components/canvas/Tldraw.tsx, apps/roam/src/components/canvas/uiOverrides.tsx
Replaced runtime extension API setting checks with getPersonalSetting calls for feature toggles: feedback button visibility, overlay/canvas relations preferences, and discourse tool keyboard shortcut.
Settings UI Configuration
apps/roam/src/components/settings/HomePersonalSettings.tsx, apps/roam/src/components/settings/QuerySettings.tsx
Removed getSetting usage and initialValue props from PersonalFlagPanel components; initialization now relies on component defaults rather than explicit per-item defaults read from extension settings.
Settings Infrastructure
apps/roam/src/components/settings/utils/accessors.ts
Removed legacy default overrides map (PERSONAL_OLD_DEFAULT_OVERRIDES) and simplified getLegacyPersonalSetting to always read defaults from DEFAULT_PERSONAL_SETTINGS.
Core Utilities & Initialization
apps/roam/src/index.ts, apps/roam/src/utils/initializeObserversAndListeners.ts, apps/roam/src/utils/createDiscourseNode.ts
Replaced getSetting calls with getPersonalSetting for diagnostics, styling, overlay, and sidebar preferences; one location adds return statement to propagate creation promise in page action listener.
Error Handling & Analytics
apps/roam/src/utils/internalError.ts, apps/roam/src/utils/posthog.ts
Replaced getSetting with getPersonalSetting for "Disable product diagnostics" flag in error reporting and PostHog initialization flows.
Command Palette
apps/roam/src/utils/registerCommandPaletteCommands.ts
Updated toggle commands to read settings via getPersonalSetting, sync both extension and personal settings on update, and include error messages in toast notifications.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: migrating personal boolean flag consumers from getSetting to getPersonalSetting across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from 11a99fe to c635833 Compare February 23, 2026 10:40
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 63856a1 to 368b3f5 Compare February 23, 2026 10:40
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from c635833 to b1ace1a Compare February 23, 2026 13:51
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 368b3f5 to 5c11932 Compare February 23, 2026 13:51
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from b1ace1a to c90e2c8 Compare February 23, 2026 14:13
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 5c11932 to 4843dfb Compare February 23, 2026 14:13
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from c90e2c8 to 3b1643c Compare February 23, 2026 14:31
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 4843dfb to c18d483 Compare February 23, 2026 14:31
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from c18d483 to c10cb49 Compare February 23, 2026 14:35
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from 3b1643c to ee38a5f Compare February 23, 2026 14:35
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from c10cb49 to d48c767 Compare February 23, 2026 15:28
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from ee38a5f to c7c04c6 Compare February 23, 2026 15:28
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from d48c767 to 7995a91 Compare February 23, 2026 15:31
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from c7c04c6 to 2f2cf80 Compare February 23, 2026 15:31
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 7995a91 to 75d06ff Compare February 23, 2026 16:40
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from 080ebb1 to f1855a5 Compare February 23, 2026 17:53
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 75d06ff to 3e2cebd Compare February 23, 2026 17:53
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 3e2cebd to 4051fe3 Compare February 24, 2026 05:46
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch 2 times, most recently from 5af843f to dd836c8 Compare February 24, 2026 05:48
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 4051fe3 to 0c3862e Compare February 24, 2026 05:48
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from dd836c8 to 838709c Compare February 24, 2026 06:16
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 0c3862e to 56e9e66 Compare February 24, 2026 06:16
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from 838709c to bcc0697 Compare February 24, 2026 06:29
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 56e9e66 to d4bb8a1 Compare February 24, 2026 06:29
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from bcc0697 to 9d90ba0 Compare February 24, 2026 06:42
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from d4bb8a1 to 896fcaa Compare February 24, 2026 06:42
@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch 4 times, most recently from f8c803d to fe4caa1 Compare February 25, 2026 16:16
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from 896fcaa to e32349c Compare February 26, 2026 05:34
@sid597 sid597 requested a review from mdroidian February 27, 2026 09:55
Copy link
Copy Markdown
Member

@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 couple comments.

  • Let's make a task to change the getPersonalSetting to a typed value or shared constant.
  • Could you communicate the context for why we are removing initialValue and what it's being replaced with?

// eslint-disable-next-line react-hooks/rules-of-hooks
const isOverlayEnabled = useMemo(
() => getSetting(DISCOURSE_CONTEXT_OVERLAY_IN_CANVAS_KEY, false),
() => getPersonalSetting<boolean>(["Overlay in canvas"]),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we promote this to a shared constant or typed key? That would give us autocomplete and eliminate the risk of subtle string mismatches.

Ideally that's something we look into doing before merging to main.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We can, it depends on what the end goal is. I am coming from the pov that this is intermediate code that is not going to be merged to main, we are merging all this to a staging branch, testing it thoroughly internally then removing the intermediate code i.e both the dual-write and dual-read.

So if this is intermediate then we should not update this code, if the end goal is that we will merge this main and then do real world testing and monitoring, and at some point in future cleanup the intermediate code, then we should do this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It can be for the future, as long as it is tracked somewhere. Ideally a linear ticket.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

title="Overlay"
description="Whether or not to overlay discourse context information over discourse node references."
settingKeys={["Discourse context overlay"]}
initialValue={getSetting<boolean>("discourse-context-overlay", false)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is initialValue being replaced with?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Before: Callers read the value manually and passed it as initialValue:

  <PersonalFlagPanel                                                 
    settingKeys={["Discourse context overlay"]}                      
    initialValue={getSetting<boolean>("discourse-context-overlay",   
  false)}             
  />          

After: PersonalFlagPanel reads it internally — same lookup, just moved inside:

  <PersonalFlagPanel
    settingKeys={["Discourse context overlay"]}
  />

The wrapper does getPersonalSetting(settingKeys) which calls the
same getSetting(legacyKey, zodDefault) under the hood. The legacy
key mapping ("Discourse context overlay" → "discourse-context-overlay") and default (false) come from the
accessor layer now instead of the call site.

This was set up in ENG-1472 — PersonalFlagPanel (#813) already self-reads,
so the initialValue props were redundant.

@sid597 sid597 force-pushed the eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed branch from fe4caa1 to 1657b2b Compare March 1, 2026 15:48
sid597 added 2 commits March 1, 2026 21:21
…ult reads (#813)

* ENG-1472: Refactor BlockPropSettingPanels to add accessor-backed default reads (with initialValue fallback)

* review, fix
@sid597 sid597 force-pushed the eng-1456-migrate-personal-boolean-flag-consumers-getsetting branch from e32349c to 185006d Compare March 1, 2026 15:56
Copy link
Copy Markdown
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 found 1 new potential issue.

View 12 additional findings in Devin Review.

Open in Devin Review

@sid597 sid597 merged commit 6ecf11f into eng-1472-refactor-blockpropsettingpanels-to-add-accessor-backed Mar 2, 2026
10 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