Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: initiative pills change hash #370

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

thekaveman
Copy link
Member

@thekaveman thekaveman commented Jul 22, 2024

Quick follow-up to #363

  • Update the URL so it matches the initiative the user is looking at
  • Logic that shows a pill's content is now tied to the hash being changed
  • Inserts initiative content into user's history

How to test

  1. Run the app locally
  2. Ensure the existing behavior of going directly to e.g. http://localhost:4000/#initiatives-gtfs still loads that pill content
  3. Change pills
  4. Observe the window.location.hash value update accordingly
  5. Observe the associated pill content become visible
  6. Click the back button
  7. Observe the previous hash / pill content is visible

Demos

Loading the page with a hash link
load.mp4
Clicking pills and the back button
change.mp4

update the URL so it matches the initiative the user is looking at

logic that shows a pill's content is now tied to the hash being changed

inserts initiative content into user's history
@thekaveman thekaveman requested a review from a team as a code owner July 22, 2024 22:29
Copy link

netlify bot commented Jul 22, 2024

Deploy Preview for cal-itp-website ready!

Name Link
🔨 Latest commit 1fbedd7
🔍 Latest deploy log https://app.netlify.com/sites/cal-itp-website/deploys/669edd412eddd500085154b2
😎 Deploy Preview https://deploy-preview-370--cal-itp-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@thekaveman thekaveman self-assigned this Jul 23, 2024
@thekaveman thekaveman added the enhancement New feature or request label Jul 23, 2024
Copy link
Member

@machikoyasuda machikoyasuda left a comment

Choose a reason for hiding this comment

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

Tested locally and reviewed code

@thekaveman thekaveman merged commit 632025c into main Jul 24, 2024
6 checks passed
@thekaveman thekaveman deleted the refactor/initiatives-permalink-hash branch July 24, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants