fix: remove hardcoded 48-character limit from text inputs#90
Conversation
Greptile SummaryThis PR removes the hardcoded 48-character limit ( Key Changes:
Critical Issues Found:
Compliance Violations:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Component
participant Input/Textarea
participant Validation
User->>Component: Enter text in input field
Component->>Component: Check if max_length is defined
alt max_length is defined
Component->>Input/Textarea: Pass maxLength={max_length}
Input/Textarea->>Input/Textarea: Apply character limit
Input/Textarea-->>User: Enforce max length
else max_length is undefined (NEW)
Component->>Input/Textarea: Pass maxLength={undefined}
Input/Textarea->>Input/Textarea: No character limit applied
Input/Textarea-->>User: Allow unlimited input
end
User->>Component: Submit batch data (CSV)
Component->>Validation: checkBatchInputs(data)
Validation->>Validation: For each row, check max_length
alt max_length is undefined (BUG)
Validation->>Validation: item.length > undefined
Validation-->>Component: TypeError/NaN comparison
else max_length is defined
Validation->>Validation: item.length > max_length
Validation-->>Component: Valid comparison result
end
|
There was a problem hiding this comment.
Additional Comments (1)
-
web/app/components/share/text-generation/run-once/index.tsx, line 146-151 (link)style: paragraph textarea missing
maxLengthprop - should be added for consistency with other input typesNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
11 files reviewed, 4 comments
| return false | ||
| } | ||
| const headerData = data[0] | ||
| console.log('Checking batch inputs:', { dataLength: data.length, headerData }) |
There was a problem hiding this comment.
syntax: remove debug console.log statement
| console.log('Checking batch inputs:', { dataLength: data.length, headerData }) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/components/share/text-generation/index.tsx
Line: 199:199
Comment:
**syntax:** remove debug console.log statement
```suggestion
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| if (varItem.type === 'string') { | ||
| const maxLen = varItem.max_length || DEFAULT_VALUE_MAX_LEN | ||
| if (item[varIndex].length > maxLen) { | ||
| if (item[varIndex].length > varItem.max_length) { |
There was a problem hiding this comment.
logic: comparison will fail when max_length is undefined - need to check if max_length exists before comparing
| if (item[varIndex].length > varItem.max_length) { | |
| if (varItem.max_length && item[varIndex].length > varItem.max_length) { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/components/share/text-generation/index.tsx
Line: 261:261
Comment:
**logic:** comparison will fail when `max_length` is undefined - need to check if `max_length` exists before comparing
```suggestion
if (varItem.max_length && item[varIndex].length > varItem.max_length) {
```
How can I resolve this? If you propose a fix, please make it concise.| <Input | ||
| type="number" | ||
| type="text" |
There was a problem hiding this comment.
logic: changed input type from number to text but maxLength doesn't apply to numeric values - this breaks number validation. Was changing the number input type to text intentional, or should number inputs remain as type=number?
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/app/components/app/configuration/prompt-value-panel/index.tsx
Line: 166:167
Comment:
**logic:** changed input type from `number` to `text` but `maxLength` doesn't apply to numeric values - this breaks number validation. Was changing the number input type to text intentional, or should number inputs remain as type=number?
How can I resolve this? If you propose a fix, please make it concise.
Benchmark PR from qodo-benchmark#417