I have noticed the feature “distance covered in a city” which works good but it is not exactly my usecase.

My understanding is that the “distance covered in a city” feature calculates all km covered in the city i.e. If a street is 1km long, and I run a 0.8km stretch of this city for 10 times, then the feature would calculate that 0.8x10=8km.

What would be of use to me is the idea of remaining kilometers. Continuing with the example above, I would want to see 0.2km as distance remaing.

The easy path for me would be to sum up the distance of all incomplete streets. This would be slightly inaccurate, if you’ve partially completed some of them.

I’ll need to look into if/how I can calculate that partially completed distance, to subtract it from the sum.

Your 0.8km example wouldn’t equal out to 0.2km remaining in any scenario, though. In my ‘easy path’ scenario, it would indicate 10km remaining & in my other scenario (if I can math out partial distances) it would indicate 9.2km remaining.
(edit after your fixed typo)

The current display is a sum of distances for any activity that progresses any street. If you run a route that completes a street, and then the next day run the exact same route, that second activity will not count towards your total distance. Similarly, if you have a favorite route that you have run hundreds of times then only the first time you’ve done the route counts towards your total distance.

This does count the full distance for an activity that e.g. covers miles of previously completed streets and also covers a small previously incompleted area. I consider this working as designed, since that previously completed section could be the path you need to take in order to get to an incomplete neighborhood … it counts, because we cannot be 100% efficient.

So for your 0.8km example…
If you’re running this 0.8km 10 times in order to reach other streets that you need to complete, then that 0.8km counts 10 times because you needed to run that distance to complete those streets.

If you’re running this 0.8km 10 times because it’s a fun loop that never completes more streets, then it is only counted the first time you run it (the first time that it progresses/completes any street).