Skip to content

fix(console): restrict column number inputs and hide unbounded min/max - #15081

Merged
HarshMN2345 merged 4 commits into
mainfrom
fix-console-column-number-inputs
Oct 29, 2026
Merged

HarshMN2345 merged 4 commits into
mainfrom
fix-console-column-number-inputs

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

What changed

  • Column drawer (Tables DB): string/varchar size inputs now reject e, E, +, -, . keystrokes; integer min/max reject e, E, +, .; double min/max reject e, E, +.
  • Editing an integer or double column created without bounds no longer prefills min/max with the stored full range (±9223372036854775807, ±1.7976931348623157e+308); those fields show empty. Leaving them empty on update sends null, which keeps the stored bounds.

Testing

  • Prettier check on the changed file. Not exercised in a browser; behaviour reasoned from the component and the server defaults (PHP_INT_MAX / PHP_FLOAT_MAX in the attribute create actions, null keeps existing bounds on update).

Fixes #9217
Fixes #7706

@luxor-code-review

luxor-code-review Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 1 medium

💬 Inline comments (1)

  • 🟡 Float sentinel check erases legitimate int64 bounds — Column.tsx:308
🧹 Nitpicks (2) — 🟢 2 low
  • 🟢 Unbounded bigint columns still prefill full range (Column.tsx:327) — The new unbounded-as-empty logic applies only to formData.min/formData.max, but the bigint inputs bind bigintMinText/bigintMaxText, which lines 328-329 fill from formatInt64Bound(column.min/max) with the raw full-range values (apps/console/src/lib/utils/database-columns.ts:42).
  • 🟢 Columns grid still shows unbounded sentinel ranges (database-columns.ts:387) — The drawer now treats full-range min/max (backend defaults PHP_INT_MIN/PHP_INT_MAX for integer/bigint and the float edge for double) as unset (apps/console/src/components/pages/projects/$projectId/databases/tablesdb/Column.tsx:307), but the columns list renders those same stored values through formatColumnRangeDisplay (apps/console/src/components/pages/projects/$projectId/databases/tablesdb/Spreadsheet.tsx:6696), which has no sentinel handling.

This change refines the column edit drawer in the console so that columns created with full-range (unbounded) min/max values open with empty bound fields instead of giant sentinel numbers, and adds keydown guards to numeric inputs to block invalid characters like e, +, and non-integer dots.| Files | Change ||-------|--------|| apps/console/src/components/pages/projects/$projectId/databases/tablesdb/Column.tsx | Adds unbounded-sentinel detection for integer/double bounds when prefilling the edit form, and keydown filtering on size and min/max numeric inputs. || apps/console/src/lib/utils/database-columns.ts | (Context) Range display helpers still render full-range sentinels in the columns grid, unchanged by this PR. |

Reviewed commit: a5c83d7

@appwrite

appwrite Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

New Console

Project ID: new-console

Sites (1)
Site Status Logs Preview QR
 New Console
new-console
Ready Ready View Logs Preview URL QR Code

Tip

Function scopes give you fine-grained control over API permissions

@ghost

ghost commented Oct 29, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The incremental change preserves the existing normalization behavior and introduces no issue requiring a fix.

The column drawer filters invalid keystrokes and pasted characters from string/varchar size fields and integer/double bound fields. When editing integer or double columns whose stored bounds are their full type range, those bounds display as empty, and leaving them empty preserves the stored bounds on update. The latest change factors the shared bound normalization into a generic helper.

Latest changes: The newest commit consolidates the duplicate min/max full-range normalization into a generic helper without changing its behavior.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 1
File Change
apps/console/src/components/pages/projects/$projectId/databases/tablesdb/Column.tsx Filters invalid characters in size and bound inputs, displays unbounded numeric defaults as empty, preserves empty bounds on update, and factors shared bound normalization into a generic helper.

Reviewed the commits since eb5a473 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · See the inline comments. Summary

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PR improves the TablesDB column drawer by displaying unbounded min/max bounds as empty fields and guarding numeric inputs, though three residual issues remain in the sentinel handling.

Key findings

  • 🟡 Float sentinel check erases legitimate int64 bounds — Column.tsx:308

@HarshMN2345
HarshMN2345 merged commit 18faf58 into main Oct 29, 2026
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant