Skip to content

Add branch name to screenshot#241

Merged
aparlato merged 4 commits intomainfrom
branch-screenshot
Jul 10, 2025
Merged

Add branch name to screenshot#241
aparlato merged 4 commits intomainfrom
branch-screenshot

Conversation

@aparlato
Copy link
Collaborator

Description

Adds the branch name to the screenshot if looking at branch styles.

@kelsey-taylor @almccon does this look alright or do we want it formatted a little differently?

Closes #240

QA steps

  • Add a branch style to your local config
  • Update the branch to some valid branch
  • Take a screenshot
  • Copy/paste screenshot to see it somewhere

Author checklist

Create the PR

  • Fill out PR template
  • Make sure you've added a CHANGELOG entry under "Unreleased"
  • Request a review
  • Make any requested changes and get approval

After approval

  • Merge any changes from main into your branch, resolve any conflicts
  • Squash & merge changes into main
  • Delete branch

@aparlato aparlato changed the title minor change to screenshot Add branch name to screenshot Jul 10, 2025
@aparlato aparlato requested a review from ebrelsford July 10, 2025 00:05
@aparlato
Copy link
Collaborator Author

@kelsey-taylor made a slight update to look like we discussed if you want to take another look!

@almccon
Copy link
Member

almccon commented Jul 10, 2025

This looks good to me. And I also realized we could be a bit more concise with our branch pattern names to make that string a bit shorter. So instead of this:

maperture-screenshot

I can rewrite our local.mjs like so:

const branchPatterns = [
     renderer: 'maplibre-gl',
     name: 'Basemap Light',
     pattern:
-      'https://xxxxxxxxxx.cloudfront.net/dist/{branch}/variants/{style}/style.json',
-    styles: ['basemap-light-en', 'basemap-light-ar'],
+      'https://xxxxxxxxxx.cloudfront.net/dist/{branch}/variants/basemap-light-{style}/style.json',
+    styles: ['en', 'ar'],
   },

Which makes it so the screenshot name doesn't wrap, like so:

maperture-screenshot-2

It's not exactly the same (maybe it would be nice if the branch pattern style was wrapped in parentheses) but it works for me. But of course, that's not a great example, because if the branch name is not as short as this one, it will wrap again:
maperture-screenshot-3

Maybe we should just accept that these will always have to be two lines when we're displaying branch names, so we should always have them display on a new line? Or is that what you tried first, @aparlato? (Sorry I didn't take a look at the original draft before it was updated)

@aparlato
Copy link
Collaborator Author

Good catch @almccon. Updated.
Long name:
image
Short name:
image

@aparlato aparlato merged commit c42c800 into main Jul 10, 2025
@aparlato aparlato deleted the branch-screenshot branch July 10, 2025 21:41
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.

Include branch name in screenshot title

4 participants