fix: ora le ricerche lavorano nuovamente in cache. feat: aggiunto pulsante per eliminare rapidamente una ricerca testuale. feat: la ricerca in alto a destra rimanda alla ricerca spudorata ed il campo viene liberato.

This commit is contained in:
Gabriele Cimaschi committed 2026-08-26 14:23:20 +02:00
1 parent c5e17ca57a
commit c0c8a2531c
4 files changed
+57 -54

No files matched your search

+19 -23
View File
@@ -24,36 +24,32 @@ const RicercaSpudorataView = {
Filters.load();
const container = document.getElementById('view-container');
container.innerHTML = `
<div class="loading-screen">
<div class="spinner"></div>
<p>Inizializzazione Ricerca Spudorata...</p>
</div>
`;
if (!container) return;
await App.ensureLookups();
const urlParams = new URLSearchParams((window.location.hash.split('?')[1]) || '');
const qParam = urlParams.get('q');
try {
const settings = await App.api('/api/dashboard/settings');
if (settings && settings.tickets_per_page) {
this.perPage = settings.tickets_per_page;
}
} catch (err) {
console.warn('Failed to load agent settings:', err);
if (qParam && qParam !== this.searchTerm) {
this.renderContainer(container);
this.bindEvents();
const input = document.getElementById('spudorata-search-input');
if (input) input.value = qParam;
this.executeSearch(qParam);
return;
}
// Instant render from memory cache if already searched
if (this.hasSearched && this.cachedTickets) {
this.renderContainer(container);
this.bindEvents();
this.renderLocalResults();
return;
}
this.renderContainer(container);
this.bindEvents();
const urlParams = new URLSearchParams((window.location.hash.split('?')[1]) || '');
const qParam = urlParams.get('q');
if (qParam && !this.hasSearched) {
const input = document.getElementById('spudorata-search-input');
if (input) input.value = qParam;
this.executeSearch(qParam);
} else if (this.hasSearched && this.cachedTickets) {
this.renderLocalResults();
}
App.ensureLookups();
},
renderContainer(container) {