Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-111997.svg)](#build--distribution)
[![Electron](https://img.shields.io/badge/Electron-43-47848F.svg)](https://www.electronjs.org/)
[![Downloads](https://img.shields.io/github/downloads/CaYatur/SoundVisualizer/total?label=downloads)](https://github.com/CaYatur/SoundVisualizer/releases)
[![Tests](https://img.shields.io/badge/tests-2543%20passing-2ea043.svg)](#tests)
[![Tests](https://img.shields.io/badge/tests-2547%20passing-2ea043.svg)](#tests)
[![cayadev.com](https://img.shields.io/badge/cayadev.com-e11d2a.svg)](https://cayadev.com)

</div>
Expand Down Expand Up @@ -1341,7 +1341,7 @@ npm test
npm start -- --smoke
```

**2543 unit tests, all passing.** They are written to check answers, not to exercise lines:
**2547 unit tests, all passing.** They are written to check answers, not to exercise lines:

- **Formulas** are checked against values derived by hand from their definitions — Viviani's curve
staying on its sphere, the torus tube radius, Chladni's m↔n antisymmetry, every attractor
Expand Down
4 changes: 2 additions & 2 deletions README.tr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-111997.svg)](#paketleme--dağıtım)
[![Electron](https://img.shields.io/badge/Electron-43-47848F.svg)](https://www.electronjs.org/)
[![İndirme](https://img.shields.io/github/downloads/CaYatur/SoundVisualizer/total?label=indirme)](https://github.com/CaYatur/SoundVisualizer/releases)
[![Test](https://img.shields.io/badge/test-2543%20geçiyor-2ea043.svg)](#testler)
[![Test](https://img.shields.io/badge/test-2547%20geçiyor-2ea043.svg)](#testler)
[![cayadev.com](https://img.shields.io/badge/cayadev.com-e11d2a.svg)](https://cayadev.com)

</div>
Expand Down Expand Up @@ -1341,7 +1341,7 @@ npm test
npm start -- --smoke
```

**2543 birim testi, hepsi geçiyor.** Satır çalıştırmak için değil, cevap denetlemek için yazıldılar:
**2547 birim testi, hepsi geçiyor.** Satır çalıştırmak için değil, cevap denetlemek için yazıldılar:

- **Formüller**, tanımlarından elle türetilmiş değerlerle sınanıyor — Viviani eğrisinin küre
üzerinde kalması, simidin boru yarıçapı, Chladni'nin m↔n antisimetrisi, her çekicinin sınırlı
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ npm test
npm start -- --smoke
```

- **2543 unit tests, all passing** on `main`. 703 of those shipped in v3.1.0;
- **2547 unit tests, all passing** on `main`. 703 of those shipped in v3.1.0;
105 came with v3.1.1; 163 came with v3.1.2; 157 came with v3.1.3 — 1128 at
that tag — 469 more with v3.1.4, most of them from the MilkDrop work, and 878
on `main` since.
Expand Down
31 changes: 0 additions & 31 deletions src/admin/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -828,11 +828,6 @@ select:focus { border-color: var(--accent); }
}
.footer-end { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.footer .hint { font-size: 11px; line-height: 1.35; color: var(--muted2); text-align: right; }
#updatesBtn.has-update {
color: var(--ok);
border-color: var(--ok);
background: rgba(67, 217, 138, .14);
}
kbd { background: var(--card2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 10.5px; }

/* scrollbar */
Expand All @@ -842,32 +837,6 @@ kbd { background: var(--card2); border: 1px solid var(--line); border-radius: 5p
::-webkit-scrollbar-track { background: transparent; }

/* Settings is the left-rail Ayarlar category; Updates is a footer modal. */
.upd-backdrop {
position: fixed; inset: 0; z-index: 410; display: grid; place-items: center;
background: rgba(3, 3, 8, .62); backdrop-filter: blur(3px);
animation: askIn .12s ease-out;
padding: 20px;
}
.upd-backdrop.hidden { display: none; }
.upd-modal {
width: min(520px, calc(100vw - 40px)); max-height: min(820px, calc(100vh - 40px));
overflow: auto; padding: 18px 18px 16px;
border: 1px solid var(--line2); border-radius: 14px;
background: var(--card); box-shadow: 0 28px 80px rgba(0, 0, 0, .6);
}
.upd-modal-head {
display: flex; align-items: center; justify-content: space-between; gap: 12px;
margin-bottom: 14px;
}
.upd-modal-head h2 { font-size: 16px; font-weight: 700; }
.upd-modal-close {
width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
background: transparent; color: var(--muted); font-size: 18px; line-height: 1;
cursor: pointer;
}
.upd-modal-close:hover { background: var(--card2); color: var(--text); }
.upd-modal-body .ctrl { margin-bottom: 12px; }
.upd-modal-body .upd-panel { margin-top: 4px; }

/* ================= UYGULAMA İÇİ ONAY + BİLDİRİM =================
Sistem confirm/alert pencereleri renderer'ı kilitliyor ve çok ekranlı
Expand Down
59 changes: 48 additions & 11 deletions src/admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,23 @@
},
{
id: 'templates',
roots: ['visualizer', 'background', 'postfx'],
/* Badge/reset must cover every SCENE_KEYS field apply() touches.
Partial roots left modulation/layers/geometry dirty and — with
layerStack on — syncStackState re-cleared classic visualizer to
'none' after a partial reset, so the badge bounced back alone. */
roots: (window.SVTemplates && window.SVTemplates.SCENE_KEYS
? window.SVTemplates.SCENE_KEYS.slice()
: ['background', 'visualizer', 'geometry', 'postfx', 'layers', 'layerStack', 'logo',
'modulation', 'transition', 'custom', 'milkdrop', 'images', 'feedback']),
/* Same preserves as templates.apply / resetScene — user setup, not scene. */
rootOmit: [
'background.transparent', 'background.transparentKey', 'background.coverTaskbar',
'logo.src', 'logo.libraryId', 'logo.kind', 'logo.source', 'logo.enabled',
],
/* TEMP: hide card modified badge + circular reset on Ready Templates.
Applying a template still changes SCENE_KEYS; re-enable by setting
hideCardReset: false once resetScene bounce is fully validated UX-wise. */
hideCardReset: true,
category: 'library',
icon: 'sparkles',
wide: true,
Expand Down Expand Up @@ -2895,7 +2911,7 @@
},
{
/* Uygulama: Dil / Pencere / Panel. Güncellemeler ayrı tam genişlik
kartta (settings-updates) ve footer indirme düğmesi modalında. */
kartta (settings-updates). Footer indirme modalı kaldırıldı. */
id: 'settings-main',
category: 'settings',
wide: true,
Expand Down Expand Up @@ -3077,6 +3093,11 @@
return out;
}

function sectionShowsResetChrome(sec) {
/* hideCardReset: TEMP gate for Ready Templates card chrome. */
return !(sec && sec.hideCardReset);
}

function countModified(paths) {
return paths.filter(isModified).length;
}
Expand All @@ -3086,6 +3107,7 @@
sectionSchema().forEach((sec) => {
if (sec.category !== catId) return;
if (sec.show && !sec.show()) return;
if (!sectionShowsResetChrome(sec)) return;
n += countModified(sectionPaths(sec));
});
return n;
Expand Down Expand Up @@ -3169,7 +3191,7 @@
root.classList.toggle('single', sections.length === 1 || sections.every((s) => s.wide));

// Sıfırlanacak bir şey yoksa (ör. Kitaplık) düğme boşuna durmasın
const resettable = sections.some((s) => countModified(sectionPaths(s)) > 0);
const resettable = sections.some((s) => sectionShowsResetChrome(s) && countModified(sectionPaths(s)) > 0);
$('catResetBtn').classList.toggle('hidden', !resettable);

sections.forEach((sec) => {
Expand Down Expand Up @@ -3245,7 +3267,7 @@
const tail = visible.filter((d) => d.tail);
const showAdvanced = advancedOn;

const modCount = countModified(sectionPaths(sec));
const modCount = sectionShowsResetChrome(sec) ? countModified(sectionPaths(sec)) : 0;
const head = el('div', { class: 'card-head' }, [
el('span', { class: 'ico', icon: sec.icon }),
el('div', { class: 'ch-main' }, [
Expand Down Expand Up @@ -3369,7 +3391,7 @@
sections.forEach((sec, i) => {
const card = cards[i];
if (!card) return;
const n = countModified(sectionPaths(sec));
const n = sectionShowsResetChrome(sec) ? countModified(sectionPaths(sec)) : 0;
let chip = card.querySelector('.chip-mod');
const acts = card.querySelector('.ch-actions');
if (n > 0 && !chip && acts) {
Expand All @@ -3393,7 +3415,7 @@
});

renderNav();
const resettable = sections.some((s) => countModified(sectionPaths(s)) > 0);
const resettable = sections.some((s) => sectionShowsResetChrome(s) && countModified(sectionPaths(s)) > 0);
const catBtn = $('catResetBtn');
if (catBtn) catBtn.classList.toggle('hidden', !resettable);
}
Expand All @@ -3407,15 +3429,29 @@
}

async function resetSection(sec) {
if (sec && sec.hideCardReset) return;
const paths = sectionPaths(sec);
if (!paths.length) return;
const ok = await svConfirm('Bu bölümdeki ayarlar varsayılana dönecek.', { danger: true, okText: 'Bölümü sıfırla' });
if (!ok) return;
const defaults = window.SV.defaultConfig();
paths.forEach((p) => {
const dv = getPath(defaults, p);
if (dv !== undefined) setPath(cfg, p, window.SV.clone(dv));
});
/* Ready Templates: whole-object SCENE_KEYS restore (not leaf setPath).
Leaf reset missed array/object identity and left layerStack on, so
the next syncStackState re-dirtied visualizer.type back to 'none'. */
if (sec.id === 'templates' && window.SVTemplates && typeof window.SVTemplates.resetScene === 'function') {
window.SVTemplates.resetScene(cfg, {
defaultConfig: window.SV.defaultConfig,
clone: window.SV.clone,
});
if (window.SVTemplatePanel && typeof window.SVTemplatePanel.clearLastApplied === 'function') {
window.SVTemplatePanel.clearLastApplied();
}
} else {
const defaults = window.SV.defaultConfig();
paths.forEach((p) => {
const dv = getPath(defaults, p);
if (dv !== undefined) setPath(cfg, p, window.SV.clone(dv));
});
}
push(true);
render();
}
Expand Down Expand Up @@ -3593,6 +3629,7 @@
sectionSchema()
.filter((s) => s.category === catId && (!s.show || s.show()))
.forEach((sec) => {
if (!sectionShowsResetChrome(sec)) return;
sectionPaths(sec).forEach((p) => {
const dv = getPath(defaults, p);
if (dv !== undefined) setPath(cfg, p, window.SV.clone(dv));
Expand Down
13 changes: 1 addition & 12 deletions src/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,11 @@ <h3>Sahneler</h3>
<footer class="footer">
<button id="resetBtn" class="btn ghost small" data-icon="reset">Varsayılanlara Sıfırla</button>
<div class="footer-end">
<button id="updatesBtn" class="icon-btn" type="button" aria-label="Güncellemeler" title="Güncellemeler" data-icon="download"></button>
<span class="hint">Görselleştirme ekranında <kbd>ESC</kbd> ile çıkış • Ayarlar otomatik kaydedilir</span>
</div>
</footer>

<!-- ================= GÜNCELLEMELER MODALI ================= -->
<div id="updatesBackdrop" class="upd-backdrop hidden" aria-hidden="true">
<section class="upd-modal" role="dialog" aria-modal="true" aria-labelledby="updatesTitle">
<div class="upd-modal-head">
<h2 id="updatesTitle">Güncellemeler</h2>
<button id="updatesClose" class="upd-modal-close" type="button" aria-label="Kapat" title="Kapat">×</button>
</div>
<div id="updatesModalBody" class="upd-modal-body"></div>
</section>
</div>



<script src="../shared/defaults.js"></script>
<script src="../shared/icons.js"></script>
Expand Down
5 changes: 4 additions & 1 deletion src/admin/template-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,8 @@
P().toast('"' + t.name + '" uygulandı.');
}

window.SVTemplatePanel = { panel };
window.SVTemplatePanel = {
panel,
clearLastApplied() { lastApplied = ''; },
};
})();
Loading
Loading