Phase 4 + M5: Low-priority fixes and frontend component integration
M5: TagBadge integrated into ContactDetail (replaces plain Badge) M5: EntityHistoryPanel integrated into ContactDetail (timeline section) L1: Replace document.write() with Blob URL in print.ts (XSS-safe) L2: AI UI Control feedback storage capped at 100 entries (FIFO eviction) L3: Backup & Restore documentation added to DEPLOY.md Verified: Backend import OK, TypeScript 0 errors
This commit is contained in:
@@ -92,10 +92,20 @@ class AIUIControlWSManager:
|
||||
return None
|
||||
|
||||
def store_feedback(self, feedback: dict[str, Any]) -> None:
|
||||
"""Store feedback from frontend after command execution."""
|
||||
"""Store feedback from frontend after command execution.
|
||||
|
||||
Maintains a maximum of 100 feedback entries to prevent memory exhaustion.
|
||||
Oldest entries are removed when the limit is reached.
|
||||
"""
|
||||
command_id = feedback.get("command_id")
|
||||
if command_id:
|
||||
self._feedback[command_id] = feedback
|
||||
# Enforce max feedback entries (FIFO eviction)
|
||||
MAX_FEEDBACK_ENTRIES = 100
|
||||
if len(self._feedback) > MAX_FEEDBACK_ENTRIES:
|
||||
keys_to_remove = list(self._feedback.keys())[:-MAX_FEEDBACK_ENTRIES]
|
||||
for key in keys_to_remove:
|
||||
del self._feedback[key]
|
||||
logger.debug(f"AI UI Control: feedback stored for command {command_id}: {feedback.get('status')}")
|
||||
|
||||
def get_feedback(self, command_id: str) -> dict[str, Any] | None:
|
||||
|
||||
Reference in New Issue
Block a user