Fix past activities tab resetting to upcoming when paginating#682
Draft
Copilot wants to merge 2 commits into
Draft
Fix past activities tab resetting to upcoming when paginating#682Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…pages - Change tab buttons to anchor links with URL-based navigation (events_path for upcoming, events_path(tab: 1) for past) - Add data-tabs-index-value from params[:tab] so the Stimulus Tabs controller initializes to the correct tab on page load - Add data-turbo-action="replace" for better browser history behavior - Add role="tab" for accessibility When navigating to /events?tab=1, the server renders with data-tabs-index-value="1" and Pagy includes tab=1 in all pagination links (via request.GET). Clicking a pagination link navigates to /events?tab=1&page=N, which again renders with the past tab selected. Agent-Logs-Url: https://github.com/DispuutHamers/webapp/sessions/ea1ab744-e12e-48cc-a394-f1b410d59536 Co-authored-by: koenjdejong <74268574+koenjdejong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix navigation issue in past activities page
Fix past activities tab resetting to upcoming when paginating
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Navigating to a different page in the past activities section always reset the view to the upcoming tab because the Stimulus
tabscontroller initialized withindexValue = 0unconditionally, and the tab<button>elements had novalueattribute makingchange()non-functional.Changes
/eventsfor upcoming,/events?tab=1for past), delegating tab switching to Turbo navigation instead of client-side JSdata-tabs-index-value="<%= params[:tab].to_i %>"added to the controller element so the Stimulus Tabs controller initializes from the server-rendered URL param on every page loaddata-turbo-action="replace"on tab links to avoid polluting browser history with tab staterole="tab"added for accessibility (the controller already managesaria-selecteddynamically)Pagy naturally propagates
tab=1through all pagination links viarequest.GET, so no changes to the pagination partial or controller are needed. The full navigation chain:/events?tab=1→ Pagy generates/events?tab=1&page=N→ each page renders withdata-tabs-index-value="1".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:
ddnexus.github.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either: