I agree with you. By making it two lists of “shown” and “hidden” buttons, a button may only be in one. While with the counter I had previously, was counting on actually rendered elements, making it always four elements exactly (+reply) and only show the ellipsis when it would be replacing at least two buttons. The current behaviour here on meta of hiding bookmark behind the ellipsis is kinda awkward, indeed.
But even in this approach, shouldn’t be too hard to fix. If there is only one button, don’t render the ellipsis but the button instead. Regarding the hotkeys, yes, they did work – even on non-visible items. As said, this concern was the main reason I chose the approach of only hiding with JS/css. I don’t know what broke them in the new approach.
May I ask another question though, a more general one. Why, though agreed upon the max_items approach, did we change to the other approach and rewrite the same feature within just a few hours? What were the reasons behind changing to this approach?