I want to put a comment on the right side of a numbered equation in align, however I don't like how this moves the whole equation to the left to make room for the comment.
Using mathrlap to enclose the comment makes it stick into the right margin if the equation or the comment is too long, so this isn't an ideal solution for all cases.
Why does the glue I inserted not shrink?
How can I make it such that it moves the whole line (not just the comment) to the right until the equation is centered (as if the comment was not there) or as much as it can until there is no more room, then it should right-align the row with the comment.

\documentclass{article}
\usepackage{showframe}
\usepackage{amsmath}
\usepackage{mathtools} % mathrlap
\newcommand{\example}[1]{
\begin{align}
\hskip 50pt minus 50pt
b&=#1
\quad \vert\text{some long comment on the right}
%\\c&=d % etc.
\end{align}
}
\begin{document}
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\example{a}
\example{a+a}
\example{a+a+a}
\example{a+a+a+a}
\example{a+a+a+a+a}
\example{a+a+a+a+a+a}
\example{a+a+a+a+a+a+a} % too long for number on the same line with glue, ok
\example{a+a+a+a+a+a+a+a} % too long with glue
\example{a+a+a+a+a+a+a+a+a} % too long with glue
\example{a+a+a+a+a+a+a+a+a+a} % always too long for number on the same line, ok
\example{a+a+a+a+a+a+a+a+a+a+a} % always too long, use split
\fboxsep=0pt\fbox{\parbox{50pt}{this is 50pt}}
\end{document}
This is what I'd like to achieve

But, I'd also be happy with a right-aligned comment which is not stuck to the right side of the equation, but the left side of the number. I just don't like to fiddle with each commented equation separately.
One try by myself
Why does the 12th row and following get shifted to the left, but not the 11th?
Is there a simple way to add some space after the comment in-front of the 1-digit numbers 2-digit if there are 3-digit ones etc.?
Could I left-align all comments with the widest comment? How can I store the width of the widest Comment per (align-) environment usage?
I'm thinking of \AtBeginEnvironment to reset the width, but how do I get the width back to an earlier, shorter comment?

\documentclass{article}
\usepackage{showframe}
\usepackage{amsmath}
\newcommand{\latestComment}{}
\newlength{\widestComment}
\setlength{\widestComment}{2cm}
\newcommand{\lmcomm}[1]{\global\def\latestComment{\parbox{\widestComment}{\raggedright#1}}}
\newcommand{\rmcomm}[1]{\global\def\latestComment{#1}}
\let\oldTheequation\theequation
\renewcommand{\theequation}{\latestComment\hskip 3pt(\oldTheequation)\global\def\latestComment{}}
% https://tex.stackexchange.com/a/228449/202560
\usepackage{xparse}
\makeatletter
\renewcommand\tagform@[1]{\maketag@@@{\ignorespaces#1\unskip@@italiccorr}}
\makeatother
\newcommand{\lexample}[1]{ \begin{align} a&=b \lmcomm{#1} \end{align} }
\newcommand{\rexample}[1]{ \begin{align} a&=b \rmcomm{#1} \end{align} }
\begin{document}
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\lexample{}
\lexample{a}
\lexample{Lorem ipsum dolor sit amet}
\rexample{}
\rexample{a}
\setcounter{equation}{8}
\rexample{Lorem} %9
\rexample{Lorem} %10
\rexample{aaaaaaaaaaa} %11
\rexample{aaaaaaaaaaaa} %12
\rexample{aaaaaaaaaaaaa} %13
\rexample{aaaaaaaaaaaaaa} %14
\rexample{Lorem ipsum dolor sit amet} %15
\end{document}
Is there anything else I overlooked with my approach?
\setbox0\hbox{.....}save\wd0for later.....\wd0only sees the natural width, and not any stretch or shrink, – David Carlisle Jun 26 '20 at 09:28\refstepcounter{equation}\tag{your comment (\theequation)}but it might need a bit of code to force the counter increment, much simpler than changing the align logic though. No time to test an answer now, sorry. – David Carlisle Jun 26 '20 at 09:43c&=d– josh Jun 26 '20 at 09:48