Add Nav-I dashboard section with restore-as conflict resolution

- Create Nav-I top-level section in dashboard navigation
- Move Deleted Contacts from Knowledge subnav to Nav-I
- Add Nav-I landing page with card grid (deleted count, API keys stub)
- Add /nav-i/api-keys placeholder page
- Add restore-as endpoint for Home/Work conflict resolution
- Conflict modal in deleted contacts template for label rename on restore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-04-22 06:26:25 +00:00
commit 3280e34718
7 changed files with 210 additions and 3 deletions

View file

@ -82,7 +82,6 @@ KNOWLEDGE_SUBNAV = [
{'href': '/upload', 'label': 'Upload'},
{'href': '/web-ingest', 'label': 'Web Ingest'},
{'href': '/failures', 'label': 'Failures'},
{'href': '/deleted-contacts', 'label': 'Deleted Contacts'},
]
PEERTUBE_SUBNAV = [
@ -102,6 +101,12 @@ SETTINGS_SUBNAV = [
{'href': '/settings/health', 'label': 'Service Health'},
]
NAVI_SUBNAV = [
{'href': '/nav-i', 'label': 'Overview'},
{'href': '/deleted-contacts', 'label': 'Deleted Contacts'},
{'href': '/nav-i/api-keys', 'label': 'API Keys'},
]
def _format_source_citation(payload):
"""Format a human-readable citation from a search result payload."""
@ -335,11 +340,29 @@ def deleted_contacts_page():
user_id = get_user_id() or "anonymous"
db = ContactsDB()
contacts = db.list_deleted(user_id)
return render_template("knowledge/deleted_contacts.html",
domain="knowledge", subnav=KNOWLEDGE_SUBNAV, active_page="/deleted-contacts",
return render_template("navi/deleted_contacts.html",
domain="navi", subnav=NAVI_SUBNAV, active_page="/deleted-contacts",
contacts=contacts)
@app.route("/nav-i")
def navi_landing_page():
from .auth import get_user_id
from .contacts import ContactsDB
user_id = get_user_id() or "anonymous"
db = ContactsDB()
deleted_count = len(db.list_deleted(user_id))
return render_template("navi/landing.html",
domain="navi", subnav=NAVI_SUBNAV, active_page="/nav-i",
deleted_count=deleted_count)
@app.route("/nav-i/api-keys")
def navi_api_keys_page():
return render_template("navi/api_keys.html",
domain="navi", subnav=NAVI_SUBNAV, active_page="/nav-i/api-keys")
@app.route('/peertube')
def peertube_dashboard():
return render_template('peertube/dashboard.html',