Damage Bar Upgrade
The damage bar upgrade gives a visual representation of how full the backpack is at a quick glance.
The backpack item has a damage bar only if it has the upgrade applied. It currently updates every tick (as per vanilla), oddly enough likely making it currently one of the least performant upgrades.
The specific fullness is calculated as a measure of the entire capacity of the backpack, not just how many slots are full. It iterates through each slot, checking the difference between the maxStackSize of an item and the current amount if an item is present, otherwise it is simply another empty slot which is divided by the number of total slots. Check the code for the specific algorithm.