Skip to content

builds: jump to the failed command via #error hash or button - #750

Draft
ericholscher wants to merge 3 commits into
mainfrom
claude/ext-theme-error-scroll-z0lN9
Draft

builds: jump to the failed command via #error hash or button#750
ericholscher wants to merge 3 commits into
mainfrom
claude/ext-theme-error-scroll-z0lN9

Conversation

@ericholscher

@ericholscher ericholscher commented May 27, 2026

Copy link
Copy Markdown
Member

Context

When a build fails, give the user a way to jump to the failed command without scrolling through the log — but only when they ask for it.

The earlier version of this PR scrolled unconditionally when polling finished, which @agjohnson pointed out was jarring: loading any failed build dragged you to the bottom of a potentially very long page whether or not that's what you came for. The trigger now has to come from the user:

  • #error URL hash — opening /.../builds/123/#error resolves to the first failed command, expands it, and scrolls. Intended for deep-linking from GitHub PR comments.
  • Jump to failed command button on the old-style build-error banner (the one shown when build.error is set).

Both routes go through set_selected_line so the existing KO view logic runs (per @agjohnson's earlier review on #745): expand the command, mark the line, scroll into view, update the URL hash.

A synthetic build-error notification (for the case where the build failed but no notifications were attached) is a possible follow-up.


Generated by Claude Code.

Drop the unconditional scroll on polling finish. Trigger via the #error
URL hash (deep-linkable from GitHub PR comments) or a Jump to failed
command button on the old-style error banner.

https://claude.ai/code/session_01WMqzCHGaaGEfiUpT8bpZPR
@ericholscher ericholscher changed the title builds: scroll to the first failed command on the build detail page builds: jump to the failed command via #error hash or button May 27, 2026

@humitos humitos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this behavior makes sense to me.

Comment thread src/js/build/detail.js
this.commands = ko.observableArray(build.commands);
/** @computed {Boolean} Does the build have at least one failed command? */
this.has_failed_command = ko.computed(() => {
return this.commands().some((command) => command.exit_code() > 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return this.commands().some((command) => command.exit_code() > 0);
return this.commands().some((command) => command.exit_code() !== 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should we consider 183 for skip builds as a special case here?

Comment thread src/js/build/detail.js
*/
set_selected_line_from_first_failed_command() {
const failed_command = ko.utils.arrayFirst(this.commands(), (command) => {
return command.exit_code() > 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return command.exit_code() > 0;
return command.exit_code() !== 0;

Comment on lines +218 to +222
<a class="ko hidden ui inverted basic small button"
data-bind="css: { hidden: !has_failed_command() }, click: set_selected_line_from_first_failed_command">
<i class="fad fa-arrow-down icon"></i>
{% trans "Jump to failed command" %}
</a>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a screenshot showing how this looks?

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.

3 participants