Skip to content

change hardcoded links in theme pull to use methods to surface urls instead#6881

Merged
FKauwe merged 1 commit intomainfrom
fix-hardcoded-links-in-theme-pull
Feb 24, 2026
Merged

change hardcoded links in theme pull to use methods to surface urls instead#6881
FKauwe merged 1 commit intomainfrom
fix-hardcoded-links-in-theme-pull

Conversation

@FKauwe
Copy link
Contributor

@FKauwe FKauwe commented Feb 21, 2026

WHY are these changes introduced?

The theme pull command had hardcoded links for previewing your theme, and launching the theme editor.

Fixes #1063

WHAT is this pull request doing?

The hardcoded links were replaced by themePreviewUrl and themeEditorUrl methods.

The themePreviewURL function builds the url following two paths and one path can lead to the url looking slightly different than the original string behavior (it truncates the url if theme.role === live, but I tested both urls in my browser and they went to the same place.
This is the Before + After:
Before:

[1] https://f9e81e-af.myshopify.com/?preview_theme_id=145364484332
[2] https://f9e81e-af.myshopify.com/admin/themes/145364484332/editor

After:

[1] https://f9e81e-af.myshopify.com
[2] https://f9e81e-af.myshopify.com/admin/themes/145364484332/editor

The After is cleaner for this edge case and doesn't add the unnecessary preview part, as the theme is live and the url can point to the live view.

I noticed there were no unittests testing renderSuccess but that other sibling tests do test that and the message surfaced to user, so I added that test

How to test your changes?

  • while on main, run p build, then shopify-dev theme pull -e <local-env-name> in external terminal
  • choose a live theme to pull to see the edge case
  • note the older, longer url surfaced to the user after the renderSuccess message
  • pull my branch down locally: fix-hardcoded-links-in-theme-pull
  • p build
  • run shopify-dev theme pull -e <local-env-name> in external terminal
  • note the newer url without the unnecessary preview appended (if you chose a live theme).
  • If you choose an unpublished theme to pull the urls remain exactly the same

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

@FKauwe FKauwe requested a review from EvilGenius13 February 21, 2026 02:15
@FKauwe FKauwe self-assigned this Feb 21, 2026
@FKauwe FKauwe requested review from a team as code owners February 21, 2026 02:15
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2026

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.91% 14556/18447
🟡 Branches 73.24% 7224/9863
🟡 Functions 79.12% 3705/4683
🟡 Lines 79.25% 13762/17365

Test suite run success

3778 tests passing in 1455 suites.

Report generated by 🧪jest coverage report action from b776177

Copy link
Contributor

@EvilGenius13 EvilGenius13 left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @FKauwe!

@EvilGenius13
Copy link
Contributor

Let's add a patch level changeset. Since the success message used to show ?preview_theme_id when it was a live theme, it's an observable change in the CLI output.

Copy link
Contributor

@aswamy aswamy left a comment

Choose a reason for hiding this comment

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

Tested it out and looks good for live and unpublished themes 👍

Unpublished:
Image

Live:
Image

@FKauwe FKauwe force-pushed the fix-hardcoded-links-in-theme-pull branch from 7c8e368 to b776177 Compare February 24, 2026 17:59
@FKauwe FKauwe added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 4d26220 Feb 24, 2026
25 checks passed
@FKauwe FKauwe deleted the fix-hardcoded-links-in-theme-pull branch February 24, 2026 18:29
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.

3 participants