Cache system added using sqlite. Should be nicer to the server.

This commit is contained in:
Storm Dragon
2025-12-16 22:47:43 -05:00
parent 0a952afb21
commit 221224270b
10 changed files with 1950 additions and 19 deletions
+22 -1
View File
@@ -3,6 +3,8 @@ Accessible text display dialog - single point of truth for showing text to scree
Based on the implementation from Bifrost
"""
import time
from PySide6.QtWidgets import (
QDialog, QVBoxLayout, QTextEdit, QDialogButtonBox
)
@@ -15,6 +17,11 @@ class AccessibleTextDialog(QDialog):
Provides keyboard navigation, text selection, and proper focus management.
"""
# Class-level error debouncing to prevent dialog spam
_lastErrorKey: str = ""
_lastErrorTime: float = 0.0
_errorDebounceSeconds: float = 2.0
def __init__(self, title: str, content: str, dialogType: str = "info", parent=None):
"""
Initialize accessible text dialog
@@ -80,7 +87,21 @@ class AccessibleTextDialog(QDialog):
@classmethod
def showError(cls, title: str, message: str, details: str = None, parent=None):
"""Convenience method for error dialogs with optional details"""
"""Convenience method for error dialogs with optional details.
Includes debouncing to prevent the same error from spawning multiple dialogs
in rapid succession.
"""
# Debounce: skip if same error within debounce window
errorKey = f"{title}:{message}"
currentTime = time.monotonic()
if (errorKey == cls._lastErrorKey and
currentTime - cls._lastErrorTime < cls._errorDebounceSeconds):
return
cls._lastErrorKey = errorKey
cls._lastErrorTime = currentTime
if details:
content = f"{message}\n\nError Details:\n{details}"
else: