siyuan-note/siyuan · error
no attribute view rows selected
Error message
no attribute view rows selected
What it means
moveAttributeViewSortedRows computes a new row order for a drag-and-drop move in an attribute view. It requires a non-empty set of selected row IDs; if the selected list is empty (after deduplication), there is nothing to move, so it returns this error instead of producing a meaningless no-op order.
Solutions
- Ensure the drag payload includes at least one selected row ID before invoking the move.
- Check the frontend/plugin code that collects selected row IDs for a filtering bug.
- If rows may have been deleted concurrently, re-query the view and rebuild the selection, then retry.
- Guard the call: if selected.length === 0, skip the API call and show the user a no-op.
Example fix
// before
sortAttributeViewRow(avID, viewID, [])
// after
if (selectedRowIds.length > 0) { sortAttributeViewRow(avID, viewID, selectedRowIds); } Defensive patterns
Strategy: validation
Validate before calling
if (!Array.isArray(selected) || selected.filter(id => id && id.trim()).length === 0) {
return; // nothing to move, skip the API call
} Type guard
function hasSelectedRows(sel) {
return Array.isArray(sel) && sel.some(id => typeof id === "string" && id.length > 0);
} Prevention
- Collect selected row IDs from the live DOM selection right before submitting the drag
- Guard plugin calls with a non-empty check on the row ID array
When it happens
Trigger: Calling the row-move path (via prepareAttributeViewRowSort / sortAttributeViewRow API) with selected as an empty array or a list of empty/whitespace IDs that deduplicate to nothing.
Common situations: A frontend bug dropping the selection before submitting the drag; a plugin calling the sort API programmatically without passing row IDs; a race where rows were deleted between preview and commit so the selection resolved to empty.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- attribute view drop target changed; retry the drag
- attribute view embedded base is missing
- attribute view group not found
- attribute view groups changed; retry the drag
- attribute view instance is not set
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/d5e379d7bcf27b29.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/attribute_view_row_sort.go:176
}
return ret, nil
}
func attributeViewRowSortIDs(items []av.Item) []string {
ret := make([]string, 0, len(items))
for _, item := range items {
ret = append(ret, item.GetID())
}
return ret
}
func moveAttributeViewSortedRows(ordered, selected []string, previousID, nextID string) ([]string, error) {
selectedIDs := map[string]bool{}
for _, id := range selected {
selectedIDs[id] = true
}
if 0 == len(selectedIDs) {
return nil, errors.New("no attribute view rows selected")
}
var moved, remaining []string
for _, id := range ordered {
if selectedIDs[id] {
moved = append(moved, id)
} else {
remaining = append(remaining, id)
}
}
if len(moved) != len(selectedIDs) {
return nil, errors.New("attribute view rows changed; retry the drag")
}
if selectedIDs[nextID] || ("" == nextID && selectedIDs[previousID]) {
return slices.Clone(ordered), nil
}
index := 0
if "" != nextID {
index = slices.Index(remaining, nextID)View on GitHub (pinned to 9f775e8a12)