Skip to content

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Nov 7, 2025

Simplify breadcrumb component and add amplitude logging.

  • Removed optional key prop
  • Use layout and text components for styling
  • Improve prop types so that null labels cannot be passed to components
  • Add amplitude event tracking so we can gauge how many folks interact with our breadcrumbs

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 7, 2025
@codecov
Copy link

codecov bot commented Nov 7, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
12378 2 12376 10
View the top 2 failed test(s) by shortest run time
Discover > Landing links back to the homepage
Stack Traces | 0.14s run time
Error: expect(element).toHaveAttribute("href", ".../explore/discover/homepage/") // element.getAttribute("href") === ".../explore/discover/homepage/"

Expected the element to have attribute:
  href=".../explore/discover/homepage/"
Received:
  null
    at Object.toHaveAttribute (.../views/discover/landing.spec.tsx:119:49)
Results Events links back to the homepage through the Discover breadcrumb
Stack Traces | 0.811s run time
Error: expect(element).toHaveAttribute("href", StringMatching /^\/organizations\/org-slug\/explore\/discover\/homepage\//) // element.getAttribute("href") === StringMatching /^\/organizations\/org-slug\/explore\/discover\/homepage\//

Expected the element to have attribute:
  href=StringMatching /^\/organizations\/org-slug\/explore\/discover\/homepage\//
Received:
  null
    at Object.toHaveAttribute (.../views/discover/results.spec.tsx:1207:44)
    at runNextTicks (node:internal/process/task_queues:65:5)
    at processTimers (node:internal/timers:520:9)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@JonasBa JonasBa marked this pull request as ready for review November 7, 2025 22:12
@JonasBa JonasBa requested review from a team as code owners November 7, 2025 22:12

if (!linkLastItem) {
if (crumbs[crumbs.length - 1]?.to) {
// We should not be mutating the crumbs
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Immutability Broken: Props Mutated Directly

The code directly mutates the crumbs prop by setting crumbs[crumbs.length - 1]!.to = null, despite the comment explicitly stating "We should not be mutating the crumbs". This violates React's principle of immutability and can cause bugs if the same crumbs array is reused elsewhere or if the parent component re-renders with the same reference.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't make the rules here buddy, this existed before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants