ENG-1225: Discourse node migration simple settings#696
ENG-1225: Discourse node migration simple settings#696sid597 wants to merge 6 commits intoeng-1273-migrate-all-small-personal-settingsfrom
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. |
3ac2996 to
d549f8d
Compare
a82cfaf to
bc0de10
Compare
d549f8d to
78b7dbb
Compare
bc0de10 to
57abc42
Compare
78b7dbb to
d66fa03
Compare
57abc42 to
7ead54e
Compare
d66fa03 to
cb22590
Compare
490810f to
8dc5276
Compare
cb22590 to
78abef0
Compare
8dc5276 to
8286d6b
Compare
78abef0 to
3966245
Compare
8286d6b to
78e8311
Compare
3966245 to
7015148
Compare
7015148 to
ecdee21
Compare
78e8311 to
938f6aa
Compare
apps/roam/src/components/settings/DiscourseNodeSuggestiveRules.tsx
Outdated
Show resolved
Hide resolved
ecdee21 to
96f4575
Compare
a449a73 to
84aa5ac
Compare
88d4ff5 to
f5d0a0a
Compare
84aa5ac to
8ad6b12
Compare
f5d0a0a to
7f28c8c
Compare
8ad6b12 to
29b1281
Compare
apps/roam/src/components/settings/DiscourseNodeCanvasSettings.tsx
Outdated
Show resolved
Hide resolved
fd062f4 to
ee13988
Compare
| overlay: stringWithDefault(""), | ||
| index: IndexSchema.nullable().optional(), | ||
| suggestiveRules: SuggestiveRulesSchema.nullable().optional(), | ||
| embeddingRef: stringWithDefault(""), |
There was a problem hiding this comment.
Wrong, we don't want these to exist on top level they have to be under suggestiveRules schema only
| const [value, setValue] = useState( | ||
| () => defaultValue ?? getter(settingKeys) ?? "", | ||
| ); | ||
| const error = validate?.(value); |
There was a problem hiding this comment.
Some discourse node text panels need validation logic adding support for that
There was a problem hiding this comment.
I wonder if validate could be renamed to better reflect its return value. Right now it reads like it returns a boolean, but it actually returns an error message (string) or undefined when valid. Something like getValidationError / getErrorMessage would make that clearer, and adding a
type ValidationError = string;
type Validator<T> = (value: T) => ValidationError | undefined;
type alias would lock in the intent.
| settingKeys: string[]; | ||
| }; | ||
|
|
||
| export const DiscourseNodeTextPanel = ({ |
There was a problem hiding this comment.
new panels for discourseNode usage
mdroidian
left a comment
There was a problem hiding this comment.
Everything was generally good until NodeConfig.tsx. There are a bunch of changes in there that don't really make sense to me. I'm not sure if they were stylistic choices or if somehow they related to settings in props.
Could you do a quick video explaining the changes.
Also, make sure to format all files with prettier and make sure there are no lint errors in your new code before sending for re-review.
| onChange?: (values: string[]) => void; | ||
| } & RoamBlockSyncProps; | ||
|
|
||
| const DEBOUNCE_MS = 500; |
| const [value, setValue] = useState( | ||
| () => defaultValue ?? getter(settingKeys) ?? "", | ||
| ); | ||
| const error = validate?.(value); |
There was a problem hiding this comment.
I wonder if validate could be renamed to better reflect its return value. Right now it reads like it returns a boolean, but it actually returns an error message (string) or undefined when valid. Something like getValidationError / getErrorMessage would make that clearer, and adding a
type ValidationError = string;
type Validator<T> = (value: T) => ValidationError | undefined;
type alias would lock in the intent.
| onChange={(checked) => { | ||
| setIsKeyImage(checked); | ||
| if (checked && !keyImageOption) setKeyImageOption("first-image"); | ||
| setInputSetting({ |
There was a problem hiding this comment.
Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator.eslint@typescript-eslint/no-floating-promises
| onChange={(e) => { | ||
| const target = e.target as HTMLInputElement; | ||
| setKeyImageOption(target.value); | ||
| const value = (e.target as HTMLInputElement).value; |
There was a problem hiding this comment.
What was the purpose of this change?
| const graphOverviewUid = getUid("Graph Overview"); | ||
| const specificationUid = getUid("Specification"); | ||
| const indexUid = getUid("Index"); | ||
| const overlayUid = getUid("Overlay"); |
There was a problem hiding this comment.
What is the purpose of re-ordering these?
| return; | ||
| } | ||
| const cleanTag = getCleanTagText(tag); | ||
| const cleanTag = getCleanTagText(tagValue); |
There was a problem hiding this comment.
This value is now generated from a different function/mechanism than before this PR. Could you explain why this change was made and how it relates to the new schema?
| @@ -42,7 +42,6 @@ import { | |||
| DISALLOW_DIAGNOSTICS, | |||
| } from "./data/userSettings"; | |||
| // import { initSchema } from "./components/settings/utils/init"; | |||
|
And make sure to zoom in ~50% when doing loom videos, you have a very large monitor 🙂 |

https://www.loom.com/share/9aa6f5f8815e41de92f21e14f7f5f855
demo video
changes done to following settings
"Key Image" — DiscourseNodeCanvasSettings.tsx
"Embedding Block Ref" — DiscourseNodeSuggestiveRules.tsx
"First Child" — DiscourseNodeSuggestiveRules.tsx
"Description" — NodeConfig.tsx
"Shortcut" — NodeConfig.tsx
"Tag" — NodeConfig.tsx
"Graph Overview" — NodeConfig.tsx
ENG-1225: Discourse node migration
Migrate personal settings text inputs
remove unnecessary checks zod takes care
migrate attributes overlay and suggestive rules
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.