How is disclosure of previously undiagnosed long term health condition likely to be viewed when evaluating academic track record? Considering situations where an individual academic track record is to be evaluated - whether by grant panel, job interview panel, promotion panel etc.
If the individual were to make a statement along the lines of

Prior to [date] I was suffering from an undiagnosed long
term health condition which did not result in absence from work, but limited my
output. This was both diagnosed and treated from [date] after which
my productivity increased substantially, as can be demonstrated by
XYZ.

Is this likely to be viewed favorably in evaluating the applicant's potential to deliver on the future grant/job/etc? Or is there a risk it could be viewed with suspicion given the applicant was still employed between those dates and the employer unaware of the situation?
Suppose it were a mental health disorder, would it be better to say so, or keep with the more generic description above?
Would the answer differ depending on which of the situations (job application, grant application) we're talking about?
I would suggest that you don't raise the issue, for a couple of reasons.
First is that you don't know how it will be read. Some people might see it as an invalid excuse, rather than a valid one. Others might wonder whether it will affect your work in future. It is impossible to say. Saying such things won't, in particular, give you an advantage.
Second, it is natural for a person's productivity to increase over time and natural for an application reader to weigh the more recent work more heavily then the older work. That effect can occur even for someone with no health issues. I doubt that the change after the date of diagnosis would be noted by a typical reader unless you point it out.
This is really opinion, of course. If you are healthy now, focus on how you will continue productivity going into the future.