ENG-1273: Migrate small personal settings#691
ENG-1273: Migrate small personal settings#691sid597 wants to merge 5 commits intoeng-1272-migrate-all-small-global-settings-componentfrom
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
a82cfaf to
bc0de10
Compare
9015611 to
16b26f7
Compare
bc0de10 to
57abc42
Compare
16b26f7 to
dd2272b
Compare
57abc42 to
7ead54e
Compare
dd2272b to
92ea54b
Compare
490810f to
8dc5276
Compare
5a165ac to
bed3149
Compare
8dc5276 to
8286d6b
Compare
bed3149 to
d23e91a
Compare
f5d0a0a to
2a4faca
Compare
| settingKeys={["Discourse Context Overlay"]} | ||
| defaultValue={getSetting<boolean>("discourse-context-overlay", false)} | ||
| onChange={(checked) => { | ||
| void setSetting("discourse-context-overlay", checked); |
There was a problem hiding this comment.
Note we are using getSetting and setSetting from the extensionAPI, so when we use these panel we save to both the extensionApi and the blockProps.
@sid597 Alternatively, another way of showing would be to show the before and after. EG: if blocks, show the blocks being added/removed. If props, show the props before, and show the props after. |
mdroidian
left a comment
There was a problem hiding this comment.
Looks good.
Sentence case for UI
Let's take this opportunity to change all settings to "Sentence case". The team made that call awhile ago but looks like some of these might not have been changed.
So lets change that before merge
Settings Values
And remember that we discussed the setting values to be consistent as well:
either "lower-with-dash" or "Sentence case like this"
I'm not sure if this is scheduled for another issue, just wanting to note it again here.
|
@mdroidian Found out why I was not able to show the console, it was because in loom I was sharing tab instead of whole screen, and each time I tested with tab the console does not appear in the video. Now I have shared the whole screen and here is the video: |
| setFeatureFlag, | ||
| } from "~/components/settings/utils/accessors"; | ||
| import type { FeatureFlags } from "~/components/settings/utils/zodSchema"; | ||
|
|
There was a problem hiding this comment.
to test add the following code here:
import { getSetting } from "~/utils/extensionSettings";
// --- DEBUG: maps block prop path to extensionAPI.settings key ---
const BLOCK_PROP_TO_EXT_API: Record<string, string> = {
"Discourse Context Overlay": "discourse-context-overlay",
"Suggestive Mode Overlay": "suggestive-mode-overlay",
"Text Selection Popup": "text-selection-popup",
"Disable Sidebar Open": "disable-sidebar-open",
"Page Preview": "page-preview",
"Hide Feedback Button": "hide-feedback-button",
"Auto Canvas Relations": "auto-canvas-relations",
"Overlay in Canvas": "discourse-context-overlay-in-canvas",
"Streamline Styling": "streamline-styling",
"Disable Product Diagnostics": "disallow-diagnostics",
"Query > Hide Query Metadata": "hide-metadata",
"Query > Default Page Size": "default-page-size",
"Query > Query Pages": "query-pages",
};
const debugLog = (panel: string, title: string, settingKeys: string[], blockPropValue: unknown) => {
const path = settingKeys.join(" > ");
const extApiKey = BLOCK_PROP_TO_EXT_API[path];
const extApiValue = extApiKey ? getSetting(extApiKey, "(not set)") : "(no extensionAPI mapping)";
console.log(
`[${panel}] "${title}"`,
`\n blockProp [${path}]:`, blockPropValue,
`\n extensionAPI [${extApiKey || "?"}]:`, extApiValue,
);
};
| setValue(checked); | ||
| setter(settingKeys, checked); | ||
| await syncFlagToBlock(checked); | ||
| onChange?.(checked); |
There was a problem hiding this comment.
to test add the following line to all the base panels, you just have to change the name i.e replace the "FlagPanel" with corresponding panel name
setTimeout(() => debugLog("FlagPanel", title, settingKeys, getter(settingKeys)), 500);
fcaa6de to
0ef04ee
Compare
2a4faca to
1a99b62
Compare
|
@mdroidian re requesting review even though its already approved, because there are many changes related to Sentence Case |
69ffb18 to
7f28c8c
Compare
0ef04ee to
15f3a6b
Compare
| return ( | ||
| <div className="flex flex-col gap-4 p-1"> | ||
| {/* TODO: Titles kept as lowercase to match legacy readers in getExportSettings.ts. | ||
| Update titles to Sentence case once read side is migrated to block props. */} |
There was a problem hiding this comment.
Not using Sentence case for titles of these GlobalFlagPanel because call site will break
| panel={ | ||
| <div className="flex flex-col gap-4 p-1"> | ||
| {/* TODO: Titles kept as Title Case to match legacy readers in getSuggestiveModeConfigSettings.ts. | ||
| Update titles to Sentence case once read side is migrated to block props. */} |
There was a problem hiding this comment.
Not using Sentence case for titles of these GlobalFlagPanel because call site will break
| return ( | ||
| <div className="flex flex-col gap-4 p-1"> | ||
| {/* TODO: Titles kept as legacy casing to match readers in discourseConfigRef.ts and initializeObserversAndListeners.ts. | ||
| Update titles to Sentence case once read side is migrated to block props. */} |
There was a problem hiding this comment.
Not using Sentence case for titles of these panels because call site will break

NOTE: No usage video I tested all these and they work. The video will not be helpful because not able to show the console logs in loom video.
Summary by CodeRabbit
Release Notes
Refactor
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.