Skip to content

Comments

Render text/mediumtext/longtext (and large varchar) as textarea#2866

Open
HarshMN2345 wants to merge 3 commits intomainfrom
text-types-textarea
Open

Render text/mediumtext/longtext (and large varchar) as textarea#2866
HarshMN2345 wants to merge 3 commits intomainfrom
text-types-textarea

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Feb 18, 2026

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

  • Bug Fixes
    • Textarea inputs now automatically display for text-like columns (text, mediumtext, longtext) regardless of declared size, in addition to the existing rules for large column sizes, arrays, and spatial types—making editing of long-form text fields more convenient.

@appwrite
Copy link

appwrite bot commented Feb 18, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

HTTPS and SSL certificates are handled automatically for all your Sites

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00bb2e5 and 77ac1d8.

📒 Files selected for processing (1)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte

Walkthrough

A single Svelte file was modified to add a computed flag forceTextarea that is true for column types text, mediumtext, or longtext. The rendering condition was changed from {#if columnSize >= 50 || array || isSpatialType(column)} to {#if forceTextarea || columnSize >= 50 || array || isSpatialType(column)}, causing textarea inputs for those text-like column types regardless of declared size. No public/exported API changes were made.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling textarea rendering for text/mediumtext/longtext column types, which directly matches the implementation that adds a forceTextarea flag for these types.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch text-types-textarea

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte (1)

46-51: varchar > 255 arm of forceTextarea is redundant; string type is inconsistently omitted.

Two related observations:

  1. Redundancy: Any varchar column with size > 255 also satisfies columnSize >= 50 in the render condition on line 157, so the (column.type === 'varchar' && columnSize > 255) arm of forceTextarea is never the sole trigger. Consider removing it to keep forceTextarea scoped to types that genuinely need special-casing (text/mediumtext/longtext).

  2. Consistency gap: Models.ColumnString (column.type === 'string') is treated identically to Models.ColumnVarchar in the maxlength derivation (line 39), yet it is absent from forceTextarea. If the intent is to document that large string-like columns must be textarea, column.type === 'string' with columnSize > 255 should mirror the varchar arm (or both should be removed if relying on columnSize >= 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.

…base-[database]/table-[table]/rows/columns/types/string.svelte

Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Greptile Summary

This PR improves the user experience for editing text-type database columns (text, mediumtext, longtext) by always rendering them as textareas in the row editing interface.

Changes:

  • Added forceTextarea derived variable that checks if the column type is text, mediumtext, or longtext
  • Modified the conditional rendering logic to use textarea when forceTextarea is true, regardless of column size
  • Maintains existing behavior for varchar columns (textarea when size >= 50) and other special cases (arrays, spatial types)

Consistency:
The change aligns the row editing UI with the column creation UI, where text/mediumtext/longtext columns always use textarea inputs (see text.svelte:83). This makes sense because these column types are designed specifically for large text content, unlike varchar which has a configurable size parameter.

Confidence Score: 5/5

  • This PR is safe to merge with no identified risks
  • The change is simple, focused, and improves UI consistency. The logic correctly checks column types and maintains backward compatibility with existing behavior for varchar and other column types. No security concerns or edge cases identified.
  • No files require special attention

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/string.svelte Added forceTextarea derived variable to always render textarea for text/mediumtext/longtext column types, improving consistency with column creation UI

Last reviewed commit: 77ac1d8

Copy link
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.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

…base-[database]/table-[table]/rows/columns/types/string.svelte

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants