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

fix: /user/[username] route/page browser support issue #1580

Merged

Conversation

babblebey
Copy link
Contributor

@babblebey babblebey commented Aug 19, 2023

Description

This Pull Request addresses the browser compatibility issue causing regression on the /user/[username] route on some mobile browsers, which arose from the usage of at array method in the component below...

https://github.com/open-sauced/insights/blob/c4c56098826f085e5c551e088ac4fc3ada969f34/components/organisms/ContributorProfileTab/contributor-profile-tab.tsx#L67

Changes Made

  • Considering the intention was to select the last item on the array returned from router.pathname.split('/'), I replaced the usage of at array method with a computation of [array].length - 1 then use the derived value as index to access needed item.
const pathnames = router.pathname.split("/");
pathnameRef.current = pathnames[pathnames.length - 1];

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Fixes #1493

Mobile & Desktop Screenshots/Recordings

Before

image

After

screencast-bpconcjcammlapcogcnnelfmaeghhagj-2023.08.19-18_14_05.webm

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 docs.opensauced.pizza
  • 🍕 dev.to/opensauced
  • 📕 storybook
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

NA

[optional] What gif best describes this PR or how it makes you feel?

giphy (1)

@netlify
Copy link

netlify bot commented Aug 19, 2023

Deploy Preview for design-insights ready!

Name Link
🔨 Latest commit 46fe710
🔍 Latest deploy log https://app.netlify.com/sites/design-insights/deploys/64e263c8bfb6250007f34ddb
😎 Deploy Preview https://deploy-preview-1580--design-insights.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.

@netlify
Copy link

netlify bot commented Aug 19, 2023

Deploy Preview for oss-insights ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 46fe710
🔍 Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/64e263c8659d4400089920e5
😎 Deploy Preview https://deploy-preview-1580--oss-insights.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.

@babblebey babblebey marked this pull request as ready for review August 20, 2023 19:17
@nickytonline
Copy link
Member

Looks like Next.js is polyfilling this. See vercel/next.js#44436. Not sure what version it will land in.

@bdougie bdougie requested a review from brandonroberts August 21, 2023 19:00
Copy link
Contributor

@OgDev-01 OgDev-01 left a comment

Choose a reason for hiding this comment

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

LGTM 🍕

@brandonroberts brandonroberts merged commit 336a43e into open-sauced:beta Aug 22, 2023
open-sauced bot pushed a commit that referenced this pull request Aug 22, 2023
## [1.61.0-beta.8](v1.61.0-beta.7...v1.61.0-beta.8) (2023-08-22)

### 🐛 Bug Fixes

* fix crash on `/user/[username]` route due to browser support issue ([#1580](#1580)) ([336a43e](336a43e))
open-sauced bot pushed a commit that referenced this pull request Aug 24, 2023
## [1.61.0](v1.60.0...v1.61.0) (2023-08-24)

### 🍕 Features

* "Following" button to "Unfollow" on hover ([#1588](#1588)) ([721cc36](721cc36))
* add Maintainer badge to dashboard `HoverCard` and `ContributorCard` ([#1586](#1586)) ([ea34f7e](ea34f7e))
* add subscription management section to user settings ([#1587](#1587)) ([3ceb2c8](3ceb2c8))
* highlight blogs ([#1555](#1555)) ([4058f79](4058f79))
* Support full URLs when adding repo to insights page ([#1470](#1470)) ([ee53414](ee53414))

### 🐛 Bug Fixes

* "53y" showing up as first PR age in Contributor hover Card for dashboard ([#1609](#1609)) ([03522c9](03522c9))
* add bg color to reports select filter ([#1570](#1570)) ([90f381c](90f381c))
* correct position of create highlight button ([#1565](#1565)) ([2ce44bd](2ce44bd))
* corrected Alignment for mobile view ([#1578](#1578)) ([0d23330](0d23330))
* corrected repo card for mobile ([#1577](#1577)) ([779862d](779862d))
* fix crash on `/user/[username]` route due to browser support issue ([#1580](#1580)) ([336a43e](336a43e))
* highlights nav item unselected when there were query params in URL ([#1584](#1584)) ([68c3916](68c3916))
* highlights page endless flicker on tab change (1576) ([#1582](#1582)) ([56a3da9](56a3da9))
* keep UserCard from leaving the viewport on sticky sidebar ([#1585](#1585)) ([5b33b13](5b33b13))
* overflows in insights page on md screen size ([#1590](#1590)) ([69ec31e](69ec31e))
* query param reset in repo filters & URL encoding ([#1597](#1597)) ([c5c7df3](c5c7df3))
* refetch following count after following a user ([#1596](#1596)) ([cb31fd1](cb31fd1))
* remove tagged repos from highlight ([#1595](#1595)) ([26a2be6](26a2be6))
* show checkbox for repos table in small screens ([#1559](#1559)) ([a6e6bb3](a6e6bb3))
* update react-spring imports and upgrade @react-spring/web ([#1567](#1567)) ([44c80af](44c80af))
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.

Bug: Error on /user/[username] route on some Mobile browsers
4 participants