On Bybit and Binance we calculate the order volume to the existing position when closing or decreasing the position. The direction (Long or Short) is not changed.
We calculate the ratio of the order to the balance when opening or increasing the position. The direction (Long or Short) is not changed.
However, there is a difference between Binance and Bybit.
On Binance, if the position direction changes (from Long to Short or vice versa), then the position is closed and the remaining order amount is calculated based on its ratio to the balance. These will be two separate operations in the Signals History.
On Bybit, opening a position in a different direction (Long or Short) does not close the previously opened position. Since you are trading in hedge mode, in which there can be two positions with different position sides.