Skip to content

Fix: icon and input issue#2852

Merged
HarshMN2345 merged 3 commits intomainfrom
fix-strings
Feb 13, 2026
Merged

Fix: icon and input issue#2852
HarshMN2345 merged 3 commits intomainfrom
fix-strings

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Feb 13, 2026

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

    • Improved column icon selection logic to account for both type and format properties, ensuring more accurate visual representation of database columns.
  • Chores

    • Added UI component library dependencies for enhanced interface styling and icon support.

fix: wrong format on event, temp patch.
@ItzNotABug ItzNotABug self-assigned this Feb 13, 2026
@appwrite
Copy link

appwrite bot commented Feb 13, 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

Teams feature lets you group users with membership management and role permissions

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

The 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)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive terms like 'icon and input issue' that don't clearly convey the specific nature of the changes made to the codebase. Clarify the title to be more specific about the actual changes, such as 'Fix column option matching logic for icon selection' or 'Add pink design system dependencies' to better reflect the changeset.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ 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 fix-strings

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.

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 | 🟡 Minor

Add a null safety guard for option at line 428.

The columnOptions.find() call at lines 396–400 can return undefined if the column's type or type+format combination is not in columnOptions. Accessing option.icon on 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.

Comment on lines 23 to 33
// 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;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

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

🤖 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.

@HarshMN2345 HarshMN2345 merged commit b7b2ea7 into main Feb 13, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-strings branch February 13, 2026 11:58
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