This is not a request to switch the X axis to distance instead of time.
The way the workout overlay is plotted over the power chart right now simply makes no sense if the steps are distance based. It is objectively wrong; it is confusing; it makes the user second-guess their devices or the algorithms. It is not possible to correct this simply by shifting the whole line with the slider shown above; it is not a constant offset. If it is hard for the team to view this as a bug then feel free to move it to Feature Requests, that’s hardly the main point. 
The way it is plotted right now probably was decided back then because intervals.icu already knows how to guesstimate the durations from the workout builder steps alone (which it must - for displaying the planned workout before it is executed this is a requirement of course, and overall this estimation works very well to predict the workout duration), and at the time the graph was implemented this was simply overlayed. No offence to anyone, it is clear that sometimes a quick solution is better than none at all, and it does work perfectly fine for time-based workouts.
The proposed solution would be to adjust the thin blue line (the overlay on the power display, in my screenshots) to still be plotted on the timeline, but have the X coordinates be adjusted via a reverse lookup of the distance. It would then work fine for both time- and distance-based workouts, and even for mixed ones. intervals.icu already sums up the time-distance data from the FIT file; it is displayed right there in the screenshot.
(N.b., it would still be off for steps including the “press lap” button, but that would be a suggestion for a different topic, possibly involving the LAP markers contained within a FIT file itself - totally different, totally out of scope, please disregard for now).
Pseudo code replacing the way the blue line is plotted now would be like this, using only data structures that clearly are already present within intervals.icu (they are displayed right there in the screenshots):
current_step_start_time = 0
fit_file = (object representing the current FIT file)
workout = (object representing the workout builder steps associated with it)
distance_chart = (the existing graph displaying the distance on a timeline)
for step in workout.steps:
if step.volume_metric = "time":
current_step_end_time = current_step_start_time + step.duration
elif step.volume_metric = "distance":
current_step_end_time = calc_end_time_from_distance(current_step_start_time, step.distance)
else:
panic # are there other possible volume metrics? I don't think so?
# Note: still gives wrong results with steps based on "press lap", ignore that for now...
plot_thin_blue_line(current_step_start_time, current_step_end_time, step.y_axis_value)
current_step_start_time = current_step_end_time
The distance-time conversion is done like this, basically a reversal of the existing time-distance plot, based on the fact that it is a monotously increasing graph:
def calc_end_time_from_distance(start_time, distance):
start_distance = distance_chart[start_time]
seconds = 0
while start_time + seconds < fit_file.duration:
if distance_chart[start_time + seconds] - start_distance >= distance:
break
seconds += 1
return start_time + duration
I do not know how to make it any clearer; I am just a random computer scientist and data engineer and not a native english speaker - I seem to have trouble getting my ideas across on this forum, sometimes. Maybe the pseudo code helps. If you guys think that it is not necessary or useful to display this line correctly in this way, then I rest my case. I am not asking to implement it exactly as I wrote, it’s just supposed to be a rigorous way to express my idea. I’m sure @david would come up with a proper solution himself with his deep knowledge about what data structures he has available in the code. I do not make a request to put this high on the priority list; obviously the team has to take the priority, effort and availability of the coders into consideration.
Thanks for the efforts, all!