-
Notifications
You must be signed in to change notification settings - Fork 189
Fix: numbers edits #2286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: numbers edits #2286
Conversation
ConsoleProject ID: Sites (2)
Note Appwrite has a Discord community with over 16 000 members. |
Walkthrough
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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.
⛔ 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 InputEventIn 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.
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
Chores