Skip to content

fix TextVariableEditor layout and add support for multi line paste #18721

Open
neo773 wants to merge 8 commits intomainfrom
fix-text-variable-editor
Open

fix TextVariableEditor layout and add support for multi line paste #18721
neo773 wants to merge 8 commits intomainfrom
fix-text-variable-editor

Conversation

@neo773
Copy link
Copy Markdown
Member

@neo773 neo773 commented Mar 18, 2026

No description provided.

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.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/twenty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts:92">
P2: This early return skips the JSON normalization path for multiline pastes, so the raw-JSON and files editors no longer reformat pretty-printed JSON on paste.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@FelixMalfait
Copy link
Copy Markdown
Member

FelixMalfait commented Mar 18, 2026

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:6016

This environment will automatically shut down after 5 hours.

@neo773 neo773 force-pushed the fix-text-variable-editor branch from d77bb1a to 568eeab Compare March 18, 2026 06:59
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.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/twenty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts:109">
P2: Clamping to `tr.doc.content.size` can still leave the cursor on an invalid document-boundary position; use a selection helper that resolves to the nearest text position.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

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.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/twenty-front/src/modules/object-record/record-field/ui/form-types/hooks/__tests__/useTextVariableEditor.test.ts">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-field/ui/form-types/hooks/__tests__/useTextVariableEditor.test.ts:153">
P2: This test doesn't actually verify insertion at the selected cursor position; it would still pass if the JSON were pasted at the start or end as long as the original text remained.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment on lines +153 to +155
expect(c).toContain('hello');
expect(c).toContain('orld');
expect(c).toContain('"x": 1');
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 18, 2026

Choose a reason for hiding this comment

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

P2: This test doesn't actually verify insertion at the selected cursor position; it would still pass if the JSON were pasted at the start or end as long as the original text remained.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/object-record/record-field/ui/form-types/hooks/__tests__/useTextVariableEditor.test.ts, line 153:

<comment>This test doesn't actually verify insertion at the selected cursor position; it would still pass if the JSON were pasted at the start or end as long as the original text remained.</comment>

<file context>
@@ -139,6 +139,22 @@ describe('useTextVariableEditor', () => {
+      paste(editor, '{"x":1}');
+
+      const c = content(editor);
+      expect(c).toContain('hello');
+      expect(c).toContain('orld');
+      expect(c).toContain('"x": 1');
</file context>
Suggested change
expect(c).toContain('hello');
expect(c).toContain('orld');
expect(c).toContain('"x": 1');
expect(c).toContain('hello w{');
expect(c).toContain('}orld');
expect(c).toContain('"x": 1');
Fix with Cubic

Chrome 142 rejects CSS var() references in SVG width/height attributes,
falling back to 100%. Use resolved theme values (numbers) instead of
raw CSS variable strings for icon size and stroke props.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants