From 24b4eda887a0b994280e0b485d491970c7913e7a Mon Sep 17 00:00:00 2001 From: Antoine Marguerie Date: Fri, 29 May 2026 15:44:53 +0200 Subject: [PATCH 01/36] [Local profiler] Filter sections by name --- CHANGELOG.md | 3 +- lib/rorvswild/local/javascript/local.js | 125 +++++++++++++++++++---- lib/rorvswild/local/local.html.erb | 11 +- lib/rorvswild/local/stylesheet/local.css | 58 +++++++++++ 4 files changed, 172 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b45093e..174ecaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## Unreleased * Local profiler: - * Filter by section kind in sections breakdown + * Filter sections by kind in sections breakdown + * Filter sections by name ## 1.11.1 (2026-03-16) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 2a0e291..b3cd93b 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -94,35 +94,118 @@ RorVsWild.Local.prototype.toggleLowImpactSections = function(event) { } } +RorVsWild.Local.prototype.getActiveKindFilter = function() { + var active = document.querySelector("[data-rorvswild-local-breakdown-item].is-active") + return active ? active.dataset.kind : null +} + +RorVsWild.Local.prototype.getSectionNameFilter = function() { + var input = document.querySelector("[data-rorvswild-local-section-filter]") + return input ? input.value.trim() : "" +} + +RorVsWild.Local.escapeHtml = function(text) { + var element = document.createElement("div") + element.textContent = text + return element.innerHTML +} + +RorVsWild.Local.highlightMatches = function(text, query) { + if (!query) return RorVsWild.Local.escapeHtml(text) + + var lowerText = text.toLowerCase() + var lowerQuery = query.toLowerCase() + var result = "" + var start = 0 + var index + + while ((index = lowerText.indexOf(lowerQuery, start)) !== -1) { + result += RorVsWild.Local.escapeHtml(text.slice(start, index)) + result += '' + result += RorVsWild.Local.escapeHtml(text.slice(index, index + query.length)) + result += "" + start = index + query.length + } + + result += RorVsWild.Local.escapeHtml(text.slice(start)) + return result +} + +RorVsWild.Local.prototype.clearSectionNameHighlights = function() { + document.querySelectorAll("[data-rorvswild-local-filter-text]").forEach(function(element) { + if (element.dataset.rorvswildLocalSectionNameOriginal !== undefined) { + element.innerHTML = element.dataset.rorvswildLocalSectionNameOriginal + delete element.dataset.rorvswildLocalSectionNameOriginal + } + }) +} + +RorVsWild.Local.prototype.highlightFilterText = function(query) { + document.querySelectorAll("[data-rorvswild-local-section]").forEach(function(section) { + var element = section.querySelector("[data-rorvswild-local-filter-text]") + if (!element) return + + if (section.classList.contains("is-hidden")) { + if (element.dataset.rorvswildLocalSectionNameOriginal !== undefined) { + element.innerHTML = element.dataset.rorvswildLocalSectionNameOriginal + delete element.dataset.rorvswildLocalSectionNameOriginal + } + return + } + + if (element.dataset.rorvswildLocalSectionNameOriginal === undefined) + element.dataset.rorvswildLocalSectionNameOriginal = element.innerHTML + + element.innerHTML = RorVsWild.Local.highlightMatches(element.textContent, query) + }) +} + +RorVsWild.Local.prototype.applySectionFilters = function() { + var kind = this.getActiveKindFilter() + var query = this.getSectionNameFilter() + var hasNameFilter = query.length > 0 + var toggleButton = document.querySelector("[data-rorvswild-local-toggle-low-impact]") + + document.querySelectorAll("[data-rorvswild-local-section]").forEach(function(section) { + var name = (section.dataset.rorvswildLocalSectionName || "").toLowerCase() + var matchesKind = !kind || section.dataset.kind === kind + var matchesName = !hasNameFilter || name.indexOf(query.toLowerCase()) !== -1 + + if (matchesKind && matchesName) { + section.classList.remove("is-hidden") + } else { + section.classList.add("is-hidden") + } + }) + + if (hasNameFilter) { + if (toggleButton) toggleButton.style.display = "none" + this.highlightFilterText(query) + } else { + this.clearSectionNameHighlights() + if (kind) { + if (toggleButton) toggleButton.style.display = "none" + } else { + this.resetLowImpactSections() + if (toggleButton) toggleButton.style.display = "" + } + } +} + +RorVsWild.Local.prototype.filterSectionsByName = function(event) { + this.applySectionFilters() +} + RorVsWild.Local.prototype.filterByKind = function(event) { var li = event.currentTarget - var kind = li.dataset.kind var isActive = li.classList.contains("is-active") - var toggleButton = document.querySelector("[data-rorvswild-local-toggle-low-impact]") document.querySelectorAll("[data-rorvswild-local-breakdown-item]").forEach(function(el) { el.classList.remove("is-active") }) - var sections = document.querySelectorAll("[data-rorvswild-local-section]") - - if (isActive) { - this.resetLowImpactSections() - sections.forEach(function(section) { - if (!section.hasAttribute("data-rorvswild-local-low-impact")) section.classList.remove("is-hidden") - }) - if (toggleButton) toggleButton.style.display = "" - } else { - li.classList.add("is-active") - sections.forEach(function(section) { - if (section.dataset.kind === kind) { - section.classList.remove("is-hidden") - } else { - section.classList.add("is-hidden") - } - }) - if (toggleButton) toggleButton.style.display = "none" - } + if (!isActive) li.classList.add("is-active") + this.applySectionFilters() } RorVsWild.Local.prototype.expand = function() { diff --git a/lib/rorvswild/local/local.html.erb b/lib/rorvswild/local/local.html.erb index d382ee3..c1fd6ae 100644 --- a/lib/rorvswild/local/local.html.erb +++ b/lib/rorvswild/local/local.html.erb @@ -164,18 +164,23 @@ {{/sectionsImpactPerKind}} +
+ +
+ + From 8d7489a476a2ba5c8929761b727eaccd50de995a Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Mon, 15 Jun 2026 17:35:11 +0200 Subject: [PATCH 04/36] Deduplicate restoreOriginalContent --- lib/rorvswild/local/javascript/local.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 20b44b5..88a2f47 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -131,13 +131,15 @@ RorVsWild.Local.highlightMatches = function(text, query) { return result } +RorVsWild.Local.prototype.restoreOriginalContent = function(element) { + if (element.dataset.rorvswildLocalSectionNameOriginal) { + element.innerHTML = element.dataset.rorvswildLocalSectionNameOriginal + delete element.dataset.rorvswildLocalSectionNameOriginal + } +} + RorVsWild.Local.prototype.clearSectionNameHighlights = function() { - document.querySelectorAll("[data-rorvswild-local-filter-text]").forEach(function(element) { - if (element.dataset.rorvswildLocalSectionNameOriginal !== undefined) { - element.innerHTML = element.dataset.rorvswildLocalSectionNameOriginal - delete element.dataset.rorvswildLocalSectionNameOriginal - } - }) + document.querySelectorAll("[data-rorvswild-local-filter-text]").forEach(this.restoreOriginalContent) } RorVsWild.Local.prototype.highlightFilterText = function(query) { @@ -145,19 +147,14 @@ RorVsWild.Local.prototype.highlightFilterText = function(query) { var element = section.querySelector("[data-rorvswild-local-filter-text]") if (!element) return - if (section.classList.contains("is-hidden")) { - if (element.dataset.rorvswildLocalSectionNameOriginal !== undefined) { - element.innerHTML = element.dataset.rorvswildLocalSectionNameOriginal - delete element.dataset.rorvswildLocalSectionNameOriginal - } - return - } + if (section.classList.contains("is-hidden")) + return this.restoreOriginalContent(element) if (element.dataset.rorvswildLocalSectionNameOriginal === undefined) element.dataset.rorvswildLocalSectionNameOriginal = element.innerHTML element.innerHTML = RorVsWild.Local.highlightMatches(element.textContent, query) - }) + }.bind(this)) } RorVsWild.Local.prototype.filterSections = function() { From aa2319e010f47e2259d7d36c19681070e03dcabe Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Thu, 18 Jun 2026 09:30:03 +0200 Subject: [PATCH 05/36] Simplify branching --- lib/rorvswild/local/javascript/local.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 88a2f47..90fcef6 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -176,17 +176,13 @@ RorVsWild.Local.prototype.filterSections = function() { }) if (hasNameFilter) { - if (toggleButton) toggleButton.style.display = "none" this.highlightFilterText(query) } else { this.clearSectionNameHighlights() - if (kind) { - if (toggleButton) toggleButton.style.display = "none" - } else { - this.resetLowImpactSections() - if (toggleButton) toggleButton.style.display = "" - } + if (!kind) this.resetLowImpactSections() } + + if (toggleButton) toggleButton.style.display = hasNameFilter || kind ? "none" : "" } RorVsWild.Local.prototype.filterByKind = function(event) { From adb0908944632a81bb9f7e697340b5eca58649b6 Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Thu, 18 Jun 2026 09:32:52 +0200 Subject: [PATCH 06/36] Reuse Mustache.escape instead of having a custom function --- lib/rorvswild/local/javascript/local.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 90fcef6..5473f93 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -104,14 +104,8 @@ RorVsWild.Local.prototype.getSectionNameFilter = function() { return input ? input.value.trim() : "" } -RorVsWild.Local.escapeHtml = function(text) { - var element = document.createElement("div") - element.textContent = text - return element.innerHTML -} - RorVsWild.Local.highlightMatches = function(text, query) { - if (!query) return RorVsWild.Local.escapeHtml(text) + if (!query) return Mustache.escape(text) var lowerText = text.toLowerCase() var lowerQuery = query.toLowerCase() @@ -120,14 +114,14 @@ RorVsWild.Local.highlightMatches = function(text, query) { var index while ((index = lowerText.indexOf(lowerQuery, start)) !== -1) { - result += RorVsWild.Local.escapeHtml(text.slice(start, index)) + result += Mustache.escape(text.slice(start, index)) result += '' - result += RorVsWild.Local.escapeHtml(text.slice(index, index + query.length)) + result += Mustache.escape(text.slice(index, index + query.length)) result += "" start = index + query.length } - result += RorVsWild.Local.escapeHtml(text.slice(start)) + result += Mustache.escape(text.slice(start)) return result } From 09ec7d6a31f44c0b2c95c3f8c5d0677fb3d276a5 Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Thu, 18 Jun 2026 10:00:24 +0200 Subject: [PATCH 07/36] Restore initial state for low impact sections --- lib/rorvswild/local/javascript/local.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 5473f93..52a317a 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -3,6 +3,7 @@ var RorVsWild = this.RorVsWild = {}; RorVsWild.Local = function(container) { this.root = container this.active = false + this.lowImpactExpanded = false RorVsWild.Local.editorUrl = container.dataset.editorUrl if (this.embedded = location.pathname != "/rorvswild") window.addEventListener("keydown", this.keydown.bind(this)) @@ -80,6 +81,7 @@ RorVsWild.Local.prototype.resetLowImpactSections = function() { section.classList.add("is-hidden") }) if (button) button.textContent = "↓ View low impact sections" + this.lowImpactExpanded = false } RorVsWild.Local.prototype.toggleLowImpactSections = function(event) { @@ -89,6 +91,7 @@ RorVsWild.Local.prototype.toggleLowImpactSections = function(event) { if (isHidden) { sections.forEach(function(section) { section.classList.remove("is-hidden") }) event.currentTarget.textContent = "↑ Hide low impact sections" + this.lowImpactExpanded = true } else { this.resetLowImpactSections() } @@ -173,7 +176,7 @@ RorVsWild.Local.prototype.filterSections = function() { this.highlightFilterText(query) } else { this.clearSectionNameHighlights() - if (!kind) this.resetLowImpactSections() + if (!kind && !this.lowImpactExpanded) this.resetLowImpactSections() } if (toggleButton) toggleButton.style.display = hasNameFilter || kind ? "none" : "" From 7a85298bff741c2738fd7b7495b5047638a74e9b Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Thu, 18 Jun 2026 14:09:27 +0200 Subject: [PATCH 08/36] Get rid of attribute data-rorvswild-local-section-name --- lib/rorvswild/local/javascript/local.js | 3 ++- lib/rorvswild/local/local.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 52a317a..b5339b9 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -161,7 +161,8 @@ RorVsWild.Local.prototype.filterSections = function() { var toggleButton = document.querySelector("[data-rorvswild-local-toggle-low-impact]") document.querySelectorAll("[data-rorvswild-local-section]").forEach(function(section) { - var name = (section.dataset.rorvswildLocalSectionName || "").toLowerCase() + var filterElement = section.querySelector("[data-rorvswild-local-filter-text]") + var name = filterElement ? filterElement.textContent.trim().toLowerCase() : "" var matchesKind = !kind || section.dataset.kind === kind var matchesName = !hasNameFilter || name.indexOf(query.toLowerCase()) !== -1 diff --git a/lib/rorvswild/local/local.html.erb b/lib/rorvswild/local/local.html.erb index 7a57d10..cfb4fcf 100644 --- a/lib/rorvswild/local/local.html.erb +++ b/lib/rorvswild/local/local.html.erb @@ -172,7 +172,7 @@ @@ -137,7 +141,11 @@ {{runtime}}ms {{queuedAt}} - {{> RorVsWild.Local.Sections}} + {{/currentJob}} +
+ {{> RorVsWild.Local.Sections}} +
+ {{#currentJob}} {{/currentJob}} @@ -148,39 +156,39 @@ {{#sections}} {{> RorVsWild.Local.Section}} {{/sections}} - {{#hasLowImpactSections}} + {{#showLowImpactToggle}}
- +
- {{/hasLowImpactSections}} + {{/showLowImpactToggle}} @@ -141,11 +139,9 @@ {{runtime}}ms {{queuedAt}} - {{/currentJob}} -
- {{> RorVsWild.Local.Sections}} -
- {{#currentJob}} +
+ {{> RorVsWild.Local.Sections}} +
{{/currentJob}} From c759da3d34c655eb3366b670136a8cd410baafeb Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Fri, 19 Jun 2026 11:21:36 +0200 Subject: [PATCH 20/36] Remove dead CSS and cleanup --- lib/rorvswild/local/local.html.erb | 4 +--- lib/rorvswild/local/stylesheet/local.css | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/rorvswild/local/local.html.erb b/lib/rorvswild/local/local.html.erb index 87bae32..f3ae74c 100644 --- a/lib/rorvswild/local/local.html.erb +++ b/lib/rorvswild/local/local.html.erb @@ -169,12 +169,10 @@ {{/sectionsImpactPerKind}}
- +
- - @@ -139,9 +137,7 @@ {{runtime}}ms {{queuedAt}} -
- {{> RorVsWild.Local.Sections}} -
+
{{/currentJob}} From 6b4947a0848139813d1904a061017da2f73a00b4 Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Fri, 19 Jun 2026 12:07:29 +0200 Subject: [PATCH 22/36] Rename RorVsWild.Local.Request to RorVsWild.Local.Execution --- lib/rorvswild/local/javascript/local.js | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 349c9d2..2a14e6a 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -13,14 +13,14 @@ RorVsWild.Local = function(container) { RorVsWild.Local.prototype.getRequests = function(callback) { this.getJson("/rorvswild/requests.json", function(data) { - this.requests = data.map(function(attributes) { return new RorVsWild.Local.Request(attributes) }) + this.requests = data.map(function(attributes) { return new RorVsWild.Local.Execution(attributes) }) callback() }.bind(this)) } RorVsWild.Local.prototype.getJobs = function(callback) { this.getJson("/rorvswild/jobs.json", function(data) { - this.jobs = data.map(function(attributes) { return new RorVsWild.Local.Request(attributes) }) + this.jobs = data.map(function(attributes) { return new RorVsWild.Local.Execution(attributes) }) callback() }.bind(this)) } @@ -200,7 +200,7 @@ RorVsWild.Local.nextId = function() { return RorVsWild.Local.lastId += 1 } -RorVsWild.Local.Request = function(data) { +RorVsWild.Local.Execution = function(data) { this.data = data this.uuid = data.uuid this.name = data.name @@ -210,21 +210,21 @@ RorVsWild.Local.Request = function(data) { this.resetSectionFilters() } -RorVsWild.Local.Request.prototype.runtime = function() { +RorVsWild.Local.Execution.prototype.runtime = function() { return RorVsWild.Local.relevantRounding(this.data.runtime) } -RorVsWild.Local.Request.prototype.resetSectionFilters = function() { +RorVsWild.Local.Execution.prototype.resetSectionFilters = function() { this.sectionKindFilter = null this.sectionQueryFilter = "" this.lowImpactExpanded = false } -RorVsWild.Local.Request.prototype.isFilteringSections = function() { +RorVsWild.Local.Execution.prototype.isFilteringSections = function() { return this.sectionKindFilter != null || this.sectionQueryFilter.length > 0 } -RorVsWild.Local.Request.prototype.filterSections = function(sections) { +RorVsWild.Local.Execution.prototype.filterSections = function(sections) { var kind = this.sectionKindFilter var query = this.sectionQueryFilter var filtering = this.isFilteringSections() @@ -236,7 +236,7 @@ RorVsWild.Local.Request.prototype.filterSections = function(sections) { }.bind(this)) } -RorVsWild.Local.Request.prototype.visibleSections = function() { +RorVsWild.Local.Execution.prototype.visibleSections = function() { var query = this.sectionQueryFilter return this.filterSections(this.sections).map(function(section) { return Object.assign({}, section, { @@ -245,7 +245,7 @@ RorVsWild.Local.Request.prototype.visibleSections = function() { }) } -RorVsWild.Local.Request.prototype.loadSections = function() { +RorVsWild.Local.Execution.prototype.loadSections = function() { var self = this this.sections = this.data.sections.map(function(section) { var runtime = (section.total_runtime - section.children_runtime) @@ -275,7 +275,7 @@ RorVsWild.Local.Request.prototype.loadSections = function() { }).sort(function(a, b) { return b.selfRuntime - a.selfRuntime }) } -RorVsWild.Local.Request.prototype.sectionsImpactPerKind = function() { +RorVsWild.Local.Execution.prototype.sectionsImpactPerKind = function() { if (!this.sections.length) return [] var total = 0 @@ -294,15 +294,15 @@ RorVsWild.Local.Request.prototype.sectionsImpactPerKind = function() { }.bind(this)) } -RorVsWild.Local.Request.prototype.showLowImpactToggle = function() { +RorVsWild.Local.Execution.prototype.showLowImpactToggle = function() { return !this.isFilteringSections() && this.sections.some(function(section) { return section.isLowImpact }) } -RorVsWild.Local.Request.prototype.lowImpactToggleLabel = function() { +RorVsWild.Local.Execution.prototype.lowImpactToggleLabel = function() { return this.lowImpactExpanded ? "↑ Hide low impact sections" : "↓ View low impact sections" } -RorVsWild.Local.Request.prototype.renderSections = function() { +RorVsWild.Local.Execution.prototype.renderSections = function() { var container = document.querySelector("[data-rorvswild-local-sections-container]") if (!container) return @@ -324,7 +324,7 @@ RorVsWild.Local.Request.prototype.renderSections = function() { } } -RorVsWild.Local.Request.prototype.toggleSection = function(event) { +RorVsWild.Local.Execution.prototype.toggleSection = function(event) { var id = parseInt(event.currentTarget.dataset.sectionId, 10) var section = this.sections.find(function(section) { return section.id === id }) if (!section) return @@ -333,17 +333,17 @@ RorVsWild.Local.Request.prototype.toggleSection = function(event) { event.currentTarget.closest(".rorvswild-local-panel__details__section").classList.toggle("is-open", section.isOpen) } -RorVsWild.Local.Request.prototype.toggleLowImpactSections = function() { +RorVsWild.Local.Execution.prototype.toggleLowImpactSections = function() { this.lowImpactExpanded = !this.lowImpactExpanded this.renderSections() } -RorVsWild.Local.Request.prototype.filterSectionsByText = function(event) { +RorVsWild.Local.Execution.prototype.filterSectionsByText = function(event) { this.sectionQueryFilter = event.currentTarget.value.trim().toLowerCase() this.renderSections() } -RorVsWild.Local.Request.prototype.filterSectionsByKind = function(event) { +RorVsWild.Local.Execution.prototype.filterSectionsByKind = function(event) { var kind = event.currentTarget.dataset.kind this.sectionKindFilter = this.sectionKindFilter === kind ? null : kind this.renderSections() From abb36a58dbdb15cc6d9e6df78660f4c9b1104a69 Mon Sep 17 00:00:00 2001 From: Alexis Bernard Date: Fri, 19 Jun 2026 15:22:01 +0200 Subject: [PATCH 23/36] Split sections template to prevent from re-rendering search input --- lib/rorvswild/local/javascript/local.js | 35 +++++++++++----------- lib/rorvswild/local/local.html.erb | 37 +++++++++++++----------- lib/rorvswild/local/stylesheet/local.css | 3 +- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/lib/rorvswild/local/javascript/local.js b/lib/rorvswild/local/javascript/local.js index 2a14e6a..0e51bbc 100644 --- a/lib/rorvswild/local/javascript/local.js +++ b/lib/rorvswild/local/javascript/local.js @@ -302,26 +302,24 @@ RorVsWild.Local.Execution.prototype.lowImpactToggleLabel = function() { return this.lowImpactExpanded ? "↑ Hide low impact sections" : "↓ View low impact sections" } -RorVsWild.Local.Execution.prototype.renderSections = function() { - var container = document.querySelector("[data-rorvswild-local-sections-container]") +RorVsWild.Local.Execution.prototype.renderSectionHeader = function() { + var container = document.querySelector("[data-rorvswild-local-sections-header]") if (!container) return - var active = document.activeElement - var refocusFilter = active && active.classList.contains("rorvswild-local-panel__section-filter__input") - var selectionStart = refocusFilter && active.selectionStart - var selectionEnd = refocusFilter && active.selectionEnd + Barber.render("RorVsWild.Local.Sections.Header", this, container) +} + +RorVsWild.Local.Execution.prototype.renderSectionList = function() { + var container = document.querySelector("[data-rorvswild-local-sections-list]") + if (!container) return - Barber.render("RorVsWild.Local.Sections", this, container) + Barber.render("RorVsWild.Local.Sections.List", this, container) Prism.highlightAllUnder(container) +} - if (refocusFilter) { - var input = container.querySelector(".rorvswild-local-panel__section-filter__input") - if (input) { - input.focus() - if (selectionStart != null && selectionEnd != null) - input.setSelectionRange(selectionStart, selectionEnd) - } - } +RorVsWild.Local.Execution.prototype.renderSections = function() { + this.renderSectionHeader() + this.renderSectionList() } RorVsWild.Local.Execution.prototype.toggleSection = function(event) { @@ -335,18 +333,19 @@ RorVsWild.Local.Execution.prototype.toggleSection = function(event) { RorVsWild.Local.Execution.prototype.toggleLowImpactSections = function() { this.lowImpactExpanded = !this.lowImpactExpanded - this.renderSections() + this.renderSectionList() } RorVsWild.Local.Execution.prototype.filterSectionsByText = function(event) { this.sectionQueryFilter = event.currentTarget.value.trim().toLowerCase() - this.renderSections() + this.renderSectionList() } RorVsWild.Local.Execution.prototype.filterSectionsByKind = function(event) { var kind = event.currentTarget.dataset.kind this.sectionKindFilter = this.sectionKindFilter === kind ? null : kind - this.renderSections() + this.renderSectionHeader() + this.renderSectionList() } RorVsWild.Local.Error = function(data) { diff --git a/lib/rorvswild/local/local.html.erb b/lib/rorvswild/local/local.html.erb index 949a6b2..a1f5061 100644 --- a/lib/rorvswild/local/local.html.erb +++ b/lib/rorvswild/local/local.html.erb @@ -119,7 +119,10 @@ {{runtime}}ms {{queuedAt}} -
+
+
+
+
{{/currentRequest}} @@ -137,26 +140,15 @@ {{runtime}}ms {{queuedAt}} -
+
+
+
+
{{/currentJob}} - - - + + - - -