Add "truly done" ticket archiving with auto-unhide

- Let the user mark closed tickets as really done and hide them, so
  tickets closed prematurely by an agent stay visible until confirmed
- User-side "archived" flag stored in the DB (independent of Zammad),
  added via a schema migration on existing databases
- Hide archived tickets from the overview by default with an
  "erledigte einblenden" toggle; archive/unarchive from the ticket
  detail page and via a per-row quick action
- Poller automatically un-hides an archived ticket when new activity is
  detected, so nothing is missed

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 17:34:09 +02:00
co-authored by Claude Opus 4.8
parent 1107a912bc
commit 528d66b2b0
6 changed files with 94 additions and 15 deletions
+10 -1
View File
@@ -31,7 +31,8 @@ CREATE TABLE IF NOT EXISTS tickets (
last_close_at TEXT,
raw_json TEXT,
first_seen_at TEXT,
last_synced_at TEXT
last_synced_at TEXT,
archived INTEGER NOT NULL DEFAULT 0
);
CREATE TABLE IF NOT EXISTS changes (
@@ -103,3 +104,11 @@ def get_conn():
def init_db() -> None:
with get_conn() as conn:
conn.executescript(SCHEMA)
_migrate(conn)
def _migrate(conn) -> None:
"""Nachträgliche Schema-Anpassungen für bestehende Datenbanken."""
cols = {r["name"] for r in conn.execute("PRAGMA table_info(tickets)")}
if "archived" not in cols:
conn.execute("ALTER TABLE tickets ADD COLUMN archived INTEGER NOT NULL DEFAULT 0")