Snapping when scaling on multiple axes

In general when I use snapping, using Snap To Vertex, and Snap With Closest, I expect that the logic is that it copies whatever coordinates I’m constrained on (all axes, one axis, two axis) of the target vertex to the closest vertex of the object I’m transforming.

This works when moving an object for instance, even if this object is at whatever distance to the other.

Take these two cubes from top view:

If I want to move the right cube so that the top edge matches in Y with the other, I start a move with G, then point one of the other cube top vertices, and (with the snap active) it correctly snap (copies) the Y coordinate:

When moving on two axes lets say X and Y, since this is a top view, both coordinates get copied, so the result is this:

If instead I scale on one of the axis, lets say Y, this still works as expected. Meaning, when the closest vertex to the Y coordinate of the target vertex has the same Y coordinate, scaling stops:

But the problem starts when I want to scale on both X and Y. Fundamentally I would still expect the cube to stop scaling when the Y coordinate of the topmost vertices is the same of the vertex I’m pointing at, given that it’s impossible for the X coordinate to be the same.
What happen instead is that it stop at a weird point:

The above is what I’m trying to achieve at a fundamental level.

But this basically translates in these more specific use cases:

  1. When those cubes are in that specific position, and since they were originally of the same size, I want to scale the smallest one (or the biggest one for that matter) and make it of the same size on the axes I’m constraining, without having to move them or input any measures. I know that if I move them on top of each other, then the scale snapping works because eventually one of the corner vertices will have the same exact coordinates on both X and Y, but again this is not what I want.

  2. Lets say thought that the cubes do not have the pivot point with the same Y coordinates; here I don’t want to stop scaling when both have the same size (and I understand why this would be much more difficult to do). I want to stop scaling when whatever vertex is closest in this shape I’m scaling, has the same Y coordinates of the vertex I’m targeting. Some images again, this is the starting point (not that they don’t have the origin on the same Y coordinate):

I want a way for the scaling to stop here when targeting the circled vertex:

or here if I select the other vertex:

  1. Scaling, always on X and Y, so that the two nearest faces snap. This doesn’t seem to work (obviously Snap To is selected to Faces).

  2. If the, lets say, top most vertices of the object I’m scaling are not on the same Y axis, I would to be able to use instead Snap With “Active”, and then select which vertex I want to use as a snap “base” on the shape I’m scaling, so that when that vertex has the same Y coordinate, then the shape stops scaling.
    Again an example (note the selected vertex):

And then back to object mode scaling:

Note that all of the questions above would be the same for me when I’m in edit mode and trying to match some other object or even some other parts of the same mesh I’m editing.

Is there some other way to do this, other than moving the shapes on top of each other in a way that one of the vertices of the scaled object will eventually have the same precise coordinates (on the constrained axes) of the target object vertex?
Also the above works only if there are two separate objects, not when the object is one.

Sorry for the long winded question, but it’s that I’m trying to find the fastest ways to do these things, and I’m also thinking if I have to try to write an addon for this.
I know that there are some CAD addons that would be able to solve this, but it seems to me that they first need preparations first (like adding construction lines or guides).

The result about snapping with plane constraint is a mean between result of snapping on X axis and result of snapping on Y axis.

The issue is that you want a partially uniform scaling, but restrained only by Y axis limit.

You have to do it in 3 steps.
Do a scaling constrained on Y axis.
Then, copy Y value with a Ctrl C in F9 panel.
Paste this value as X Value in F9 panel.

Hey @zeauro, thanks for the quick answer. Indeed that’s one fast and easy way if acting in object mode which I completely forgot, because I was a bit focused on getting the behavior while using the Scale operator.

But at the same time it doesn’t work if for instance I’m scaling in edit mode (because I want to scale part of the mesh). Since in the examples I had a cube, lets say that I want to do something similar to all the above examples, but only for the top face.

EDIT: actually, I see that if you take note of the scale size on the top left when scaling on one axis, you can then scale on the other and input the same value, even in edit mode.
It would still be a bit more fluid to have the snap do the job while scaling, but I guess this is a workaround…

I also wonder when (if ever?) the current behavior of getting the mean is useful.