Skip to content

Conversation

@anandaroop
Copy link
Member

@anandaroop anandaroop commented Dec 5, 2025

Caution

Unmergeable until unified artist page is updated and rolled out to 100% of users. This PR may require some rebasing once that happens.

The type of this PR is: Feat

This PR solves DIAM-218

Description

Sets up the permanent redirects we want in light of the change to the unified artist page.

301 Redirect

In order to preserve link juice for these now obsolete routes we want to 301 redirect them to their unified artist page counterparts:

old route new anchor
/artist/:id/about /artist/:id#JUMP--artistAboutTop
/artist/:id/auction-results /artist/:id#JUMP--marketSignalsTop

Namespaced auction params

We preserve the pre-existing logic to munge auction-related params into a namespace…

?sort=ESTIMATE → ?auction[sort]=ESTIMATE

…in order to play nice with the unified page logic.

Scroll to content

And we preserve the behavior of scrolling to the appropriate section once it is ready (and clean up the current URL accordingly).

Result

The net result is a sequence like the following

  • User follows an old link:

    • /artist/banksy/auction-results?sort=ESTIMATE_AND_DATE_DESC
  • Server detects the route & params and then 301 redirects:

    • /artist/banksy?auction%5Bsort%5D=ESTIMATE_AND_DATE_DESC#JUMP--marketSignalsTop
  • Client detects the hash and waits-then-scrolls to the appropriate section, then cleans up the URL

    • /artist/banksy?auction%5Bsort%5D=ESTIMATE_AND_DATE_DESC

redirect2

@anandaroop anandaroop self-assigned this Dec 5, 2025
This will allow us to use just the query munging logic in the new
redirect we are about to write next.
@relativeci
Copy link

relativeci bot commented Dec 5, 2025

#5470 Bundle Size — 9.51MiB (-0.01%).

15edf90(current) vs 287f2a8 main#5464(baseline)

Warning

Bundle contains 34 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Improvement 1 improvement
                 Current
#5470
     Baseline
#5464
Improvement  Initial JS 3.7MiB(-0.01%) 3.7MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 45.59% 37.47%
No change  Chunks 102 102
No change  Assets 105 105
No change  Modules 5949 5949
No change  Duplicate Modules 603 603
No change  Duplicate Code 4.51% 4.51%
No change  Packages 297 297
No change  Duplicate Packages 33 33
Bundle size by type  Change 1 change Improvement 1 improvement
                 Current
#5470
     Baseline
#5464
Improvement  JS 9.37MiB (-0.01%) 9.37MiB
No change  Other 144.17KiB 144.17KiB

Bundle analysis reportBranch anandaroop/DIAM-218-redirects-v2Project dashboard


Generated by RelativeCIDocumentationReport issue

@anandaroop anandaroop force-pushed the anandaroop/DIAM-218-redirects-v2 branch from 91bd3d0 to efcafb5 Compare December 5, 2025 18:51
@anandaroop anandaroop force-pushed the anandaroop/DIAM-218-redirects-v2 branch from efcafb5 to 15edf90 Compare December 5, 2025 19:12
Copy link
Member Author

Choose a reason for hiding this comment

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

Performing the redirects here with the RedirectException pattern.

Comment on lines +136 to +139
render: ({ match }) => {
const redirectUrl = `/artist/${match.params.artistID}#JUMP--artistAboutTop`
throw new RedirectException(redirectUrl, 301)
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Here and above I use the anchor that already exists in the markup, then use the the effect to scroll to the content, and remove the hash from the URL.

I felt the urge to remove it because it seems to have kind of an "internal" (JUMP--…) feel to it.

But should we leave the hash? I guess that would make auction/about URLs be more copy-pasteable 🤷🏽

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 refactored this file so that I could use just the query namespacing logic, separated out from the redirecting logic.

Tbh I'm not quite sure what all's going on here, e.g. with the casing stuff, but I've preserved the existing behavior.

Comment on lines +104 to +106
// When the page is accessed via a URL that contains a hash to a jump link
// anchor -- as in the case of the 301 redirects we've set up --
// we similarly scroll to the appropriate section and clean up the URL
Copy link
Member Author

Choose a reason for hiding this comment

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

This code is similar but not exactly the same as the other scrollToSection so it seemed reasonable to duplicate it here.

@anandaroop anandaroop requested review from a team and dzucconi December 5, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants