From a71eee7e07bd8f6f4e14b2fce8dacd64dc7d2616 Mon Sep 17 00:00:00 2001 From: malonehunter Date: Thu, 28 May 2026 14:53:40 -0400 Subject: [PATCH] ux: default loadout -> base 4; add 'Curated' preset (config.recommendedCiphers) Default-on is the clean base 4; a one-click 'Curated' preset enables an extended set defined by config.recommendedCiphers (button only renders when that list is set). config.default.js documents it; forks opt in by listing ciphers (keep in sync with the lite db.json). No db change. Co-Authored-By: Claude Opus 4.7 (1M context) --- calc/calc.js | 20 ++++++++++++++++++-- config.default.js | 5 +++++ tools/generate_db_json.py | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/calc/calc.js b/calc/calc.js index 56726ac..9dff163 100644 --- a/calc/calc.js +++ b/calc/calc.js @@ -266,8 +266,9 @@ function createCiphersMenu() { ''; o += ''; - o += - ''; + if (typeof CALC_CONFIG !== 'undefined' && Array.isArray(CALC_CONFIG.recommendedCiphers) && CALC_CONFIG.recommendedCiphers.length > 0) + o += + ''; o += ''; o += @@ -1623,6 +1624,21 @@ function enableBaseCiphers() { updateTables(); // update } +// "Curated" preset: the fork's recommended extended loadout (CALC_CONFIG.recommendedCiphers, +// = the lite-db set, so all match instantly). Button only renders when that list is non-empty. +function enableRecommendedCiphers() { + prevCiphIndex = -1; // reset cipher selection + var rec = (typeof CALC_CONFIG !== 'undefined' && Array.isArray(CALC_CONFIG.recommendedCiphers)) ? CALC_CONFIG.recommendedCiphers : []; + var cur_chkbox; + for (i = 0; i < cipherList.length; i++) { + var on = rec.indexOf(cipherList[i].cipherName) > -1; + cipherList[i].enabled = on; + cur_chkbox = document.getElementById("cipher_chkbox" + i); + if (cur_chkbox !== null) cur_chkbox.checked = on; + } + updateTables(); // update +} + function toggleCipherCategory(ciph_cat) { prevCiphIndex = -1; // reset cipher selection // Check if custom config category diff --git a/config.default.js b/config.default.js index 31acfdc..6ef5bb7 100644 --- a/config.default.js +++ b/config.default.js @@ -53,6 +53,11 @@ var CALC_CONFIG = { // defaultEnabledCiphers: ["Ordinal", "Reduction", "Reverse Ordinal", "Reverse Reduction"], defaultEnabledCiphers: [], + // Optional "Curated" preset button — a one-click extended loadout. Empty/omitted => no + // button shown. Keep in sync with the lite db.json (tools/generate_db_json.py LITE_CIPHERS). + // Example: recommendedCiphers: ["Ordinal", "Reduction", "Alphanumeric Qabbala", ...], + recommendedCiphers: [], + // --- Custom Cipher Categories --- // Group ciphers into custom menu sections. Ciphers are referenced by // their exact name from ciphers.js. They still appear in their original diff --git a/tools/generate_db_json.py b/tools/generate_db_json.py index 35d5da7..d7e1725 100644 --- a/tools/generate_db_json.py +++ b/tools/generate_db_json.py @@ -19,7 +19,7 @@ from pathlib import Path from all_ciphers import get_ciphers, compute_value # Lite db.json cipher subset for progressive first-paint. MUST stay in sync with -# production config.js `defaultEnabledCiphers` (the default 16-cipher loadout). +# production config.js `recommendedCiphers` (the 16-cipher "Curated" set). LITE_CIPHERS = [ "Ordinal", "Reduction", "Reverse Ordinal", "Reverse Reduction", "Standard", "Latin (Jewish)", "English Sumerian", "Satanic Gematria",