Render text/mediumtext/longtext (and large varchar) as textarea#2866
Render text/mediumtext/longtext (and large varchar) as textarea#2866HarshMN2345 wants to merge 3 commits intomainfrom
Conversation
Console (appwrite/console)Project ID: Tip HTTPS and SSL certificates are handled automatically for all your Sites |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughA single Svelte file was modified to add a 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.
...gion]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte
Outdated
Show resolved
Hide resolved
…base-[database]/table-[table]/rows/columns/types/string.svelte Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte:
- Around line 46-51: forceTextarea currently includes 'varchar' which forces all
varchar columns (including small ones) into textareas; remove 'varchar' from the
derived condition so only text/mediumtext/longtext are forced, and rely on the
existing columnSize >= 50 check (see forceTextarea and columnSize logic) to
promote large ColumnVarchar fields to textarea instead. Ensure you only change
the condition that builds forceTextarea and do not alter the columnSize >= 50
branch or type names.
...gion]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte
Show resolved
Hide resolved
Greptile SummaryThis PR improves the user experience for editing text-type database columns ( Changes:
Consistency: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 77ac1d8 |
...gion]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte
Show resolved
Hide resolved
…base-[database]/table-[table]/rows/columns/types/string.svelte Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

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