Render text/mediumtext/longtext (and large varchar) as textarea#2866
Render text/mediumtext/longtext (and large varchar) as textarea#2866HarshMN2345 wants to merge 1 commit intomainfrom
Conversation
Console (appwrite/console)Project ID: Tip Sites support three domain rule types: Active deployment, Git branch, and Redirect |
WalkthroughA single file was modified to introduce a new computed flag Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte (1)
46-51:varchar > 255arm offorceTextareais redundant;stringtype is inconsistently omitted.Two related observations:
Redundancy: Any varchar column with
size > 255also satisfiescolumnSize >= 50in the render condition on line 157, so the(column.type === 'varchar' && columnSize > 255)arm offorceTextareais never the sole trigger. Consider removing it to keepforceTextareascoped to types that genuinely need special-casing (text/mediumtext/longtext).Consistency gap:
Models.ColumnString(column.type === 'string') is treated identically toModels.ColumnVarcharin themaxlengthderivation (line 39), yet it is absent fromforceTextarea. If the intent is to document that large string-like columns must be textarea,column.type === 'string'withcolumnSize > 255should mirror the varchar arm (or both should be removed if relying oncolumnSize >= 50).♻️ Proposed minimal `forceTextarea` (removes redundant arm)
const forceTextarea = $derived( column.type === 'text' || column.type === 'mediumtext' || - column.type === 'longtext' || - (column.type === 'varchar' && columnSize > 255) + column.type === 'longtext' );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte around lines 46 - 51, Remove the redundant "(column.type === 'varchar' && columnSize > 255)" arm from the forceTextarea derived value and, for consistency with the maxlength derivation that treats Models.ColumnString like Models.ColumnVarchar, either add a corresponding check for column.type === 'string' (e.g., treat large 'string' columns the same) or omit both varchar/string size checks and rely on the existing columnSize >= 50 render condition; update the forceTextarea expression (symbol: forceTextarea, referencing column.type and columnSize, and keeping text/mediumtext/longtext) so it matches the maxlength handling for Models.ColumnString/Models.ColumnVarchar.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte:
- Around line 46-51: Remove the redundant "(column.type === 'varchar' &&
columnSize > 255)" arm from the forceTextarea derived value and, for consistency
with the maxlength derivation that treats Models.ColumnString like
Models.ColumnVarchar, either add a corresponding check for column.type ===
'string' (e.g., treat large 'string' columns the same) or omit both
varchar/string size checks and rely on the existing columnSize >= 50 render
condition; update the forceTextarea expression (symbol: forceTextarea,
referencing column.type and columnSize, and keeping text/mediumtext/longtext) so
it matches the maxlength handling for Models.ColumnString/Models.ColumnVarchar.
| column.type === 'text' || | ||
| column.type === 'mediumtext' || | ||
| column.type === 'longtext' || | ||
| (column.type === 'varchar' && columnSize > 255) |
There was a problem hiding this comment.
even short varchars sohuld have textarea.
| (column.type === 'varchar' && columnSize > 255) | |
| column.type === 'varchar' |

What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit
Release Notes