Skip to content

Fix browser back button not working on PipelineRun detail page#4826

Merged
tekton-robot merged 1 commit intotektoncd:mainfrom
chrism417:fix-back-button-navigation
Mar 26, 2026
Merged

Fix browser back button not working on PipelineRun detail page#4826
tekton-robot merged 1 commit intotektoncd:mainfrom
chrism417:fix-back-button-navigation

Conversation

@chrism417
Copy link
Copy Markdown
Contributor

@chrism417 chrism417 commented Mar 18, 2026

Changes

This fixes #4783.

When a task is selected on the PipelineRun detail page, TaskRunDetails auto-sets the view=logs query param via a useEffect. This was pushing a new history entry each time, creating an infinite back-button loop: pressing back removed the param, which triggered the effect to re-add it.

Fix

  • Pass { replace: true } in TaskRunDetails when auto-setting view=logs so it replaces the current history entry instead of pushing a new one
  • Update getViewChangeHandler to accept and forward the replace option

/kind bug

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (new features, significant UI changes, API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Fix browser back button not working on PipelineRun detail page

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 18, 2026
@tekton-robot tekton-robot requested a review from AlanGreene March 18, 2026 17:27
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 18, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 18, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: chrism417 / name: Chris Mooney (2c8c4f6)

Copy link
Copy Markdown
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @chrism417. The TaskRunDetails change looks good but we need to avoid breaking changes to the PipelineRun component.

Comment thread packages/components/src/components/PipelineRun/PipelineRun.jsx
Comment thread src/containers/PipelineRun/PipelineRun.jsx Outdated
@chrism417 chrism417 force-pushed the fix-back-button-navigation branch from 3895950 to cd49523 Compare March 18, 2026 20:30
@chrism417 chrism417 requested a review from AlanGreene March 19, 2026 12:53
@chrism417
Copy link
Copy Markdown
Contributor Author

Hi @AlanGreene, I pushed some changes based on your comments above, let me know if the latest push is correct now. Thanks!

Copy link
Copy Markdown
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

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

Hi Chris, thanks again for the PR. From my local testing it doesn't look like the changes in the PipelineRun component are needed, the change to add replace: true in TaskRunDetails appears to be sufficient to fix the back button behaviour.

Did you identify a particular scenario that required the changes you made in the PipelineRun component? If so, please share some more details about this including a reproducing example if possible so I can better understand the impact.

@chrism417 chrism417 force-pushed the fix-back-button-navigation branch from cd49523 to 9785a31 Compare March 26, 2026 15:53
Use replace navigation for auto-selected query params (pipelineTask, view) so they don't push extra history entries. The view=logs auto-set in TaskRunDetails created an infinite back-button loop: pressing back removed the param, which triggered the effect to re-add it.

Fixes #4783
@chrism417 chrism417 force-pushed the fix-back-button-navigation branch from 9785a31 to 2c8c4f6 Compare March 26, 2026 15:56
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 26, 2026
@chrism417
Copy link
Copy Markdown
Contributor Author

Hi Alan,
You're right. The PipelineRun changes aren't needed for the back-button fix. The core issue was the onViewChange('logs') in TaskRunDetails pushing a new history entry. I've pushed the changes up, let me know your thoughts! Thanks again

@chrism417 chrism417 requested a review from AlanGreene March 26, 2026 16:04
Copy link
Copy Markdown
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

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

The change looks good now, thanks Chris 👍

Can you update the PR description to remove references to the PIpelineRun changes and to reflect the current state?

Once that's done we can mark this ready to merge.

@tekton-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlanGreene

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2026
@chrism417
Copy link
Copy Markdown
Contributor Author

Just updated, let me know. Thank you for taking the time to review it!

@AlanGreene
Copy link
Copy Markdown
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2026
@tekton-robot tekton-robot merged commit 4868820 into tektoncd:main Mar 26, 2026
17 checks passed
@chrism417 chrism417 deleted the fix-back-button-navigation branch March 26, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser back button broken after navigating to PipelineRun details

3 participants