feat(flow): smart default view (3 days + preset buttons)

Change default period from 7 to 3 days. Add quick-select preset
buttons (3 zile / 7 zile / 30 zile) that sync with the dropdown.
Reduces noise for daily operators who only need recent orders.

Cache-bust: style.css?v=22, dashboard.js?v=30

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-27 12:38:24 +00:00
parent b52313faf6
commit 4a589aafeb
3 changed files with 52 additions and 3 deletions

View File

@@ -203,6 +203,9 @@ async function loadSchedulerStatus() {
function wireFilterBar() {
// Period dropdown
document.getElementById('periodSelect')?.addEventListener('change', function () {
document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active'));
const matchBtn = document.querySelector(`.preset-btn[data-days="${this.value}"]`);
if (matchBtn) matchBtn.classList.add('active');
const cr = document.getElementById('customRangeInputs');
if (this.value === 'custom') {
cr?.classList.add('visible');
@@ -240,6 +243,20 @@ function wireFilterBar() {
loadDashOrders();
}, 300);
});
// Period preset buttons
document.querySelectorAll('.preset-btn[data-days]').forEach(btn => {
btn.addEventListener('click', function() {
document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active'));
this.classList.add('active');
const days = this.dataset.days;
const sel = document.getElementById('periodSelect');
if (sel) { sel.value = days; }
document.getElementById('customRangeInputs')?.classList.remove('visible');
dashPage = 1;
loadDashOrders();
});
});
}
// ── Dashboard Orders Table ────────────────────────