Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs([brain-bucket-chip-reorder]): move reorderLinksInBucket JSDoc back above its function

[._.]/ Adam Eivyb378963cb9ae
diff --git a/client/src/components/brain/links/bucketReorder.js b/client/src/components/brain/links/bucketReorder.js
index 45b1df9ab6..b46e8707d0 100644
--- a/client/src/components/brain/links/bucketReorder.js
+++ b/client/src/components/brain/links/bucketReorder.js
@@ -1,13 +1,3 @@
-/**
- * Pure helper for intra-bucket (and cross-bucket) positioned chip drops.
- *
- * Given the full link list, the dragged link, the destination bucket, and the
- * insertion index (computed from the drop location — relative to the bucket's
- * CURRENT chip order, counting the dragged chip if it already lives there),
- * returns a dense renumbering of the destination bucket plus the subset of
- * links whose `{ bucketId, bucketOrder }` actually changed (so the caller only
- * PATCHes what moved).
- */
/**
* Map a pointer position over a chip to an insertion index: before the chip
* (its own index) when the pointer is in its left half, after it (index + 1)
@@ -18,6 +8,16 @@ export function chipInsertIndex(rect, clientX, i) {
return clientX > rect.left + rect.width / 2 ? i + 1 : i;
}
+/**
+ * Pure helper for intra-bucket (and cross-bucket) positioned chip drops.
+ *
+ * Given the full link list, the dragged link, the destination bucket, and the
+ * insertion index (computed from the drop location — relative to the bucket's
+ * CURRENT chip order, counting the dragged chip if it already lives there),
+ * returns a dense renumbering of the destination bucket plus the subset of
+ * links whose `{ bucketId, bucketOrder }` actually changed (so the caller only
+ * PATCHes what moved).
+ */
export function reorderLinksInBucket(links, link, bucketId, targetIndex) {
const ordered = links
.filter(l => l.bucketId === bucketId)