fix TextVariableEditor layout and add support for multi line paste #18721
fix TextVariableEditor layout and add support for multi line paste #18721
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
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.
...ty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts
Outdated
Show resolved
Hide resolved
...ty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts
Outdated
Show resolved
Hide resolved
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:6016 This environment will automatically shut down after 5 hours. |
d77bb1a to
568eeab
Compare
...ty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts
Outdated
Show resolved
Hide resolved
...ty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
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.
...ty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts
Outdated
Show resolved
Hide resolved
...ty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts
Outdated
Show resolved
Hide resolved
...ty-front/src/modules/object-record/record-field/ui/form-types/hooks/useTextVariableEditor.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
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.
| expect(c).toContain('hello'); | ||
| expect(c).toContain('orld'); | ||
| expect(c).toContain('"x": 1'); |
There was a problem hiding this comment.
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>
| 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'); |
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.
…ibutes" This reverts commit 27590a0.
No description provided.