Skip to content

Fix bug on Links, Array, Emails, Phones Field inputs#16603

Merged
Weiko merged 3 commits intomainfrom
fix-bugs-charles-3
Dec 16, 2025
Merged

Fix bug on Links, Array, Emails, Phones Field inputs#16603
Weiko merged 3 commits intomainfrom
fix-bugs-charles-3

Conversation

@charlesBochet
Copy link
Copy Markdown
Member

@charlesBochet charlesBochet commented Dec 16, 2025

The following PR introduced several bugs: #16042

Enregistrement.de.l.ecran.2025-12-16.a.18.00.06.mov

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 11 files

Prompt for AI agents (all 3 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx:16">
P1: Do not import `console` from &#39;console&#39; in frontend code. The Node.js &#39;console&#39; module is not designed for browser environments. Remove this import and use the global `console` object (or better yet, remove the debug statements entirely).</violation>

<violation number="2" location="packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx:121">
P0: **Runtime error when `items` is empty.** `getItemValueAsString(0)` is now called unconditionally, but when `items` is empty, `items[0]` is `undefined` and accessing properties on it will throw. Move this back inside the useState initializer or add a guard.</violation>
</file>

<file name="packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/LinksFieldInput.tsx">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/LinksFieldInput.tsx:58">
P2: Potential stale closure: `draftValue` is captured at render time, but `onClickOutside` may be invoked later after user edits. The original `getLatestDraftValue(instanceId)` pattern ensured fresh state was read at invocation time. Consider using a ref to always access the latest value, or restore the `getLatestDraftValue` approach if it was removed from the hook.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@charlesBochet charlesBochet changed the title Fix bugs Fix bug on Links, Array, Emails, Phones Field inputs Dec 16, 2025
Copy link
Copy Markdown
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM!

@Weiko Weiko merged commit 58c85e7 into main Dec 16, 2025
71 of 73 checks passed
@Weiko Weiko deleted the fix-bugs-charles-3 branch December 16, 2025 17:18
@twenty-eng-sync
Copy link
Copy Markdown

Hey @charlesBochet! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

charlesBochet added a commit that referenced this pull request Dec 17, 2025
abdulrahmancodes pushed a commit that referenced this pull request Dec 18, 2025
NotYen pushed a commit to NotYen/twenty-ym that referenced this pull request Dec 23, 2025
…entyhq#16603)

- Added onEnter handler to field inputs
- Added MULTI_ITEM_FIELD_INPUT_DROPDOWN_ID_PREFIX constant
- Fixed dropdown click outside handling
- Added PhoneCountryCodePickerDropdownId constant

Original commit: 58c85e7
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