File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,9 @@ async fn process_logs(
150
150
.timestamp:hover {{
151
151
text-decoration: underline;
152
152
}}
153
+ .error-marker {{
154
+ scroll-margin-bottom: 15vh;
155
+ }}
153
156
</style>
154
157
<script type="module" nonce="{nonce}">
155
158
import {{ AnsiUp }} from '{ANSI_UP_URL}'
@@ -174,7 +177,7 @@ async fn process_logs(
174
177
// 4. Add a anchor around every "##[error]" string
175
178
let errorCounter = -1;
176
179
html = html.replace(/##\[error\]/g, () =>
177
- `<a id="error-${{++errorCounter}}">##[error]</a>`
180
+ `<a id="error-${{++errorCounter}}" class="error-marker" >##[error]</a>`
178
181
);
179
182
180
183
// 5. Add the html to the DOM
@@ -183,9 +186,11 @@ async fn process_logs(
183
186
184
187
// 6. If no anchor is given, scroll to the last error
185
188
if (location.hash === "" && errorCounter >= 0) {{
189
+ const hasSmallViewport = window.innerWidth <= 750;
186
190
document.getElementById(`error-${{errorCounter}}`).scrollIntoView({{
187
- behavior: 'smooth',
188
- block: 'center'
191
+ behavior: 'instant',
192
+ block: 'end',
193
+ inline: hasSmallViewport ? 'start' : 'center'
189
194
}});
190
195
}}
191
196
</script>
You can’t perform that action at this time.
0 commit comments