Fix @mutex decorator, text input, modal docs, group management polish

Add user groups feature, simplify flash alerts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-11 07:02:50 +00:00
parent 18928c8678
commit fd74f48e7a
5 changed files with 106 additions and 58 deletions

View File

@@ -14,7 +14,6 @@
* Features:
* - Queue system prevents alert spam (2.5s minimum between alerts)
* - Auto-dismiss after timeout (success: 4s, others: 6s)
* - Click to dismiss immediately
* - Smooth fade in/out animations
* - Bootstrap alert styling with icons
* - Persistent queue across page navigations (sessionStorage, tab-specific)
@@ -99,7 +98,7 @@ class Flash_Alert {
// Process each visible alert
this._container.find('.alert-wrapper').each((index, wrapper) => {
const $wrapper = $(wrapper);
const message_text = $wrapper.find('.alert').text().trim().replace(/×$/, '').trim();
const message_text = $wrapper.find('.alert').text().trim();
// Find this message in persistence queue to check fade_in_complete
const msg = this._persistence_queue.find(m => m.message === message_text);
@@ -476,9 +475,7 @@ class Flash_Alert {
// Check if an alert with the same message is already displayed
let duplicate_found = false;
this._container.find('.alert-wrapper').each(function () {
const existing_text = $(this).find('.alert').text().trim();
// Remove the close button text (×) for comparison
const existing_message = existing_text.replace(/×$/, '').trim();
const existing_message = $(this).find('.alert').text().trim();
if (existing_message === message) {
duplicate_found = true;
return false; // Break loop
@@ -491,8 +488,8 @@ class Flash_Alert {
return;
}
// Create alert element
const $alert = $(`<div class="alert alert-${level} alert-dismissible fade show" role="alert">`);
// Create alert element (no close button - auto-fades, click anywhere to dismiss)
const $alert = $(`<div class="alert alert-${level} fade show" role="alert">`);
// Add icon based on level
if (level === 'danger') {
@@ -505,9 +502,7 @@ class Flash_Alert {
$alert.append('<i class="bi bi-exclamation-triangle-fill me-2"></i>');
}
// Add close button
const $close_button = $('<button type="button" class="btn-close" aria-label="Close"></button>');
$alert.append($close_button).append(message);
$alert.append(message);
// Wrap in container for animation
const $alert_container = $('<div class="alert-wrapper">').append($alert);
@@ -578,12 +573,5 @@ class Flash_Alert {
close_alert(1000);
}, time_until_fadeout);
}
// Click anywhere on alert to dismiss
$alert.click(() => {
// Remove from persistence queue when manually dismissed
this._remove_from_persistence_queue(message, level);
close_alert(300);
});
}
}