-
Notifications
You must be signed in to change notification settings - Fork 224
Fix float document editor step validation #2945
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,10 +7,13 @@ | |||||
| export let label: string; | ||||||
| export let value: number; | ||||||
| export let limited: boolean = false; | ||||||
| export let column: Models.ColumnInteger; | ||||||
| export let column: Models.ColumnInteger | Models.ColumnFloat; | ||||||
|
|
||||||
| const FLOAT_INPUT_STEP = 0.001; | ||||||
|
|
||||||
| $: autofocus = limited; | ||||||
| $: nullable = !limited ? !column.required : false; | ||||||
| $: isDecimalColumn = ['double', 'float'].includes(column.type as string); | ||||||
| $: if (limited) { | ||||||
| label = undefined; | ||||||
| } | ||||||
|
|
@@ -25,5 +28,5 @@ | |||||
| min={column.min} | ||||||
| max={column.max} | ||||||
| required={column.required} | ||||||
| step={column.type === 'double' ? 'any' : 1} | ||||||
| step={isDecimalColumn ? FLOAT_INPUT_STEP : 1} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Changing from With
Suggested change
|
||||||
| leadingIcon={!limited ? IconHashtag : undefined} /> | ||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: appwrite/console
Length of output: 308
🏁 Script executed:
Repository: appwrite/console
Length of output: 854
🏁 Script executed:
Repository: appwrite/console
Length of output: 180
🏁 Script executed:
Repository: appwrite/console
Length of output: 3540
🏁 Script executed:
Repository: appwrite/console
Length of output: 42
🏁 Script executed:
Repository: appwrite/console
Length of output: 174
🏁 Script executed:
Repository: appwrite/console
Length of output: 90
🏁 Script executed:
Repository: appwrite/console
Length of output: 1215
🏁 Script executed:
Repository: appwrite/console
Length of output: 616
🏁 Script executed:
Repository: appwrite/console
Length of output: 879
Float column type is not mapped in the row editing dispatcher, making the float check unreachable.
The component at line 16 checks for float:
$: isDecimalColumn = ['double', 'float'].includes(column.type as string);, and integer.svelte acceptsModels.ColumnFloat(line 10), but the dispatcher in column.svelte only mapsdouble: Integerwithout mappingfloat. This causes float columns to fail rendering in the rows context since there is no separate float.svelte for row editing.Add
float: Integerto the columnsTypeMap in column.svelte to route float columns to the integer component.🤖 Prompt for AI Agents