Merge pull request #101 from wagesj45/codex/add-visual-queue-for-button-selection

Improve rule option button clarity
This commit is contained in:
Jordan Wages 2025-07-16 00:40:32 -05:00 committed by GitHub
commit fcee9a4e8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -78,7 +78,8 @@ Sortana is implemented entirely with standard WebExtension scripts—no custom e
reorder them, check *Only apply to unread messages* to skip read mail, reorder them, check *Only apply to unread messages* to skip read mail,
set optional minimum or maximum message age limits, select the accounts or set optional minimum or maximum message age limits, select the accounts or
folders a rule should apply to. Use the folders a rule should apply to. Use the
slashed-circle/check button to disable or re-enable a rule, and slashed-circle/check button to disable or re-enable a rule. The small
circle buttons for optional conditions show a filled dot when active, and
check *Stop after match* to halt further processing. Forward and reply actions check *Stop after match* to halt further processing. Forward and reply actions
open a compose window using the account that received the message. open a compose window using the account that received the message.
3. Save your settings. New mail will be evaluated automatically using the 3. Save your settings. New mail will be evaluated automatically using the

View file

@ -286,12 +286,18 @@ document.addEventListener('DOMContentLoaded', async () => {
const btn = document.createElement('button'); const btn = document.createElement('button');
btn.type = 'button'; btn.type = 'button';
btn.className = 'button is-small is-light'; btn.className = 'button is-small is-light';
btn.textContent = label; const icon = document.createElement('img');
icon.width = 16;
icon.height = 16;
icon.className = 'mr-1';
btn.appendChild(icon);
btn.append(label);
let active = checkbox ? checkbox.checked : sectionEl && !sectionEl.classList.contains('is-hidden'); let active = checkbox ? checkbox.checked : sectionEl && !sectionEl.classList.contains('is-hidden');
function update() { function update() {
btn.classList.toggle('is-info', active); btn.classList.toggle('is-active', active);
icon.src = browser.runtime.getURL(`resources/svg/${active ? 'circledot' : 'circle'}.svg`);
if (sectionEl) sectionEl.classList.toggle('is-hidden', !active); if (sectionEl) sectionEl.classList.toggle('is-hidden', !active);
if (checkbox) checkbox.checked = active; if (checkbox) checkbox.checked = active;
} }