indentlabs / indentlabs/notebook

Reordering custom categories/fields doesn't work unless you've reordered a non-custom field first

Open
#363 0 comments 0 reactions 0 assignees View on GitHub
Bug Good First Issue
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.