Skip to content

Commit c42c800

Browse files
authored
Add branch name to screenshot (#241)
1 parent 489ff8e commit c42c800

File tree

7 files changed

+29
-8
lines changed

7 files changed

+29
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Shorten URLs by reducing map state kept in the hash to the minimum
44
- Don't set RTL text plugin if already in progress
5+
- Add branch name to screenshots if looking at branch pattern
56

67
## 0.17.0
78

dist/bundle.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/CustomJsUi.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
mapObj = state?.[index];
1313
});
1414
15-
const { customJs } = $configStore;
15+
const { customJs = [] } = $configStore;
1616
1717
$: validActions = customJs.filter(js => js.mapIds.includes(mapId));
1818

src/components/Map.svelte

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,21 @@
146146
$: setMapComponent(mapRenderer);
147147
148148
$: mapStateProps = getMapStateProps($$restProps);
149+
150+
$: console.log(map);
149151
</script>
150152
151153
<div class="map-container">
152-
<div class="screenshot-label-transparent">{map.name ?? map.id}</div>
154+
<div class="screenshot-label-transparent">
155+
{#if map?.branch}
156+
<div class="screenshot-text">
157+
{map.screenshotName ?? map.name ?? map.id}
158+
<span class="screenshot-label-bold">&nbsp;{map.branch}</span>
159+
</div>
160+
{:else}
161+
{map.name ?? map.id}
162+
{/if}
163+
</div>
153164
{#key mapRenderer}
154165
<div class="map" class:highlight-diff={highlightDifferences}>
155166
<svelte:component
@@ -226,6 +237,14 @@
226237
align-items: center;
227238
}
228239
240+
.screenshot-text {
241+
text-align: center;
242+
}
243+
244+
.screenshot-label-bold {
245+
font-weight: bold;
246+
}
247+
229248
.screenshot-label-transparent {
230249
display: none;
231250
}

src/components/MapStyleInputWrapper.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
if (pattern?.styles?.length) {
162162
const branchValues = pattern?.styles.map(s => {
163163
return {
164+
screenshotName: `${pattern.name ?? pattern.id}: ${s} on`,
164165
name: `${pattern.name ?? pattern.id}: ${s} on...`,
165166
branchId: pattern?.id,
166167
id: s,

0 commit comments

Comments
 (0)