Skip to content

Commit 1b42966

Browse files
Profiler totals row should not be part of results. (#629)
* Profiler totals rows are not part of results. The previous code had the chance of removing the profiler-totals when the max traces to show limit is hit, due to the profiler-results with profiler-totals row being the first row. * changelog entry + version bump
1 parent 8c880e1 commit 1b42966

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [FIX] `flamegraph_mode` query param having no effect. [#635](https://github.com/MiniProfiler/rack-mini-profiler/pull/635)
1010
- [FEATURE] Show record type and count in SQL query UI. [#638](https://github.com/MiniProfiler/rack-mini-profiler/pull/638)
1111
- [FEATURE] Show Active Record QueryCache hits in UI. [#640](https://github.com/MiniProfiler/rack-mini-profiler/pull/640)
12+
- [FIX] max_traces_to_show had chance to break the profiler frontend [#297](https://github.com/MiniProfiler/rack-mini-profiler/issues/297)
1213

1314
## 3.3.1 - 2024-02-15
1415
- [FEATURE] Support dynamic `config.content_security_policy_nonce` [#609](https://github.com/MiniProfiler/rack-mini-profiler/pull/609)

lib/html/includes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ var _MiniProfiler = (function() {
285285
}); // limit count
286286

287287
if (
288-
container.querySelectorAll(".profiler-result").length >
288+
container.querySelectorAll(".profiler-result:not(:has(.profiler-totals))").length >
289289
options.maxTracesToShow
290290
) {
291-
var elem = container.querySelector(".profiler-result");
291+
var elem = container.querySelector('.profiler-result:not(:has(.profiler-totals))');
292292

293293
if (elem) {
294294
elem.parentElement.removeChild(elem);

0 commit comments

Comments
 (0)