Conversation
fix: wrong format on event, temp patch.
Console (appwrite/console)Project ID: Tip Teams feature lets you group users with membership management and role permissions |
WalkthroughThe pull request introduces a refinement to column option selection logic in the table columns management page by adding a format property constraint to the matching criteria. Additionally, two Appwrite Pink UI library dependencies are explicitly added to package.json with pinned commit references. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/columns/+page.svelte (1)
428-428:⚠️ Potential issue | 🟡 MinorAdd a null safety guard for
optionat line 428.The
columnOptions.find()call at lines 396–400 can returnundefinedif the column's type or type+format combination is not incolumnOptions. Accessingoption.iconon line 428 without a guard will throw a runtime error.Suggested fix
- <Icon icon={option.icon} size="s" /> + {`#if` option?.icon} + <Icon icon={option.icon} size="s" /> + {/if}
🤖 Fix all issues with AI agents
In `@src/lib/elements/forms/inputNumber.svelte`:
- Around line 23-33: The reactive block that coerces input events currently
always uses Number(target.value), which silently loses precision for bigint
values; update the $: block that handles event-like `value` to detect when the
intended type is bigint (e.g., if typeof value === 'bigint' or if surrounding
field context/props indicate bigint) and in that case parse using
BigInt(target.value) (treat empty string as null and wrap BigInt parsing in
try/catch to set null on invalid input), otherwise keep the existing Number
parsing and Number.isNaN check; ensure you do not call Number.isNaN on bigint
and preserve the null-on-empty behavior.
| // TODO: Remove this once Pink Svelte is fixed | ||
| $: if (value !== null && typeof value === 'object' && 'target' in (value as object)) { | ||
| const event = value as Event; | ||
| const target = event.target as HTMLInputElement; | ||
| if (target?.value !== undefined) { | ||
| const parsedValue = target.value === '' ? null : Number(target.value); | ||
| value = Number.isNaN(parsedValue) ? null : parsedValue; | ||
| } else { | ||
| value = null; | ||
| } | ||
| } |
There was a problem hiding this comment.
bigint values will silently lose precision through Number() coercion.
The value prop accepts number | bigint (line 8), but this workaround always converts via Number(target.value), which loses precision for integers beyond Number.MAX_SAFE_INTEGER. If a bigint-typed column triggers this code path, the value will be silently truncated.
Consider checking whether the original value (or field context) expects a bigint and using BigInt(target.value) in that case.
Suggested approach
- const parsedValue = target.value === '' ? null : Number(target.value);
- value = Number.isNaN(parsedValue) ? null : parsedValue;
+ if (target.value === '') {
+ value = null;
+ } else if (step === 1 && !target.value.includes('.')) {
+ try {
+ value = BigInt(target.value);
+ } catch {
+ const num = Number(target.value);
+ value = Number.isNaN(num) ? null : num;
+ }
+ } else {
+ const num = Number(target.value);
+ value = Number.isNaN(num) ? null : num;
+ }Based on learnings: "In the appwrite.io/pink-svelte library, the Input.Number component supports both number and bigint types for its value, min, and max props, so no coercion is needed when passing bigint values to it."
🤖 Prompt for AI Agents
In `@src/lib/elements/forms/inputNumber.svelte` around lines 23 - 33, The reactive
block that coerces input events currently always uses Number(target.value),
which silently loses precision for bigint values; update the $: block that
handles event-like `value` to detect when the intended type is bigint (e.g., if
typeof value === 'bigint' or if surrounding field context/props indicate bigint)
and in that case parse using BigInt(target.value) (treat empty string as null
and wrap BigInt parsing in try/catch to set null on invalid input), otherwise
keep the existing Number parsing and Number.isNaN check; ensure you do not call
Number.isNaN on bigint and preserve the null-on-empty behavior.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@package.json`:
- Around line 25-29: Remove the duplicate dependency entries for
"@appwrite.io/pink-icons-svelte" and "@appwrite.io/pink-svelte" in package.json
so each package appears only once; keep a single canonical entry for each (the
existing values are identical) and delete the duplicate lines (ensure the final
JSON has unique keys), then run a quick JSON lint or npm/yarn install to verify
the file parses correctly.

fix: wrong format on event, temp patch.
What does this PR do?
bumps pink version and fixed icon issue
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