MCPcopy Create free account
hub / github.com/bjsi/incremental-everything / toggleCheck

Function toggleCheck

src/widgets/batch_priority.tsx:684–697  ·  view source on GitHub ↗
(remId: string)

Source from the content-addressed store, hash-verified

682 if (r.hasIncRem && r.currentIncPriority !== null) allPriorities.push(r.currentIncPriority);
683 if (r.hasCardPriority && r.currentCardPriority !== null) allPriorities.push(r.currentCardPriority);
684 });
685
686 const minCurrent = Math.min(...allPriorities);
687 const maxCurrent = Math.max(...allPriorities);
688 const currentRange = maxCurrent - minCurrent || 1;
689
690 const newRange = spreadEnd - spreadStart;
691 console.log(' - Adjust: current range', currentRange, 'new range:', newRange);
692
693 updatedRems = updatedRems.map(rem => {
694 if (isInScope(rem) && rem.isChecked) {
695 const newIncPriority = (rem.hasIncRem && rem.currentIncPriority !== null)
696 ? Math.round(spreadStart + ((rem.currentIncPriority - minCurrent) / currentRange) * newRange)
697 : null;
698 const newCardPriority = (rem.hasCardPriority && rem.currentCardPriority !== null)
699 ? Math.round(spreadStart + ((rem.currentCardPriority - minCurrent) / currentRange) * newRange)
700 : null;

Callers 1

BatchPriorityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected