[31388f42] Feat: Persist drafts and enhance UI warnings
This commit introduces two key improvements to the Lead Engine:
1. **Persistent Email Drafts:**
- Adds a new function to .
- Modifies to save generated email replies directly to the column in the database, ensuring they persist across sessions.
- Removes the previous session-based state for drafts.
2. **Enhanced UI Visibility:**
- Adds a warning icon (⚠️) directly to the lead expander's title if a lead is flagged as low-quality, making it easier to spot.
This commit is contained in:
@@ -127,6 +127,14 @@ def update_lead_status(lead_id, status, response_draft=None):
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
def update_lead_draft(lead_id, draft_text):
|
||||
"""Saves a generated email draft to the database."""
|
||||
conn = sqlite3.connect(DB_PATH)
|
||||
c = conn.cursor()
|
||||
c.execute('UPDATE leads SET response_draft = ? WHERE id = ?', (draft_text, lead_id))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
def reset_lead(lead_id):
|
||||
"""Resets a lead to 'new' status and clears enrichment data."""
|
||||
conn = sqlite3.connect(DB_PATH)
|
||||
|
||||
Reference in New Issue
Block a user