Skip to content

Comments

ENG-1225: Discourse node migration simple settings#696

Open
sid597 wants to merge 8 commits intographite-base/696from
eng-1225-discourse-node-migrate-settings-prod
Open

ENG-1225: Discourse node migration simple settings#696
sid597 wants to merge 8 commits intographite-base/696from
eng-1225-discourse-node-migrate-settings-prod

Conversation

@sid597
Copy link
Collaborator

@sid597 sid597 commented Jan 14, 2026

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


Open with Devin

Summary by CodeRabbit

  • Refactor
    • Migrated all settings storage from global to personal user-scoped configuration
    • Added real-time validation and error message feedback for node configuration settings, including tags and format specifications
    • Refactored component interfaces to reduce dependencies and improve maintainability
    • Standardized keyboard shortcut configuration across menu trigger features

✏️ Tip: You can customize this high-level summary in your review settings.

@linear
Copy link

linear bot commented Jan 14, 2026

@supabase
Copy link

supabase bot commented Jan 14, 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 ENG-1225: Discourse node migration ENG-1225: Discourse node migration simple settings Jan 14, 2026
@sid597 sid597 marked this pull request as ready for review January 14, 2026 09:02
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 3ac2996 to d549f8d Compare January 17, 2026 18:16
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from a82cfaf to bc0de10 Compare January 17, 2026 18:16
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from d549f8d to 78b7dbb Compare January 18, 2026 05:25
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from bc0de10 to 57abc42 Compare January 18, 2026 05:25
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 78b7dbb to d66fa03 Compare January 19, 2026 04:51
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from 57abc42 to 7ead54e Compare January 19, 2026 04:51
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from d66fa03 to cb22590 Compare January 19, 2026 05:01
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from 490810f to 8dc5276 Compare January 19, 2026 06:03
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from cb22590 to 78abef0 Compare January 19, 2026 06:03
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from 8dc5276 to 8286d6b Compare January 19, 2026 06:34
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 78abef0 to 3966245 Compare January 19, 2026 06:34
This was referenced Jan 19, 2026
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from 8286d6b to 78e8311 Compare January 20, 2026 16:06
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 3966245 to 7015148 Compare January 20, 2026 16:06
@sid597 sid597 changed the base branch from eng-1273-migrate-all-small-personal-settings to graphite-base/696 January 28, 2026 21:16
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 7015148 to ecdee21 Compare January 29, 2026 11:34
@sid597 sid597 force-pushed the graphite-base/696 branch from 78e8311 to 938f6aa Compare January 29, 2026 11:34
@sid597 sid597 changed the base branch from graphite-base/696 to eng-1273-migrate-all-small-personal-settings January 29, 2026 11:34
devin-ai-integration[bot]

This comment was marked as resolved.

@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from ecdee21 to 96f4575 Compare January 30, 2026 06:10
@sid597 sid597 changed the base branch from eng-1273-migrate-all-small-personal-settings to graphite-base/696 February 15, 2026 18:13
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from ee13988 to 3b51bcc Compare February 15, 2026 18:23
@sid597 sid597 changed the base branch from graphite-base/696 to eng-1273-migrate-all-small-personal-settings February 15, 2026 18:23
devin-ai-integration[bot]

This comment was marked as resolved.

@sid597 sid597 changed the base branch from eng-1273-migrate-all-small-personal-settings to graphite-base/696 February 16, 2026 08:21
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 3b51bcc to 23e6249 Compare February 16, 2026 08:25
@sid597 sid597 changed the base branch from graphite-base/696 to eng-1273-migrate-all-small-personal-settings February 16, 2026 08:25
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from c7a0860 to 989b9b4 Compare February 17, 2026 05:16
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 23e6249 to 2700c52 Compare February 17, 2026 05:16
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 2700c52 to 7cd4348 Compare February 17, 2026 15:07
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from 989b9b4 to 4ed3358 Compare February 17, 2026 15:07
@sid597 sid597 force-pushed the eng-1225-discourse-node-migrate-settings-prod branch from 7cd4348 to 70a27fd Compare February 17, 2026 15:37
@sid597 sid597 force-pushed the eng-1273-migrate-all-small-personal-settings branch from 4ed3358 to 2bf5564 Compare February 17, 2026 15:37
title="First Child"
description="If the block is the first child of the embedding block ref, it will be embedded and ranked."
settingKeys={["suggestiveRules", "isFirstChild"]}
initialValue={node.isFirstChild?.value || false}
Copy link
Contributor

Choose a reason for hiding this comment

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

Schema mismatch: accessing .value on a boolean. The schema was changed so isFirstChild is now a boolean (line 80 in zodSchema.ts), not an object with {uid, value}. This will always evaluate to false since undefined?.value is undefined.

// Fix:
initialValue={node.isFirstChild || false}
Suggested change
initialValue={node.isFirstChild?.value || false}
initialValue={node.isFirstChild || false}

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Comment on lines 43 to 55
@@ -64,14 +55,6 @@ const DiscourseNodeSuggestiveRules = ({
[nodeUid],
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing reactive update: removed useEffect that updated embeddingRef when node.embeddingRef changed. The DiscourseNodeTextPanel uses initialValue which only sets state on mount. If the parent component renders with a different node prop, the embedding ref input will show stale data.

// Add back:
useEffect(() => {
  setEmbeddingRef(node.embeddingRef || "");
}, [node.embeddingRef]);
Suggested change
const [embeddingRef, setEmbeddingRef] = useState(node.embeddingRef || "");
useEffect(() => {
setEmbeddingRef(node.embeddingRef || "");
}, [node.embeddingRef]);
const blockUidToRender = useMemo(
() => extractRef(embeddingRef),
[embeddingRef, nodeUid]

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Copy link
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 25 additional findings in Devin Review.

Open in Devin Review

syncToBlock?.(newValue);
onChange?.(newValue);

if (getValidationError?.(newValue)) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Pending debounce not cleared on validation failure causes stale value to be persisted

When a user types a value that fails validation in BaseTextPanel, the function returns early without clearing the previously scheduled debounce timeout. This causes the prior (now-stale) valid value to be persisted to both block props and the Roam block tree.

Detailed scenario and root cause

Consider the "Tag" field in NodeConfig.tsx with format [[CLM]] - {content}:

  1. User types "C" → valid → debounce scheduled to save "C" after 250ms (timeout A)
  2. At t=100ms user types "CL" → valid → timeout A cleared, new debounce for "CL" (timeout B, fires at t=350ms)
  3. At t=200ms user types "CLM"invalid (conflicts with format) → getValidationError returns error → early return at BlockPropSettingPanels.tsx:136, timeout B is NOT cleared
  4. At t=350ms, timeout B fires → saves "CL" via setter(settingKeys, "CL") and syncToBlock?.("CL")

The UI shows "CLM" with a red error message, but the partial value "CL" was silently persisted. The user never intended to save "CL" — they were still typing and got an error. This unintended intermediate save can also trigger downstream side effects.

Impact: Any DiscourseNodeTextPanel with a getValidationError prop (currently the Tag field) may persist unintended partial values.

Suggested change
if (getValidationError?.(newValue)) return;
window.clearTimeout(debounceRef.current);
if (getValidationError?.(newValue)) return;
Open in Devin Review

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

@sid597 sid597 changed the base branch from eng-1273-migrate-all-small-personal-settings to graphite-base/696 February 19, 2026 07:04
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