Skip to content

Fix inverted workout target positioning on right-aligned powerbars#74

Merged
timklge merged 2 commits intomasterfrom
copilot/fix-powerbar-target-alignment
Feb 15, 2026
Merged

Fix inverted workout target positioning on right-aligned powerbars#74
timklge merged 2 commits intomasterfrom
copilot/fix-powerbar-target-alignment

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 13, 2026

In split mode, right-aligned powerbars grow from right to left (barLeft = fullWidth - (halfWidth * p)), but workout targets were positioned using left-to-right logic.

Changes

  • Target position calculation for HorizontalPowerbarLocation.RIGHT: Changed from halfWidth + (halfWidth * target) to fullWidth - (halfWidth * target) to mirror progress bar rendering
  • Min/max target zone boundaries: Swapped to maintain minTargetX < maxTargetX under inverted coordinates
// Before
HorizontalPowerbarLocation.RIGHT -> if (target != null) halfWidth + (halfWidth * target!!).toFloat() else 0f

// After  
HorizontalPowerbarLocation.RIGHT -> if (target != null) fullWidth - (halfWidth * target!!).toFloat() else 0f

Target indicators now align with progress bar position on right-aligned displays.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/gradle-launcher-8.7.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/agents/gradle-instrumentation-agent-8.7.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.7 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Workout target on right-aligned powerbar is inverted</issue_title>
<issue_description>When following a workout, the extension marks the target on the bar (usually overlaid by the text box in ERG mode).

However, this is currently inverted on right-aligned power bars that grow from right to center of the screen in split mode. The target value is placed as if the bar was grown from the left.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: timklge <2026103+timklge@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inverted workout target on right-aligned powerbar Fix inverted workout target positioning on right-aligned powerbars Feb 13, 2026
Copilot AI requested a review from timklge February 13, 2026 20:08
@timklge timklge marked this pull request as ready for review February 13, 2026 20:49
@timklge timklge merged commit a7ebf89 into master Feb 15, 2026
1 check passed
@timklge timklge deleted the copilot/fix-powerbar-target-alignment branch February 15, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workout target on right-aligned powerbar is inverted

2 participants