Skip to content

Conversation

ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Aug 31, 2025

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

    • Improved number input handling in forms for greater consistency, reducing edge-case errors and preserving expected behavior for empty fields.
    • Integer column limits are now clamped to safe numeric ranges to prevent invalid values and potential overflow during data entry.
  • Chores

    • Updated a UI component library dependency to a newer pinned version for compatibility and stability.

@ItzNotABug ItzNotABug self-assigned this Aug 31, 2025
Copy link

appwrite bot commented Aug 31, 2025

Console

Project ID: 688b7bf400350cbd60e9

Sites (2)
Site Status Logs Preview QR
 console-qa
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code
 console-cloud
688b7c18002b9b871a8f
Ready Ready View Logs Preview URL QR Code

Note

Appwrite has a Discord community with over 16 000 members.

Copy link
Contributor

coderabbitai bot commented Aug 31, 2025

Walkthrough

  • package.json: Updated @appwrite.io/pink-svelte URL pin from commit 0f90bf1 to 18188b7.
  • src/lib/elements/forms/inputNumber.svelte: coerceToNumber signature changed to accept a CustomEvent and now reads the input value from event.detail (fallback to ''). Empty-input behavior and numeric parsing remain the same; on:change uses the updated handler.
  • src/routes/.../types/integer.svelte: Imported isWithinSafeRange and, when limited is true, clamps column.min/column.max to Number.MIN_SAFE_INTEGER / Number.MAX_SAFE_INTEGER if outside the safe range; label clearing unchanged.

Possibly related PRs

Suggested reviewers

  • TorstenDittmann
  • ChiragAgg5k

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 643ebef and 0b2e8d4.

📒 Files selected for processing (1)
  • src/lib/elements/forms/inputNumber.svelte (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/elements/forms/inputNumber.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: e2e
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-numbers-inline-edits

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (2)
package.json (1)

29-29: Pin bump to pink-svelte: confirm event contract change and prefer a stable reference.

Since Input.Number now appears to emit CustomEvent with detail, verify this commit actually ships that behavior to avoid runtime mismatches. Consider switching from a bare commit pin to a tag/release once available for reproducible builds.

Would you like me to open a follow-up to migrate off commit SHAs to semver once the next release lands?

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

18-21: Avoid mutating parent-provided column; derive local safe bounds instead.

Mutating props can cause surprising upstream side effects. Derive local min/max and use them in the template.

Apply:

-$: if (limited) {
-    column.min = isWithinSafeRange(column.min) ? column.min : Number.MIN_SAFE_INTEGER;
-    column.max = isWithinSafeRange(column.max) ? column.max : Number.MAX_SAFE_INTEGER;
-}
+let safeMin: number | null = null;
+let safeMax: number | null = null;
+$: if (limited) {
+    safeMin = isWithinSafeRange(column.min) ? column.min : Number.MIN_SAFE_INTEGER;
+    safeMax = isWithinSafeRange(column.max) ? column.max : Number.MAX_SAFE_INTEGER;
+}

And update usage in the markup:

<!-- outside the changed hunk -->
min={limited ? safeMin : column.min}
max={limited ? safeMax : column.max}

Also confirm that clamping to JS safe integers aligns with backend limits (e.g., 64-bit ranges).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bf5ff13 and 643ebef.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • package.json (1 hunks)
  • src/lib/elements/forms/inputNumber.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/integer.svelte (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: e2e
🔇 Additional comments (2)
src/lib/elements/forms/inputNumber.svelte (1)

21-23: Make coerceToNumber accept both CustomEvent.detail and native InputEvent

In src/lib/elements/forms/inputNumber.svelte (lines 21–23), update the handler signature and body to:

-function coerceToNumber(event: CustomEvent) {
-    const raw = event.detail ?? '';
+function coerceToNumber(
+  e: CustomEvent<string | number> | Event & { currentTarget: HTMLInputElement }
+) {
+  const detail = (e as CustomEvent<string | number>)?.detail;
+  const raw = detail !== undefined
+    ? String(detail)
+    : e.currentTarget.value;

Also revise the exported props to tighten their types:

export let label: string | null | undefined = null;
export let value: number | null | undefined = null;
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/columns/types/integer.svelte (1)

4-4: Good call importing a shared safe-range helper.

Centralizing the boundary logic improves consistency across numeric UIs.

@ItzNotABug ItzNotABug merged commit 9aa69ae into main Aug 31, 2025
5 checks passed
@ItzNotABug ItzNotABug deleted the fix-numbers-inline-edits branch August 31, 2025 07:09
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