indentlabs / indentlabs/notebook
Reordering custom categories/fields doesn't work unless you've reordered a non-custom field first
- Dominant language
- HTML
- Stars
- 410
- Forks
- 78
- Avg merge
- 1d
- Merged PRs (30d)
- 9
Description
### Expected behavior
* Reordering fields/categories should always work.
* If fields/categories don't have an internal `sort_order` value, they should initialize a sort order and then perform the sort
### Actual behavior
It seems that if a user creates a custom field/category and then sorts it, it applies a `sort_order` value but doesn't always initialize the values for the other fields/categories it's sorting again. Not sure if this is all the time or if it only gets into this bad state in some cases.
The issue can be "fixed" by reordering any other field/category, which initializes sort order for all other fields.
We should be initializing sort order for all categories/fields upon creation of those objects so this never happens.
Contributor guide
Research direction
Start by tracing the category and field creation paths and the entry point used when reordering them. Check where sort_order is initialized, then verify that newly created custom fields and categories can be reordered without first changing a non-custom item.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100