Skip to content

fix: GraphQL Int -> BigInt ID migration - allow strings as mentioned user IDs in the Rich Text editor#3737

Open
ardecvz wants to merge 2 commits intomainfrom
feature/graphql-bigint-mention-id
Open

fix: GraphQL Int -> BigInt ID migration - allow strings as mentioned user IDs in the Rich Text editor#3737
ardecvz wants to merge 2 commits intomainfrom
feature/graphql-bigint-mention-id

Conversation

@ardecvz
Copy link
Copy Markdown

@ardecvz ardecvz commented Mar 24, 2026

Description

  • MentionedUser.id is typed as number, forcing to cast IDs with Number() to satisfy TS
    After the BigInt migration, IDs are strings, so it's wrong

Screenshots (if applicable)

20260322052055 20260322052829

Implementation details

  • Allow strings and numbers in MentionedUser.id (trying to match the f0's code)
    Normalize the hooks' output as strings

@ardecvz ardecvz requested a review from a team as a code owner March 24, 2026 06:16
Copilot AI review requested due to automatic review settings March 24, 2026 06:16
@github-actions github-actions bot added the react Changes affect packages/react label Mar 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Rich Text editor’s mention ID typing to support GraphQL BigInt ID migration by treating mentioned user IDs as strings (while still allowing mention inputs to provide numeric IDs).

Changes:

  • Update RichTextEditor onChange result to return mentionIds?: string[] and extract mention IDs as strings.
  • Allow MentionedUser.id to be string | number while normalizing inserted mention node id attributes to strings.
  • Align F0Form richtext field types, Zod schemas, and Storybook examples/tests with mentionIds as string[].

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/react/src/experimental/RichText/RichTextEditor/utils/types.tsx Changes resultType.mentionIds to string[] for RichTextEditor output.
packages/react/src/experimental/RichText/RichTextEditor/utils/helpers.tsx Extracts mention IDs as strings during editor updates.
packages/react/src/experimental/RichText/RichTextEditor/index.stories.tsx Updates Storybook docs + example users to use string IDs.
packages/react/src/experimental/RichText/CoreEditor/Extensions/Mention/types.tsx Expands MentionedUser.id to `string
packages/react/src/components/F0FormField/stories/F0FormField.stories.tsx Updates local RichText value typing to mentionIds?: string[].
packages/react/src/components/F0Form/fields/richtext/types.ts Updates RichTextValue.mentionIds to string[].
packages/react/src/components/F0Form/tests/F0FormValidation.test.tsx Updates Zod schemas in tests to accept mentionIds as strings.
packages/react/src/components/F0Form/tests/F0Form.test.tsx Updates required-field tests to treat mentionIds as strings.
packages/react/src/components/F0Form/stories/ValidationIssues.test.stories.tsx Updates Storybook validation schema for mentionIds as strings.
packages/react/src/components/F0Form/stories/F0Form.stories.tsx Updates Storybook examples’ Zod schemas for mentionIds as strings.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-3737 to install the package

Use pnpm i github:factorialco/f0#4c61c635e0e46ba9f39e6010dc2a29f4420e8b9f to install this specific commit

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 44.12% 10390 / 23546
🔵 Statements 43.44% 10711 / 24653
🔵 Functions 36.14% 2347 / 6494
🔵 Branches 35.4% 6564 / 18541
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/components/F0Form/fields/richtext/types.ts 100% 100% 100% 100%
packages/react/src/experimental/RichText/CoreEditor/Extensions/Mention/types.tsx 100% 100% 100% 100%
packages/react/src/experimental/RichText/RichTextEditor/utils/helpers.tsx 63.15% 42.85% 75% 75.8% 10, 17, 27-43, 47, 52, 53, 54, 55, 56, 57, 58, 59, 60, 85, 88, 122, 131-134, 147-148
packages/react/src/experimental/RichText/RichTextEditor/utils/types.tsx 100% 100% 100% 100%
Generated in workflow #12156 for commit 3531bb7 by the Vitest Coverage Report Action

@ardecvz ardecvz changed the title GraphQL Int -> BigInt ID migration – allow strings as mentioned user IDs in the Rich Text editor GraphQL Int -> BigInt ID migration - allow strings as mentioned user IDs in the Rich Text editor Mar 24, 2026
@ardecvz ardecvz changed the title GraphQL Int -> BigInt ID migration - allow strings as mentioned user IDs in the Rich Text editor fix: GraphQL Int -> BigInt ID migration - allow strings as mentioned user IDs in the Rich Text editor Mar 24, 2026
@github-actions github-actions bot added the fix label Mar 24, 2026
@ardecvz ardecvz force-pushed the feature/graphql-bigint-mention-id branch from 02f246c to 3531bb7 Compare March 24, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants